12-26-2013, 04:58 AM
I'm relatively uneducated when it comes to programming in general, so if possible, please try to explain simply.
My question is, why do callback functions require parameters? Such as...
For example, if I have the following script:
Why were the parameters required in the EventDoor function? I didn't reference them in the brackets.
My question is, why do callback functions require parameters? Such as...
Code:
void RandomFunc(string &in asParent, string &in asChild, int alState)For example, if I have the following script:
Code:
AddEntityCollideCallback("Player", "AreaDoor", "EventDoor", true, 1);
void EventDoor(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("Player collided with AreaDoor. Starting door scare.", false);
SetSwingDoorClosed("Door", false, false);
SetSwingDoorDisableAutoClose("Door", true);
PlaySoundAtEntity("creak", "joint_door_move_special.snt", "Door", 1, false);
AddTimer("", 2, "TimerStopSound");
AddTimer("Door", 0, "TimerMoveDoor");
}Why were the parameters required in the EventDoor function? I didn't reference them in the brackets.
