The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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 Question about parameters
Zokrar Offline
Member

Posts: 85
Threads: 16
Joined: May 2013
Reputation: 0
#1
Question about parameters

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...

void RandomFunc(string &in asParent, string &in asChild, int alState)

For example, if I have the following script:

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.

(This post was last modified: 12-26-2013, 05:04 AM by Zokrar.)
12-26-2013, 04:58 AM
Find


Messages In This Thread
Question about parameters - by Zokrar - 12-26-2013, 04:58 AM
RE: Question about parameters - by Romulator - 12-26-2013, 05:56 AM
RE: Question about parameters - by Zokrar - 12-26-2013, 04:52 PM
RE: Question about parameters - by WALP - 12-26-2013, 05:17 PM
RE: Question about parameters - by Zokrar - 12-26-2013, 05:22 PM
RE: Question about parameters - by Zokrar - 12-27-2013, 01:59 AM
RE: Question about parameters - by Adrianis - 12-28-2013, 01:05 AM
RE: Question about parameters - by Romulator - 12-27-2013, 02:07 AM



Users browsing this thread: 1 Guest(s)