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

secret door opens as soon as im in game

broken avatar :(
Created 11 years ago
by Tommy Rampage
0 Members and 1 Guest are viewing this topic.
2,427 views
broken avatar :(
×
broken avatar :(
Location: gbUnited Kingdom
Date Registered: 25 February 2015
Last active: 9 years ago
Posts
42
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Lets Slay Some Stiff's
Signature
the victim is the victim, regardless of how their demise manifests itself.
×
Tommy Rampage's Groups
Tommy Rampage's Contact & Social LinksTommyRampagedaslovegloveTommy_rampage@DASLOVEGLOVE
hello guys could i get a bit of help please for  all i know this could be something really easy to fix but im still learning the basics
so ive set up a door with 3 damage trigs

Code Snippet
Plaintext
//Secret_Easter_Egg
secret_door()
{
   door = getEnt("secret_door","targetname");
   if(self.secret_trigger_num == 3)
   {
      door movez(-500, 25);
      iprintlnbold ("You found them! Secret door unlocked!");
      wait 8;
      door delete();
   }
}




hidden_secret()
{
   count = 0;
   trig1 = getEnt("secret_trigger","targetname");
   trig2 = getEnt("secret_trigger1","targetname");
   trig3 = getEnt("secret_trigger2","targetname");
   self thread tmdewait( trig1 );
   self thread tmdewait( trig2 );
   self thread tmdewait( trig3 );
   while(1)
   {
      wait 1;
      self waittill( "got_easter" );
      count = count+1;
      if ( count == 3 )
      {
         thread secret_door();
      }
   }
}




tmdewait( trig )
{
   trig waittill("trigger", player );
   trig delete();
   iprintlnbold ("You found one!");
   self notify( "got_easter" );
}


it seems ive done everything right apart from as soon as i get in the game it unlocks the door and txt shows on screen saying its unlocked

i called
Code Snippet
Plaintext
thread secret_door();
  under zombie mode, should i have called it in pre load or post load


Thanks for the Help
-Tommy
Marked as best answer by Tommy Rampage 11 years ago
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
Not sure where to start here Tommy. Your use of self is not correct. You probably wanted to thread hidden_secret not secret_door to start. But your whole set up is kind of awkward.

If you are just trying to learn more, you may want to try a few things.
 - Look at your use of self. Self represents the object that the function was thread on.
 - Note that if something is undefined it passes as true.
 - add iprintlnbold("this is happening"); statements through out your code to help you troubleshoot what is happening.


Spoiler: click to open...
self.secret_trigger_num is undefined so that is opening your door right away since you thread secret_door off the bat.
your code might even work if you thread hidden_secret instead but it isn't right or free of errors.
after you get this working, think about if you could do this with an array of triggers using the same kvps?
Last Edit: April 08, 2015, 03:13:22 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbUnited Kingdom
Date Registered: 25 February 2015
Last active: 9 years ago
Posts
42
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Lets Slay Some Stiff's
×
Tommy Rampage's Groups
Tommy Rampage's Contact & Social LinksTommyRampagedaslovegloveTommy_rampage@DASLOVEGLOVE
Thanks for the help MakeCents il give thread hidden_secret a try for now and then see what i could work upon from there trying to take it one step at a time so not to confuse my self.
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
In addition to what MakeCents said, if you need more than one entity that does the same thing you should use an array instead of executing code on each individual entities.

Also, the whole got_easter notify part isn't needed. You can just thread a basic trig function to check if the amount of trigs is equal to the amount triggered.

Can't give code examples because I'm on a tablet. Sorry. :P
broken avatar :(
×
broken avatar :(
Location: gbUnited Kingdom
Date Registered: 25 February 2015
Last active: 9 years ago
Posts
42
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Lets Slay Some Stiff's
×
Tommy Rampage's Groups
Tommy Rampage's Contact & Social LinksTommyRampagedaslovegloveTommy_rampage@DASLOVEGLOVE
Thanks for your help too daedra descent  as MakeCents said  thread hidden_secret  worked right off so for now that will do, but im going to see what else i could do with this im not 100% sure what to do with arrays or how id even start tbh im still learning ive come from scrippting Arma 2 Dayz to this and i wasnt amazing at scripting anyway
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
i think your also gonna need to activate that zone behind the door, and connect the paths?

You want me to write something up?
broken avatar :(
×
broken avatar :(
Location: gbUnited Kingdom
Date Registered: 25 February 2015
Last active: 9 years ago
Posts
42
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Lets Slay Some Stiff's
×
Tommy Rampage's Groups
Tommy Rampage's Contact & Social LinksTommyRampagedaslovegloveTommy_rampage@DASLOVEGLOVE
i think your also gonna need to activate that zone behind the door, and connect the paths?

You want me to write something up?

i got it to work right off the bat with what MakeCents said as its just a small alcove behind the door that has a default model for the song and a buyable minigun in it... if you think i need to do other things for it and  if you have the time and are willing to help then by all means please do Harry  im here to learn after all  :)

i do believe im having trouble connecting my paths as my zombies dont follow me though doors a have them set as dynamic paths
Last Edit: April 08, 2015, 09:57:12 pm by Tommy Rampage

 
Loading ...