Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Make an item appear after smashing plates?
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#6
RE: Make an item appear after smashing plates?

(04-18-2013, 05:58 PM)Yare Wrote: Huh, you mixed up quite many things Tongue
Here is how it should look like:

void OnStart()
{
SetLocalVarInt("BrokenPlates", 0);
SetEntityCallbackFunc("non_broken_*", "Break");
}



void Break(string &in asEntity, string &in type)
{
if(type == "Break")
{
AddLocalVarInt("BrokenPlates", 1);
if (GetLocalVarInt("BrokenPlates") == 5) SetEntityActive("CellarKey_01", true);
}
}

BrokenPlates - the name of variable (I guess), so it is firstly declared after "void OnStart()"
non_broken_* - it refers to entities, that is your plates to break, so it comes first in "SetEntityCallbackFunc"
Break - the name of the funtcion

Also, I am not sure if asterix (*) shall go like this "non_broken_*", or like this "non_broken_"* (I have never used that before). If the first way doesn't work, try the second one.
Don't worry, you used the asterisk the right way.
It's like if all things that have the name "non_broken_(number)" will do the same thing.

"Veni, vidi, vici."
"I came, I saw, I conquered."
04-19-2013, 10:06 AM
Find


Messages In This Thread
RE: Make an item appear after smashing plates? - by PutraenusAlivius - 04-19-2013, 10:06 AM



Users browsing this thread: 1 Guest(s)