Script problem - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Script problem (/thread-20991.html) |
Script problem - megsb927 - 03-31-2013 Ok what's wrong here? you go into room 3(this script is for room 3) and castle_2 is locked. Then you go into another map and get the key for it so you can come back and unlock it, but Map 3 won't even load. I need help void OnStart() { AddUseItemCallback("", "Key3", "castle_1", "UsedKeyOnDoor", true); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("castle_1", false, false); PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false); RemoveItem("Key3"); } { AddUseItemCallback("", "Key4", "castle_2", "UsedKeyOnDoor", true); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("castle_2", false, false); PlaySoundAtEntity("", "unlock_door", "castle_2", 0, false); RemoveItem("Key4"); } void OnEnter() { } void OnLeave() { } RE: Script problem - Tiger - 03-31-2013 Have you named the level door that's in the other map right? Make sure that all names match. RE: Script problem - megsb927 - 03-31-2013 (03-31-2013, 05:17 PM)Tigerwub Wrote: Have you named the level door that's in the other map right? Make sure that all names match. It's just a swing door so You go outside of map 3, get the Key4 then come back into map 3 use it to unlock the swing door castle_2 but I don't know what's wrong with the script because it won't even load the map it said unknown character or something RE: Script problem - Tiger - 03-31-2013 Does the game crash when you load the custom story? Can you write down what it says in the error window? RE: Script problem - megsb927 - 03-31-2013 (03-31-2013, 06:02 PM)Tigerwub Wrote: Does the game crash when you load the custom story? Can you write down what it says in the error window? FATAL ERROR: Could not load script file 'custom_stories/Mark's story/csmaps/C:/Program Files (x86)/Amnesia-The Dark Descent/redist/custom_stories/Mark's story/csmaps/map_3.hps'! main(12,1) : ERR : Unexpected token '{' RE: Script problem - Tiger - 03-31-2013 Ah, ofc PHP Code: { Put that in the 'void Onstart' instead. Also, as Robosprog said, this is the wrong subforum. RE: Script problem - megsb927 - 03-31-2013 (03-31-2013, 06:18 PM)Robosprog Wrote: How are people failing to post in the right section?Oh I'm sorry I thought I did. thanks for telling me though |