Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Script error (forget it)
waqas12346 Offline
Senior Member

Posts: 352
Threads: 38
Joined: Nov 2010
Reputation: 1
#1
Script error (forget it)

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Function01", true, 1);
}
void Function01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", true);
AddEnemyPatrolNode("Monster", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_25", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_28", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_29", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_30", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_31", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_32", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_33", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_37", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_41", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_42", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_43", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_44", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_45", 0, "");
}

{
AddUseItemCallback("", "key_tower_1", "castle_arched01_7", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0.0f, true);
}

main (55,1) : ERR : Unexpected token '{''
AngryAngryAngryAngry
(This post was last modified: 05-01-2011, 11:43 AM by waqas12346.)
05-01-2011, 10:29 AM
Website Find
gandalf91 Offline
Senior Member

Posts: 439
Threads: 13
Joined: Feb 2011
Reputation: 0
#2
RE: Script error (forget it)

Is the use item callback meant to be created on start or as part of the monster function? If On Start, remove the surrounding brackets {} and move it into the onstart blocks under AddEntityCollideCallback. If it's part of the monster function, removes the } after the last enemy patrol node and the { before the callback. Wink
05-01-2011, 10:31 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#3
RE: Script error (forget it)

(05-01-2011, 10:29 AM)waqas12346 Wrote:
Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Function01", true, 1);
}
void Function01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", true);
AddEnemyPatrolNode("Monster", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_25", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_28", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_29", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_30", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_31", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_32", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_33", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_37", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_41", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_42", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_43", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_44", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_45", 0, "");
}

{
AddUseItemCallback("", "key_tower_1", "castle_arched01_7", "KeyOnDoor", true);
}


void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0.0f, true);
}

main (55,1) : ERR : Unexpected token '{''
AngryAngryAngryAngry

The bold part has no function and should therefore not have any {}'s. I would remove the brackets and move it up inside the OnStart function.
05-01-2011, 11:37 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#4
RE: Script error (forget it)

I feel like I've seen some script almost exactly like this a while ago... oh well. :/

05-02-2011, 02:50 AM
Find




Users browsing this thread: 1 Guest(s)