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
Scripting help
EvilDeadPunk Offline
Junior Member

Posts: 3
Threads: 1
Joined: Jul 2013
Reputation: 0
#1
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.)
07-19-2013, 03:36 AM
Find


Messages In This Thread
Scripting help - by EvilDeadPunk - 07-19-2013, 03:36 AM
RE: Scripting help - by Tomato Cat - 07-19-2013, 05:05 AM
RE: Scripting help - by EvilDeadPunk - 07-19-2013, 07:42 AM
RE: Scripting help - by No Author - 07-19-2013, 10:21 AM
RE: Scripting help - by EvilDeadPunk - 07-19-2013, 04:57 PM



Users browsing this thread: 1 Guest(s)