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
Expected Scriptline?
P44RTHURN4X Offline
Junior Member

Posts: 35
Threads: 16
Joined: Apr 2012
Reputation: 0
#1
Expected Scriptline?

Hey all,

I started a new custom story project last week and in the 1st map was this:
FATAL ERROR:Could not load script file '...'!
main (29,1): ERR :Expected ';'

my .hps file:

////////////////////////////
//Run first time starting map
void OnStart()
{
PlayMusic("race_menu.ogg", true, 1.0f, 0.5f, 0, true);
SetPlayerActive(false);
SetInventoryDisabled(true);
SetPlayerCrouchDisabled(true);
StartPlayerLookAt("enemy2_1", 10.0f, 8.7f, "");
AddTimer("lookat_timer", 4.0f, "sla1");
SetEnemyDisableTriggers("enemy2_1", true);
SetEnemyDisableTriggers("enemy2_2", true);
SetEnemyDisableTriggers("enemy2_3", true);
AddEnemyPatrolNode("enemy2_1", "PathNodeArea_1", 20, "idle.anm");
AddEnemyPatrolNode("enemy2_1", "PathNodeArea_4", 0, "attack_run.anm");
AddEnemyPatrolNode("enemy2_2", "PathNodeArea_2", 20, "idle.anm");
AddEnemyPatrolNode("enemy2_2", "PathNodeArea_5", 0, "attack_run.anm");
AddEnemyPatrolNode("enemy2_3", "PathNodeArea_3", 20, "idle.anm");
AddEnemyPatrolNode("enemy2_3", "PathNodeArea_6", 0, "attack_run.anm");
AddEntityCollideCallback("Player", "end_scf", "EndP", true, 1);
AddEntityCollideCallback("enemy2_1", "end_scf", "EndE", true, 1);
AddEntityCollideCallback("enemy2_2", "end_scf", "EndE", true, 1);
AddEntityCollideCallback("enemy2_3", "end_scf", "EndE", true, 1);
AddEntityCollideCallback("Player", "speed_one", "SpeedUp_1", true, 1);
AddEntityCollideCallback("enemy2_1", "speed_one", "SwitchEntity_1", true, 1);
AddEntityCollideCallback("enemy2_2", "speed_one", "SwitchEntity_2", true, 1);
AddEntityCollideCallback("enemy2_3", "speed_one", "SwitchEntity_3", true, 1);
AddEntityCollideCallback("Player", "speed_one_1", "SpeedUp_2", true, 1)
*THIS IS LINE 29* AddEntityCollideCallback("enemy2_1_2", "speed_one_1", "SwitchEntity_1_2", true, 1);
AddEntityCollideCallback("enemy2_2_2", "speed_one_1", "SwitchEntity_2_2", true, 1);
AddEntityCollideCallback("enemy2_3_2", "speed_one_1", "SwitchEntity_3_2", true, 1);
}


void sla1(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("enemy2_2", 12.0f, 10.0f, "");
AddTimer("lookat_timer", 3.0f, "sla2");
}


void sla2(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("enemy2_3", 3.0f, 1.0f, "");
AddTimer("lookat_timer", 2.2f, "sla3");
}


void sla3(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("PathNodeArea_2", 7.0f, 7.0f, "");
AddTimer("lookat_timer", 2.34f, "sla4");
}


void sla4(string &in asTimer)
{
PlayMusic("race_start.ogg", true, 1.0f, 1.0f, 0, true);
StopPlayerLookAt();
AddTimer("lookat_timer", 1.0f, "start");
}


void start(string &in asTimer)
{
StopMusic(1.0f, 0);
SetPlayerActive(true);
SetPlayerMoveSpeedMul(1000);
SetPlayerRunSpeedMul(99999);
}


void EndP(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(true);
StopMusic(1.0f, 0);
PlayMusic("race_win.ogg", true, 1.0f, 1.0f, 0, true);
StartEffectFlash(0.0f, 0.6f, 0.3f);
}


void EndE(string &in asEntity)
{
SetEnemyDisableTriggers("enemy2_1", false);
SetEnemyDisableTriggers("enemy2_2", false);
SetEnemyDisableTriggers("enemy2_3", false);
ShowEnemyPlayerPosition("enemy2_1");
ShowEnemyPlayerPosition("enemy2_2");
ShowEnemyPlayerPosition("enemy2_3");
SetPlayerActive(false);
StopMusic(1.0f, 0);
PlayMusic("race_lose.ogg", true, 1.0f, 1.0f, 0, true);
StartEffectFlash(0.0f, 0.6f, 0.3f);
}


void SpeedUp_1(string &in asParent, string &in asChild, int alState)
{
SetPlayerMoveSpeedMul(50);
SetPlayerRunSpeedMul(100);
}


void SwitchEntity_1(string &in asEntity)
{
SetEntityActive("enemy2_1", false);
SetEntityActive("enemy2_1_2", true);
AddEnemyPatrolNode("enemy2_1_2", "PathNodeArea_4", 0, "attack_run.anm");
}


void SwitchEntity_2(string &in asEntity)
{
SetEntityActive("enemy2_2", false);
SetEntityActive("enemy2_2_2", true);
AddEnemyPatrolNode("enemy2_2_2", "PathNodeArea_5", 0, "attack_run.anm");
}


void SwitchEntity_3(string &in asEntity)
{
SetEntityActive("enemy2_3", false);
SetEntityActive("enemy2_3_2", true);
AddEnemyPatrolNode("enemy2_3_2", "PathNodeArea_6", 0, "attack_run.anm");
}


void SpeedUp_2(string &in asParent, string &in asChild, int alState)
{
SetPlayerMoveSpeedMul(250);
SetPlayerRunSpeedMul(500);
}


void SwitchEntity_1_2(string &in asEntity)
{
SetEntityActive("enemy2_1", false);
SetEntityActive("enemy2_1_3", true);
AddEnemyPatrolNode("enemy2_1_3", "PathNodeArea_4", 0, "attack_run.anm");
}


void SwitchEntity_2_2(string &in asEntity)
{
SetEntityActive("enemy2_2", false);
SetEntityActive("enemy2_2_3", true);
AddEnemyPatrolNode("enemy2_2_3", "PathNodeArea_5", 0, "attack_run.anm");
}


void SwitchEntity_3_2(string &in asEntity)
{
SetEntityActive("enemy2_3", false);
SetEntityActive("enemy2_3_3", true);
AddEnemyPatrolNode("enemy2_3_3", "PathNodeArea_6", 0, "attack_run.anm");
}


I cannot find a fail at line 29, and I don't know what's wrong with the ;
Did you find it?
05-03-2012, 03:32 PM
Find
Oscar House Offline
Senior Member

Posts: 302
Threads: 3
Joined: Nov 2010
Reputation: 9
#2
RE: Expected Scriptline?

Simply, you forgot a ; from the end of one of the AddEntityCollideCallBacks, the one right above line 29.

[Image: 2exldzm.png]
05-03-2012, 04:05 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#3
RE: Expected Scriptline?

I also want to add that to for yourself:

If you get error like this:
main (29,1): ERR :Expected ';'



Then the (x, y) i the place, around where error is. 29 is line and 1 is the symbol number.


In that case you had error on 29th line and the problem was most likely that you were missing ; symbol, as above poster stated Smile!

The Interrogation
Chapter 1

My tutorials
05-04-2012, 12:05 AM
Find




Users browsing this thread: 2 Guest(s)