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

2 triggers 1 door

broken avatar :(
Created 12 years ago
by basziee
0 Members and 1 Guest are viewing this topic.
3,265 views
broken avatar :(
×
broken avatar :(
Location: nlNetherlands
Date Registered: 13 September 2013
Last active: 9 years ago
Posts
43
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Kill all the zombies
×
basziee's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
basziee's Contact & Social Linksschnitzel--basziee
hi there i'm trying to get 2 damage triggers for 1 door

this is the script that i'm using
Code Snippet
Plaintext
//Secret_Easter_Egg
Secret_trigger_1()
{
   trig1 = getEnt("secret_trigger","targetname");
   trig1 waittill("trigger", player );
   trig1 delete();
   trig1 SetCursorHint( "HINT_NOICON" );


self.secret_trigger_num = self.secret_trigger_num + 1;


thread secret_door();
}


secret_trigger_2()
{
   trig2 = getEnt("secret_trigger2","targetname");
   trig2 waittill("trigger", player );
   trig2 delete();
   trig2 SetCursorHint( "HINT_NOICON" );


self.secret_trigger_num = self.secret_trigger_num + 1;


thread secret_door();
}


secret_door()
{
door = getEnt("secret_door","targetname");
if(self.secret_trigger_num == 2)
{
door movez(-500, 25);
wait 8;
door delete();
}
}



i also got somebody who helped me and said:
You do not initialize
Code Snippet
Plaintext
secret_trigger_num
with 0 at any point (at least in the script parts you posted). You might want to do that.

but i have no clue what to change now i think it has to be this line

Code Snippet
Plaintext
self.secret_trigger_num = self.secret_trigger_num + 1;

but what do i change it to?
Last Edit: January 17, 2014, 02:06:16 pm by basziee
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
I don't understand your question, you have it set up to use two triggers already.
broken avatar :(
×
broken avatar :(
Location: nlNetherlands
Date Registered: 13 September 2013
Last active: 9 years ago
Posts
43
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Kill all the zombies
×
basziee's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
basziee's Contact & Social Linksschnitzel--basziee
yeah but if i shoot trigger 2 nothing happens and if i shoot trigger 1 the door goes open

but i want if i shoot trigger 1 and trigger 2 then the door opens
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
Code Snippet
Plaintext
self.secret_trigger_num = self.secret_trigger_num + 1;

self.secret_trigger_num already has a value of one, so adding a +1 to it will make it 2, and adding another +1 in trigger 2 will make it a value of 3, At least that's what i'm guessing, could be wrong.
broken avatar :(
×
broken avatar :(
Location: usbuffalo
Date Registered: 16 August 2013
Last active: 5 months ago
Posts
927
Respect
Forum Rank
The Decider
Primary Group
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.
Mapper Has released one or more maps to the UGX-Mods community.
RamboBadass's Contact & Social LinksRamboDaGreatAsk merambobadass
yeah but if i shoot trigger 2 nothing happens and if i shoot trigger 1 the door goes open

but i want if i shoot trigger 1 and trigger 2 then the door opens

you have to make 2  doors just sel. the brush make it thinner (1/2) the size and hit the space bar.
then change the kvps for the 2nd one to the secret door 2  and make sure you and this
find this in your map name.gsc
Code Snippet
Plaintext
maps\_zombiemode::main();

and add this under it
Code Snippet
Plaintext
	thread secret_trigger();
thread secret_trigger2();

then add this at the end
Code Snippet
Plaintext
//Trigger_2
Secret_trigger2()
{

door = getEnt("secret_door2","targetname");
trig = getEnt("secret_trigger2","targetname");

trig waittill("trigger");
trig delete();
trig SetCursorHint( "HINT_NOICON" );
trig setHintString("DOOR UNLOCKED");

door movez(-500, 20);
wait 7;
door delete();


}

this is what your looking for if someone could explain better that would be great ... I suck at the explaining part lol

Last Edit: January 17, 2014, 04:45:22 pm by rambobada555555
broken avatar :(
×
broken avatar :(
Location: nlNetherlands
Date Registered: 13 September 2013
Last active: 9 years ago
Posts
43
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Kill all the zombies
×
basziee's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
basziee's Contact & Social Linksschnitzel--basziee
tell me if i'm wrong but why would i need a second door if i want 2 triggers for 1 door? :-[
broken avatar :(
×
broken avatar :(
Location: usbuffalo
Date Registered: 16 August 2013
Last active: 5 months ago
Posts
927
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Giggity.
×
RamboBadass's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Mapper Has released one or more maps to the UGX-Mods community.
RamboBadass's Contact & Social LinksRamboDaGreatAsk merambobadass
because as far as I know you cant have two triggers for one door its just theway code is, but I have it set up like I said but with 3 on my map and I have 3 doors all with there own secret trig. works great but maybe a ugx team member will see this and clarify. prob later at night 
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
Of course you can have three triggers for a door.
As I already said on the ZM topic, you don't have self.secret_trigger_num initialized.
You need to add
Code Snippet
Plaintext
self.secret_trigger_num = 0;
before you call your trigger threads.

- Phil.

 
Loading ...