[SCRIPT] String? - 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] String? (/thread-13168.html) |
String? - Saren - 02-08-2012 It was mentioned to me I need to make variables to strings... or something, in my .hps file.. how does that work exactly, I have tried to find something about it without luck..... can anyone clarify? The .hps file looks like this: // Run when entering map void OnEnter() { AddUseItemCallback("", "Masterbedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("masterbedroomdoor", false, true); PlaySoundAtEntity("", "unlock_door", "masterbedroomdoor", 0, false); RemoveItem("Masterbedroomkey"); } //////////////////////////// // Run when leaving map void OnLeave() { } As you can see, no errors, but apparently still wrong since my key won't open the door it suppose to RE: String? - flamez3 - 02-08-2012 Do any other scripts work? RE: String? - Saren - 02-08-2012 My first xD But my lang file works, there's description, name of the key, and all that RE: String? - Your Computer - 02-08-2012 Is masterbedroomdoor a swing door or a level door? RE: String? - Saren - 02-08-2012 (02-08-2012, 09:32 AM)Your Computer Wrote: Is masterbedroomdoor a swing door or a level door?Just a normal castle door RE: String? - Your Computer - 02-08-2012 (02-08-2012, 09:34 AM)Saren Wrote: Just a normal castle door Believe it or not, that is still vague. Swing doors can be swung open, level doors cannot. If the door is a swing door, then either the key name or door name or both are wrong, or the .hps file doesn't have the same name as the .map file. If it is not a swing door, then you're using the wrong function to unlock the door. Or it's a .map_cache conflict, or something random. RE: String? - Saren - 02-08-2012 (02-08-2012, 09:39 AM)Your Computer Wrote:1. It's the second door, castle_Arched(02-08-2012, 09:34 AM)Saren Wrote: Just a normal castle door 2. both have the exact names in both the .lang and .hps 3. Same name 4. Map cache has already been destroyed RE: String? - flamez3 - 02-08-2012 Do it in void OnStart instead of void OnEnter RE: String? - Saren - 02-08-2012 (02-08-2012, 10:11 AM)flamez3 Wrote: Do it in void OnStart instead of void OnEnterAlright, gonna try that Edit: Damn... no luck =( Double Edit: wait, it worked, there was a spelling mistake on the door... that's why... lol, thanks for the help though guys =) |