![]() |
[SCRIPT] Machine puzzle and other things - 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] Machine puzzle and other things (/thread-19060.html) |
Machine puzzle and other things - CorinthianMerchant - 11-02-2012 How do I...
RE: Machine puzzle and other things - CorinthianMerchant - 11-03-2012 Bump! RE: Machine puzzle and other things - FlawlessHappiness - 11-03-2012 Changing to another map would be: ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound); Immediatly loads another map. asMapName - the file to load asStartPos - the name of the StartPos on the next map asStartSound - the sound that is played when the change starts asEndSound - the sound that is played when the new map is loaded You would have to play with variables to solve the other stuff RE: Machine puzzle and other things - The chaser - 11-03-2012 For 3: void OnStart(); { AddEntityCollideCallback("Entity_1", "Script_1", "Blah", true, 1); AddEntityCollideCallback("Entity_2", "Script_2", "Blah_1", true, 1); } void Blah (string &in asParent, string &in asChild, int alState) { AddLocalVarInt("Gangnam", 1); func_check(); } void Blah_1 (string &in asParent, string &in asChild, int alState) { AddLocalVarInt("Gangnam", 1); func_check(); } void func_check(); { if (GetLocalVarInt("Gangnam") == 2) { SetEntityConnectionStateChangeCallback("Levar_elevator", "Map"); } } void Map (string &in asEntity, int alState) { if (alState == 1) { ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound); } } RE: Machine puzzle and other things - CorinthianMerchant - 11-03-2012 (11-03-2012, 02:26 PM)beecake Wrote: Changing to another map would be:It doesn't work, I've tried SetEntityPlayerInteractCallback and SetEntityCallbackFunc. RE: Machine puzzle and other things - FlawlessHappiness - 11-03-2012 I don't know if it's possible to call a function by examining RE: Machine puzzle and other things - The chaser - 11-04-2012 Does my script work? RE: Machine puzzle and other things - CorinthianMerchant - 11-04-2012 (11-04-2012, 12:17 AM)The chaser Wrote: Does my script work?No, it crashes. I get the following error in the hpl.log: ------- SCRIPT OUTPUT BEGIN -------------------------- main (2, 1) : ERR : Unexpected token '{' main (20, 1) : ERR : Unexpected token '{' ------- SCRIPT OUTPUT END ---------------------------- FATAL ERROR: Could not load script file 'TheManMachine/maps/14_MechanicalLaboratory.hps'! main (2, 1) : ERR : Unexpected token '{' main (20, 1) : ERR : Unexpected token '{' RE: Machine puzzle and other things - The chaser - 11-04-2012 Silly me ![]() void OnStart() { AddEntityCollideCallback("Entity_1", "Script_1", "Blah", true, 1); AddEntityCollideCallback("Entity_2", "Script_2", "Blah_1", true, 1); } void Blah (string &in asParent, string &in asChild, int alState) { AddLocalVarInt("Gangnam", 1); func_check(); } void Blah_1 (string &in asParent, string &in asChild, int alState) { AddLocalVarInt("Gangnam", 1); func_check(); } void func_check(); { if (GetLocalVarInt("Gangnam") == 2) { SetEntityConnectionStateChangeCallback("Levar_elevator", "Map"); } } void Map (string &in asEntity, int alState) { if (alState == 1) { ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound); } } This is the correct script ![]() RE: Machine puzzle and other things - CorinthianMerchant - 11-04-2012 I still get: ------- SCRIPT OUTPUT BEGIN -------------------------- main (20, 1) : ERR : Unexpected token '{' ------- SCRIPT OUTPUT END ---------------------------- FATAL ERROR: Could not load script file 'TheManMachine/maps/14_MechanicalLaboratory.hps'! main (20, 1) : ERR : Unexpected token '{' |