UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Making the screen go black?

broken avatar :(
Created 12 years ago
by Ege115
0 Members and 1 Guest are viewing this topic.
3,368 views
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Hello fellow UGX members!

I am making a special ending for my map, and I am going to make so the screen goes black when you activate the end game trigger (Toms end game script) when the game ends.

And I am not saying that the screen is just going to become black when the game ends. No it is something else, you'll see the ending when you play the map  ;).

And it is not a buyable ending just so you know, they are so boring.

But now onto my quetion, how do I make the screen goes black when the game ends using Toms end game script?

Something like,

Code Snippet
Plaintext
end_game()
{
end_game_trig waittill ("trigger");
black_screen stuff here
wait(12);
tom_end_game  stuff here
}

Thanks in advance.
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
theres probably a function that fades the players vision. have a look in campaign scripts, you'll definitely find something in there.

BTW, could you also post the code for toms end game script aswell?
Last Edit: February 15, 2014, 01:19:31 am by daedra descent
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 7 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
or maybe theres already a black vision file for you to use with setvision function which already has an argument for the transition time

also i think theres something related to what daedra said in flares.gsc if you can take a look and unsderstand it
Last Edit: February 15, 2014, 05:50:09 am by jjbradman
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Quote
theres probably a function that fades the players vision. have a look in campaign scripts, you'll definitely find something in there.

BTW, could you also post the code for toms end game script aswell?

I was thinking the same, that I might find something in campaign scripts, but I was thinking that I was never going to find what I wanted, but I will give it a try.

And I don't have implimentet the end game script yet, I just made this small code as an example. But I have seen that you can find it at zombiemodding.

Quote
or maybe theres already a black vision file for you to use with setvision function which already has an argument for the transition time

also i think theres something related to what daedra said in flares.gsc if you can take a look and unsderstand

I'll take a look in the scripts and try to find what I am looking for.

Thanks jjbradman and deadra!

Who's going to have the best answer here?  :-\

Post Merge: February 15, 2014, 09:03:55 am
Edit: Also I found something in Ber3.gsc, could this be something?

Code Snippet
Plaintext
warp_player(pos)
{
self endon("death");
self endon("disconnect");

if(!isDefined(self.warpblack))
{
self.warpblack = NewClientHudElem( self );
self.warpblack.x = 0;
self.warpblack.y = 0;
self.warpblack.horzAlign = "full";
self.warpblack.vertAlign = "fullscreen";
self.warpblack.foreground = false;
self.sort = 50;
self.warpblack.alpha = 0;
self.warpblack SetShader( "black", 640, 480 );
}
self.warpblack FadeOverTime( .75 );
self.warpblack.alpha = 1;

wait(.75);
self setorigin(pos);
self.warpblack FadeOverTime( .75 );
self.warpblack.alpha = 0;
}
Last Edit: February 15, 2014, 09:03:55 am by Ege115
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 6 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter Elite
My Groups
More
×
YaPh1l's Groups
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
You don't need any vision files. You just create a fullscreen HUD element with a black texture and fade it in (and out again, if you want).
Edit: Also I found something in Ber3.gsc, could this be something?
Yes, this is basically doing just what I described.

- Phil.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Quote
Yes, this is basically doing just what I described.

- Phil.

So I can just add this so it maybe could look like,

Code Snippet
Plaintext
end_game()
{
end_game_trig waittill ("trigger");

    self endon("death");
    self endon("disconnect");
   
    if(!isDefined(self.warpblack))
    {
        self.warpblack = NewClientHudElem( self );
        self.warpblack.x = 0;
        self.warpblack.y = 0;
        self.warpblack.horzAlign = "full";
        self.warpblack.vertAlign = "fullscreen";
        self.warpblack.foreground = false;
        self.sort = 50;
        self.warpblack.alpha = 0;
        self.warpblack SetShader( "black", 640, 480 );
    }
    self.warpblack FadeOverTime( .75 );
    self.warpblack.alpha = 1;
       
    wait(.75);
    self setorigin(pos);
    self.warpblack FadeOverTime( .75 );
    self.warpblack.alpha = 0;

wait(12);
tom_end_game  stuff here
}

Would this work then? Obvisouly not if I just type "Tom_end_game stuff here" but lets say that that is the whole function, would it work then?
Last Edit: February 15, 2014, 03:36:14 pm by Ege115
Marked as best answer by Ege115 12 years ago
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 6 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter Elite
My Groups
More
×
YaPh1l's Groups
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
Well, you probably don't want the endon()'s and a server-wide HUD instead of a client HUD.
Also, this fades away again after 0.75 seconds, which you might want to either delay or remove.
And you also probably don't want to set the player origin.
Code Snippet
Plaintext
end_game()
{
end_game_trig waittill ("trigger");

        warpblack = NewHudElem();
        warpblack.x = 0;
        warpblack.y = 0;
        warpblack.horzAlign = "full";
        warpblack.vertAlign = "fullscreen";
        warpblack.foreground = false;
        warpblack.sort = 50;
        warpblack.alpha = 0;
        warpblack SetShader( "black", 640, 480 );
    warpblack FadeOverTime( .75 );
    warpblack.alpha = 1;

wait(12);
tom_end_game  stuff here
}

- Phil.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
It worked!

The screen got black, and the game ended.

Just one thing, the black screen didn't cover the whole screen. But I assume that I will have to change the line that says,

Code Snippet
Plaintext
 warpblack SetShader( "black", 640, 480 );

And my screen is 1920x1080, so I just have to change it to those numers of that size to the line right?

Also I'll give you the best answer Phil, thank you!
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 6 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter Elite
My Groups
More
×
YaPh1l's Groups
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
No. Try that.
Code Snippet
Plaintext
end_game()
{
end_game_trig waittill ("trigger");

        warpblack = NewHudElem();
        warpblack.horzAlign = "fullscreen";
        warpblack.vertAlign = "fullscreen";
        warpblack.foreground = false;
        warpblack.sort = 50;
        warpblack.alpha = 0;
        warpblack SetShader( "black", 640, 480 );
    warpblack FadeOverTime( .75 );
    warpblack.alpha = 1;

wait(12);
tom_end_game  stuff here
}

- Phil.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Quote
No. Try that.

Okey, now it is working as I imagined it to work. Thanks you for the help Phil!
+1

But remember folks, the ending is not just that it goes black. You'll see  ;)

 
Loading ...