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?
Dominic0904 Offline
Member

Posts: 63
Threads: 14
Joined: Apr 2011
Reputation: 0
#5
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.

Yeah the code you quoted worked Smile Thanks a bunch! Now I just need to break it down and learn what certain things do. Like the whole local variable thing confuses me a lot :/
04-18-2013, 06:32 PM
Find


Messages In This Thread
RE: Make an item appear after smashing plates? - by Dominic0904 - 04-18-2013, 06:32 PM



Users browsing this thread: 1 Guest(s)