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 activation

broken avatar :(
Created 12 years ago
by pashan
0 Members and 1 Guest are viewing this topic.
3,200 views
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
Signature
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
how do i make a trigger activate only if the player has activated 3 triggers.

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
Could you clarify pl0x?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
how do i make a trigger activate only if the player has activated 3 triggers.

Sounds like you want to enable a trigger only if three other triggers have been triggered?

There are several ways, as always. It depends on all the factors involved. Are the three triggers in functions or are they got doors or what? ZK has a buildable tut that covers how to activate a trigger, and the power, or whatever you want, only after other triggers have been triggered.
   
      https://www.youtube.com/watch?v=m3PYFwqq_eQ
Last Edit: May 09, 2014, 01:25:35 am by MakeCents
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
Code Snippet
Plaintext
trigger_init()
{
trig = getent("yayihaveatrigger","targetname")://your trigger
trig trigger_off();

flag_init("flag1");
flag_init("flag2");
flag_init("flag3");

wait_flag("flag1");
wait_flag("flag2");
wait_flag("flag3");

trig trigger_on();

just add
Code Snippet
Plaintext
flag_set("flag1");
}
 
ex.
Code Snippet
Plaintext
activate_trigger()
{
trig2 = getent("yayihavetwotriggers","targetname")://your trigger
trig2 waittill( "trigger", player );
flag_set("flag1");
}
after the trigger has been used and change the "flag1" obviously for each trigger
Last Edit: May 09, 2014, 04:26:02 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
When I do something like that were something will happen after certain triggers has been hit, I often do it like this. Instead of flags.
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
level.times_activated = 0;

trig1 = GetEnt("trig1","targetname");
trig2 = GetEnt("trig2","targetname");
trig3 = GetEnt("trig3","targetname");
        fourth_trig = GetEnt("fourth_trig","targetname");

       fourth_trig trigger_off();

trig1 thread activate_fourth_trigger();
trig2 thread activate_fourth_trigger();
trig3 thread activate_fourth_trigger();
}

activate_fourth_trigger(fourth_trig)
{
self setCursorHint( "HINT_NOICON" );
self sethintstring ("Press &&1 to activate me");
self waittill("trigger");
self delete();

level.times_activated = level.times_activated + 1;

if(level.times_activated == 3)
{
fourth_trig trigger_on();
                fourth_trig setCursorHint( "HINT_NOICON" );
        fourth_trig sethintstring ("Press &&1 to activate the final trigger");
                fourth_trig waittill ("trigger");
                fourth_trig delete();

                //DO STUFF HERE

}
}
I learned this from a person, but I don't remember who it was, sorry. :( But it sure learned me much. :D
(Note, script is untested.)
Last Edit: May 10, 2014, 06:42:35 am by Ege115
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
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
 why not just use a level var like this?

Code Snippet
Plaintext
main()
{
level.fourth_trig = getent("fourth_trig","targetname");
level.fourth_trig trigger_off();
level.times_used = 0;
}
trig_setup()
{
cost = 1000;
trig = getentarray("trigger","targetname");
while(1)
{
for(i = 0; i < trig.size; i++)
{
player = get_players();
trig[i] waittill("trigger", player);

if(player.score >= cost)
{
level.times_used++;
}
}
wait(1);
}
}
fourth_activate()
{
if(level.times_used == 3)
{
level.fourth_trigger trigger_on();
}
}

didn't test code.
Last Edit: May 09, 2014, 12:27:16 pm by daedra descent
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
3 great scripts but don't which one to use. Imma try them on the weekend and let you know which one i used by giving it best answer

(sorry for the late reply)
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
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Made a better version. Put all of the "fake" triggers into an array to reduce code usage.

Tell me how it goes:

Code Snippet
Plaintext
main()
{
// for the "FAKE" triggers
level.fake_trigs = getentarray("fake_trigger","targetname");
// The cost of all "fake" triggers
level.cost = 1000;
// how many trigs need to be activated first before main will show
level.required_trigs = 3;
// what value the trig usage is at
level.trig_count = 0;

level.true_trig = getent("true_trigger","targetname");
level.true_trig trigger_off();

fake_trigs();
}
fake_trigs()
{
while(isdefined(level.fake_trigs) )
{
for(i = 0; i < level.fake_trigs.size; i++)
{
level.fake_trigs[i] SetHintString( "Press F to activate trigger[cost: " + level.cost + "]" );

players = get_players();
level.fake_trigs[i] waittill("trigger", player);
if(player.score >= level.cost)
{
level.fake_trigs[i] delete();
player maps\_zombiemode_score::minus_to_player_score( level.cost );

level.trig_count++;

if(level.trig_count == level.required_trigs)
{
level.true_trig trigger_on();
true_trig();
}
}
}
wait(1);
}
}
true_trig();
{
level.true_trig sethintstring("Press F to activate TRUE trigger");
// do whatever here
}

 
Loading ...