Itskody
Member
Posts: 100
Threads: 30
Joined: Mar 2011
Reputation:
1
|
RE: Custom Story isn't working
(03-24-2011, 06:25 PM)jens Wrote: make an empty script file for the second map like this:
Then load the level in amnesia.
add some of the script like this:
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterWalk", true, 1);
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_245", 0, "");
AddUseItemCallback("", "key_study_1", "cuboard_1", "UsedKeyOnCuboard", true);
AddUseItemCallback("", "key_study_2", "mansion_2", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_study_3", "mansion_4", "UsedKeyOnDoor2", true);
}
Reload the script, if it does not crash, then continue and add a bit more code:
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterWalk", true, 1);
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_245", 0, "");
AddUseItemCallback("", "key_study_1", "cuboard_1", "UsedKeyOnCuboard", true);
AddUseItemCallback("", "key_study_2", "mansion_2", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_study_3", "mansion_4", "UsedKeyOnDoor2", true);
}
void UsedKeyOnCuboard(string &in asItem, string &in asEntity)
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterWalk", true, 1);
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_245", 0, "");
AddUseItemCallback("", "key_study_1", "cuboard_1", "UsedKeyOnCuboard", true);
AddUseItemCallback("", "key_study_2", "mansion_2", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_study_3", "mansion_4", "UsedKeyOnDoor2", true);
SetSwingDoorLocked("cuboard_1", false, true);
PlaySoundAtEntity("", "unlock_door", "cuboard_1", 0, false);
RemoveItem("key_study_1");
}
and so on and on until it crashes, that way you can find out what part it is that is the problem and have less code to search for errors.
Thanks for that, uhm when i add
void MonsterWalk(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 15.0f, "");
GiveSanityDamage(10.0f, true);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
AddTimer("servant_grunt_1", 15.0f, "TimerMonster");
SetMessage("Journal, "OhGod", 5.0f);
}
It crashes, it works up until then. any ideas why?
|
|