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
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#5
Solved: 8 Years, 2 Months, 2 Weeks ago RE: Custom Story isn't working

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.
(This post was last modified: 03-24-2011, 06:25 PM by jens.)
03-24-2011, 06:25 PM
Website 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)