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
Custom Story isn't working
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#6
Solved: 8 Years, 2 Months, 2 Weeks ago 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:

void OnStart()
{
}

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?
03-24-2011, 08:53 PM
Find


Messages In This Thread
Custom Story isn't working - by Itskody - 03-24-2011, 12:38 AM
RE: Custom Story isn't working - by Itskody - 03-24-2011, 04:55 PM
RE: Custom Story isn't working - by jens - 03-24-2011, 05:22 PM
RE: Custom Story isn't working - by Itskody - 03-24-2011, 05:55 PM
RE: Custom Story isn't working - by jens - 03-24-2011, 06:25 PM
RE: Custom Story isn't working - by Itskody - 03-24-2011, 08:53 PM
RE: Custom Story isn't working - by jens - 03-24-2011, 09:45 PM
RE: Custom Story isn't working - by Itskody - 03-24-2011, 10:18 PM



Users browsing this thread: 1 Guest(s)