05-09-2014, 12:11 PM
I worked on my costum story lately. Everything worked well but a few days ago my game kept crashing after about 2 minutes, and I have no idea why. I screenshoted the error message.
Since the last thing I was doing before the game started crashing was adding a monster I'll post my script too. I do not see any problems but maybe someone professional can take a look at it. Maybe I overlooked something important..
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
AddUseItemCallback("", "torture_1", "torture", "KeyOnDoor_2", true);
AddUseItemCallback("", "torture_2", "torture_3", "KeyOnDoor_3", true);
AddUseItemCallback("", "escape", "cellar_1", "KeyOnDoor_4", true);
AddEntityCollideCallback("Player", "scr_enemy1", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "bridgeenemy", "MonsterFunction_2", true, 1);
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_4", 0.001, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_8", 0.003, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_27", 0, "");
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key_1");
}
void KeyOnDoor_2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("torture", false, true);
PlaySoundAtEntity("", "unlock_door", "torture", 0, false);
RemoveItem("torture_1");
}
void KeyOnDoor_3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("torture_3", false, true);
PlaySoundAtEntity("", "unlock_door", "torture_3", 0, false);
RemoveItem("torture_2");
}
void KeyOnDoor_4(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellar_1", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_1", 0, false);
RemoveItem("escape");
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{SetEntityActive("servant_grunt_2", true);
}
void MonsterFunction_2(string &in asParent, string &in asChild, int alState)
{SetEntityActive("brute_1", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
I hope someone can help me.
Greetings.
Since the last thing I was doing before the game started crashing was adding a monster I'll post my script too. I do not see any problems but maybe someone professional can take a look at it. Maybe I overlooked something important..
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
AddUseItemCallback("", "torture_1", "torture", "KeyOnDoor_2", true);
AddUseItemCallback("", "torture_2", "torture_3", "KeyOnDoor_3", true);
AddUseItemCallback("", "escape", "cellar_1", "KeyOnDoor_4", true);
AddEntityCollideCallback("Player", "scr_enemy1", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "bridgeenemy", "MonsterFunction_2", true, 1);
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_4", 0.001, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_8", 0.003, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("brute_1", "PathNodeArea_27", 0, "");
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key_1");
}
void KeyOnDoor_2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("torture", false, true);
PlaySoundAtEntity("", "unlock_door", "torture", 0, false);
RemoveItem("torture_1");
}
void KeyOnDoor_3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("torture_3", false, true);
PlaySoundAtEntity("", "unlock_door", "torture_3", 0, false);
RemoveItem("torture_2");
}
void KeyOnDoor_4(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellar_1", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_1", 0, false);
RemoveItem("escape");
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{SetEntityActive("servant_grunt_2", true);
}
void MonsterFunction_2(string &in asParent, string &in asChild, int alState)
{SetEntityActive("brute_1", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
I hope someone can help me.
Greetings.