Crunchygoblin
Junior Member
Posts: 15
Threads: 7
Joined: Jan 2011
Reputation:
0
|
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 |
|