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