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
script error! help me!
skirnks017 Offline
Junior Member

Posts: 17
Threads: 11
Joined: Mar 2012
Reputation: 0
#1
Sad  script error! help me!

i have a problem in amnesia custom history
help me please

this is my error : [Image: 2zexhdv.png]



and this is my script :

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "PlayerStartArea_1", "Reset", true, 1);
SetEntityPlayerInteractCallback("lantern_1", "ActivateMonster", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "ApareceMounstruo", true, 0);
AddEntityCollideCallback("Player", "Scary_Area_2", "Scary_2", true, 1);
AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
SetEntityPlayerInteractCallback("music", "Roar2", true);
SetEntityPlayerInteractCallback("music", "Roar1", true);
AddUseItemCallback("", "llave1", "puerta1", "KeyOnDoor", true); //Puerta1
AddUseItemCallback("", "llave3", "puerta3", "KeyOnDoor3", true); //Puerta3

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("puerta1", false, true);
PlaySoundAtEntity("", "unlock_door", "puerta1", 0, false);
RemoveItem("llave1");
}

void KeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("puerta3", false, true);
PlaySoundAtEntity("", "unlock_door", "puerta3", 0, false);
RemoveItem("llave3");
}

void ApareceMounstruo(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
ShowEnemyPlayerPosition("servant_grunt_1");
PlaySoundAtEntity("amb_hunt", "amb_hunt.snt", "player", 5, false);
}

void Scary_2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("cotito_1", true);
AddPropImpulse("cotito_1", 30, 0, 0, "world");
PlaySoundAtEntity("cotito_1", "24_iron_maiden.snt", "Player", 0, false);
AddTimer("", 0.3f, "Timer_2");
}
void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("HxH48Piano.ogg", true, 1.5, 2, 1, true);
}

void Roar1(string &in Entity)
{
PlaySoundAtEntity("Roar1", "Skirnks theme.snt", "Roar1", 0, false);
}

void Roar2(string &in Entity)
{
PlaySoundAtEntity("Roar2", "HxH48Piano1.snt", "Roar2", 0, false);
}


void Reset (string &in asParent, string &in asChild, int alState)
{


}

void OnLeave()
{

}

void ActivateMonster(string &in item)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "Idle");
SetEntityActive("servant_brute_2", true);
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
SetEntityActive("servant_grunt_1", true);
}

////////////////////////////
// Run when leaving map



Bye!
04-12-2012, 10:53 PM
Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#2
RE: script error! help me!

void ActivateMonster(string &in item)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "Idle");
SetEntityActive("servant_brute_2", true);
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
SetEntityActive("servant_grunt_1", true);
}

Isn't in OnLeave, OnStart, or OnEnter. Move it to where you want it.

The Nightmares v1.0 - Dreadful Fires WIP
04-12-2012, 11:06 PM
Find
skirnks017 Offline
Junior Member

Posts: 17
Threads: 11
Joined: Mar 2012
Reputation: 0
#3
RE: script error! help me!

(04-12-2012, 11:06 PM)Strembitsky Wrote:
void ActivateMonster(string &in item)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "Idle");
SetEntityActive("servant_brute_2", true);
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
SetEntityActive("servant_grunt_1", true);
}

Isn't in OnLeave, OnStart, or OnEnter. Move it to where you want it.
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "PlayerStartArea_1", "Reset", true, 1);
SetEntityPlayerInteractCallback("lantern_1", "ActivateMonster", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "ApareceMounstruo", true, 0);
AddEntityCollideCallback("Player", "Scary_Area_2", "Scary_2", true, 1);
AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
SetEntityPlayerInteractCallback("music", "Roar2", true);
SetEntityPlayerInteractCallback("music", "Roar1", true);
AddUseItemCallback("", "llave1", "puerta1", "KeyOnDoor", true); //Puerta1
AddUseItemCallback("", "llave3", "puerta3", "KeyOnDoor3", true); //Puerta3

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("puerta1", false, true);
PlaySoundAtEntity("", "unlock_door", "puerta1", 0, false);
RemoveItem("llave1");
}

void KeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("puerta3", false, true);
PlaySoundAtEntity("", "unlock_door", "puerta3", 0, false);
RemoveItem("llave3");
}

void ActivateMonster(string &in item)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "Idle");
SetEntityActive("servant_brute_2", true);
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("servant_brute_2", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
SetEntityActive("servant_grunt_1", true);
}

void ApareceMounstruo(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
ShowEnemyPlayerPosition("servant_grunt_1");
PlaySoundAtEntity("amb_hunt", "amb_hunt.snt", "player", 5, false);
}

void Scary_2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("cotito_1", true);
AddPropImpulse("cotito_1", 30, 0, 0, "world");
PlaySoundAtEntity("cotito_1", "24_iron_maiden.snt", "Player", 0, false);
AddTimer("", 0.3f, "Timer_2");
}
void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("HxH48Piano.ogg", true, 1.5, 2, 1, true);
}

void Roar1(string &in Entity)
{
PlaySoundAtEntity("Roar1", "Skirnks theme.snt", "Roar1", 0, false);
}

void Roar2(string &in Entity)
{
PlaySoundAtEntity("Roar2", "HxH48Piano1.snt", "Roar2", 0, false);
}


void Reset (string &in asParent, string &in asChild, int alState)
{


}

void OnLeave()
{

}



////////////////////////////
// Run when leaving map

not work Sad
(This post was last modified: 04-12-2012, 11:14 PM by skirnks017.)
04-12-2012, 11:13 PM
Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#4
RE: script error! help me!

Did the error message change?

The Nightmares v1.0 - Dreadful Fires WIP
04-12-2012, 11:20 PM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#5
RE: script error! help me!

Unexpected end of file means there is a '}' missing somewhere. Look all the way through your code again, make sure every open bracket ends with a close bracket.

04-12-2012, 11:29 PM
Find
skirnks017 Offline
Junior Member

Posts: 17
Threads: 11
Joined: Mar 2012
Reputation: 0
#6
RE: script error! help me!

(04-12-2012, 11:29 PM)DRedshot Wrote: Unexpected end of file means there is a '}' missing somewhere. Look all the way through your code again, make sure every open bracket ends with a close bracket.
Gracias! Faltaba un corchete("}") en void start Big Grin

void OnStart()

{

AddEntityCollideCallback("Player", "PlayerStartArea_1", "Reset", true, 1);

SetEntityPlayerInteractCallback("lantern_1", "ActivateMonster", true);

AddEntityCollideCallback("Player", "ScriptArea_1", "ApareceMounstruo", true, 0);

AddEntityCollideCallback("Player", "Scary_Area_2", "Scary_2", true, 1);

AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);

SetEntityPlayerInteractCallback("music", "Roar2", true);

SetEntityPlayerInteractCallback("music", "Roar1", true);

AddUseItemCallback("", "llave1", "puerta1", "KeyOnDoor", true); //Puerta1

AddUseItemCallback("", "llave3", "puerta3", "KeyOnDoor3", true); //Puerta3
}
04-12-2012, 11:37 PM
Find




Users browsing this thread: 1 Guest(s)