Have you ever wondered what it is when people talk about a parameter?
Don't you know how it works? Well, I'll tell you.
A parameter is the little amount of text inside these ( Parameter)
They always come after: void function() <-- parameter goes in here
parameters are used to specify what kind of callback you want.
Here are some common examples:
AddEntityCollideCallback
Colliding = (string &in asParent, string &in asChild, int alState)
SetEntityPlayerInteractCallback
Interacting = (string &in asEntity)
AddUseItemCallback
Use Item = (string &in asItem, string &in asEntity)
SetEntityPlayerLookAtCallback
Look-at function = (string &in asEntity, int alState)
CheckPoint
Checkpoint function = (string &in asName, int alCount)
AddTimer
Timer function = (string &in asTimer)
SetEntityCallbackFunc
SetEntityCallbackFunc = (string &in asEntity, string &in asType)
Now these parameters are commonly used in scripts and if-statements.
If you don't know what an if-statement is then you should check that out first, because that will make your scripting even better!
I will give you some function examples for each of the codes i have listed above:
AddEntityCollideCallback("Player", "ScriptArea_1", "CollideFunction", true, 0);
SetEntityPlayerInteractCallback("ScriptArea", "InteractFunction", true);
**Notice that in the next function there is 2 items, but only 1 script area**
AddUseItemCallback("", "Item_1", "ScriptArea_1", "UseItemFunction", true);
AddUseItemCallback("", "Item_2", "ScriptArea_1", "UseItemFunction", true);
CheckPoint("", "PlayerStartArea_1", "CheckpointFunction", "DeathHints", "Entry_1");
**Notice that "asTimer" is the same as "asName"**
**Also notice that I am calling 2 timers. The first is called in 5 seconds. The second is called in 10 seconds. Both of them is calling the same function, but they have different asName**
AddTimer("Timer_1", 5, "TimerFunction");
AddTimer("Timer_2", 10, "TimerFunction");
**Notice that in this script i am interacting with a candle, but it could have been a lot of other stuff... Though the Onignite only works on candles (I guess)**
SetEntityCallbackFunc("candle_1", "CallbackFunction");
Trying is the first step to success.