Scripting help
So I'm incredibly new at scripting and I can't help but jump right in - I've been working on the same issue for a few hours now and searched the web to no avail - if anyone can figure out why I'm getting the "Unexpected Token" error, I would be greatly appreciative.
Here is the full script:
////////////////////////////
// Run when the map starts
void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("brute_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_10", 0, "");
SetEntityActive("brute_1", true);
}
{
AddUseItemCallback("", "cellar_key_1", "cellar_1", "UsedKeyOnDoor", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellar_1", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_1", 0, false);
RemoveItem("cellar_key_1");
}
EDIT: I figured out what was wrong...there were some things mixed up everywhere, including in the bit of script that I didn't think was essential or doing anything.
void FUNCTION(string &in asItem, string &in asEntity) was supposed to be 'void UsedKeyOnDoor(string &in asItem, string &in asEntity)
(This post was last modified: 07-19-2013, 04:58 PM by EvilDeadPunk.)
|