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
i just dont get it...?
Crunchygoblin Offline
Junior Member

Posts: 15
Threads: 7
Joined: Jan 2011
Reputation: 0
#4
RE: i just dont get it...?

Here's an example script. What it does is when you walk into a script box named "area1" it will set a skull to active or visible and give sanity damage.

Now for the break down.

Under the void Onstart is where you is the line of code that basically says, When the "Player" (this can also being an object or enemy) collides with the script box called "area1" Goto "skullactive". You can name the area1 or skullactive whatever you want. Next at the top is the script you told it to go to. The name of the void can be whatever you want it to be, as long as its the same as the line under the Void OnStart. So after tell the script where to go when you collide with the box, it simply tells the skull to go from being unactive to active. (this script applies to anything you can set to active or unactive in the editor. Then it give you some sanity damage.




void skullactive(string &in asItem, string &in asEntity)
{
SetEntityActive("human_skull_2" , true);
GiveSanityDamage(10,true);

}



void OnStart()
{
AddEntityCollideCallback("Player", "area1", "skullactive", true, 1);
}
02-13-2011, 10:43 PM
Find


Messages In This Thread
i just dont get it...? - by zatrix - 02-13-2011, 08:36 PM
RE: i just dont get it...? - by Tanshaydar - 02-13-2011, 09:06 PM
RE: i just dont get it...? - by zatrix - 02-13-2011, 09:33 PM
RE: i just dont get it...? - by Crunchygoblin - 02-13-2011, 10:43 PM



Users browsing this thread: 1 Guest(s)