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

Trigger Scripting

broken avatar :(
Created 10 years ago
by pashan
0 Members and 1 Guest are viewing this topic.
2,998 views
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 3 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
Signature
×
pashan's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
How do i make a trigger activable only if the player kill a certain amount of zombies near it.
broken avatar :(
×
broken avatar :(
Location: usbuffalo
Date Registered: 16 August 2013
Last active: 11 months ago
Posts
927
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Giggity.
Signature
maps:
Undead Town
http://ugx-mods.com/forum/index.php?topic=2294.0 (Release)
Origins 1922
http://ugx-mods.com/forum/index.php?topic=2659.0
[WIP] mapping 39%, weapons 85%, scripts 65%
[/url]
×
RamboBadass's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
RamboBadass's Contact & Social LinksAsk merambobadassRamboDaGreat
Humm neat idea DualVII can come up with a nice efficient script. Id way on him.
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 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
actually this would be pretty easy o.O  go to zombiemode_spawner and below the init() bracket add

Code Snippet
Plaintext
level.zombs_killed = 0;
zomb_trig = getent("triggy","targetname"); // again change this
zomb_trig disable_trigger();

and then search for

Code Snippet
Plaintext
zombie_spawn_init( animname_set )

and add

Code Snippet
Plaintext
self thread zom_waiter();
like this

Code Snippet
Plaintext
zombie_spawn_init( animname_set )
{
self thread zom_waiter();

then add this to the bottom

Code Snippet
Plaintext
zom_waiter()
{
zomb_trig = getent("triggy","targetname"); //change triggy to your trig targetname lol
self waittill( "death" );
dist = Distance( self.origin, trig.origin );
    if(dist < 200)
    {
    playfx(level._effect["powerup_grabbed_wave"], self.origin ); //this is just for decoration xP
    level.zombs_killed++;
    }
if(level.zombs_killed == 20)
{
//do stuff
                        zomb_trig enable_trigger();
}
}

edited: i missed some things :P
Last Edit: April 22, 2014, 02:28:51 am by jjbradman
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
actually this would be pretty easy o.O  go to zombiemode_spawner and below the init() bracket add

Code Snippet
Plaintext
level.zombs_killed = 0;

and then search for

Code Snippet
Plaintext
zombie_spawn_init( animname_set )

and add

Code Snippet
Plaintext
self thread zom_waiter();
like this

Code Snippet
Plaintext
zombie_spawn_init( animname_set )
{
self thread zom_waiter();

then add this to the bottom

Code Snippet
Plaintext
zom_waiter()
{
trig = getent("triggy","targetname"); //change triggy to your trig targetname lol
self waittill( "death" );
dist = Distance( self.origin, trig.origin );
    if(dist < 200)
    {
    playfx(level._effect["powerup_grabbed_wave"], self.origin ); //this is just for decoration xP
    level.zombs_killed++;
    }
if(level.zombs_killed == 20)
{
//do stuff
}
}

edited: i missed some things :P

Wouldnt you also need to disable the trigger before the code since he wants it to appear after killing enough zombies, then once you kill enough zombies by it you enable it?
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 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
Wouldnt you also need to disable the trigger before the code since he wants it to appear after killing enough zombies, then once you kill enough zombies by it you enable it?
well yeah but i didnt covered that part  :o he would have to enable the trigger in the "//do stuff" part

Post Merge: April 22, 2014, 02:29:27 am
anyways i've added the part to enable and disable it
Last Edit: April 22, 2014, 02:29:27 am by jjbradman

 
Loading ...