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
Multiple use of a void OnStart, need help D:
ApeCake Offline
Member

Posts: 116
Threads: 20
Joined: Jun 2012
Reputation: 4
#1
Multiple use of a void OnStart, need help D:

Hi guys, I am new to scripting and I am currently trying out almost all the script on the wiki. However, most of the ones I want to use require void OnStart(). This didn't seem like a problem to me, but I somehow can't get multiple scripts to work with void OnStart().

Example;


void OnStart()

{
AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("key_1", "OnPickup");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);
RemoveItem("key_1");
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("monster_grunt", true);
ShowEnemyPlayerPosition("monster_grunt");
}
//new thing here
{
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
}
void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "popuptext1", 5);
}

void OnEnter()
{
}

void OnLeave()
{
}


When starting up my map, an error shows up saying ''main (18, 1) : ERR : Unexpected Token '{'.
But when I remove the { and } on 18, another error comes by showing ''main (19, 25) : ERR : Expected indentifier. However, I have no idea how to fix this. If this is the way to do it, how do I add this 'indentifier? This seems to be so simple! Am I just missing something easy?

I am sorry if this has been asked before, I couldn't find anything like this. Also forgive me for any grammar/spelling errors. Not my native language, you see.
(This post was last modified: 06-22-2012, 08:31 PM by ApeCake.)
06-09-2012, 10:08 PM
Find


Messages In This Thread
Multiple use of a void OnStart, need help D: - by ApeCake - 06-09-2012, 10:08 PM



Users browsing this thread: 1 Guest(s)