PLEEAASEE HELP? - 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: PLEEAASEE HELP? (/thread-15285.html) Pages:
1
2
|
PLEEAASEE HELP? - AirmanerX - 05-06-2012 Alright, Hello. I love playing custom stories, so I decided to make one. After making a room and a door. I made a key. Now, in my HPS file ther is this script: Is there anything wrog with it? //////////////////////////// // Run first time starting map void OnStart () { } //////////////////////////// // Run when entering map void OnEnter() { AddUseItemCallback("", "IronKey_1", "mansion_1", "KeyOnDoor", true); } void KeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("mansion_1", false, true); PlaySoundAtEntity("", "unlock_door", "mansion_1", 1, false); RemoveItem("IronKey_1"); } /////////////////////////// // Run when leaving map voin OnLeave { } Also, When i put the Door_frame02, its invisible. If i click on it i can see the outline and i can move it. *Note* I also havent gotten to test my map since i cant start it because of the scripting problem Error is like this FATAL ERROR: Could not load script file 'custom_stories/AirmanerX Custom Story/maps/00_firsttryairmaner.hps'! main (27,1) : ERR : Expected '(' Any help is GREATLY appreciated! RE: PLEEAASEE HELP? - Xanthos - 05-06-2012 AddUseItemCallback("", "IronKey_1", "mansion_1", "KeyOnDoor", true) Put that inside the OnStart() =============== Also SetSwingDoorLocked("mansion_1", false, true); PlaySoundAtEntity("", "unlock_door", "mansion_1", 1, false); RemoveItem("IronKey_1"); CHANGE IT TO THIS SetSwingDoorLocked("mansion_1", false, true); PlaySoundAtEntity("", "unlock_door", "mansion_1", 1, false); RemoveItem("IronKey_1"); ===================== Try not to space everything out. (I am not sure if that was a glitch with copying and pasting) Put the script functions into these { SetSwingDoorLocked("mansion_1", false, true); PlaySoundAtEntity("", "unlock_door", "mansion_1", 1, false); RemoveItem("IronKey_1"); } void OnStart() { AddUseItemCallback("", "IronKey_1", "mansion_1", "KeyOnDoor",true); } RE: PLEEAASEE HELP? - Rownbear - 05-06-2012 you should read more up on scripting and maybe watch some videos on the wiki site to understand scripting more. If you just want to use a key on a door you would need a script like this Spoiler below!
if you use this as your new hps and call the key for castle_key_1 and the door for castle_door_1 or change it for what you have, it should work and not crash anymore. Now, go watch some videos RE: PLEEAASEE HELP? - AirmanerX - 05-06-2012 (05-06-2012, 11:57 AM)Rownbear Wrote: you should read more up on scripting and maybe watch some videos on the wiki site to understand scripting more. If you just want to use a key on a door you would need a script like this Thanks The thing is, I changed all Castle Door and Key names into my key and door names (IronKey_1) and mansion_1 Also, in my extra_english.lang file (some guy told me to do that) it says <LANGUAGE> <CATEGORY Name="CustomStoryMain"> <Entry Name="Description">This is my first try at a custom story. I have no experience at at all.[br]Please send me feedback at airmanerx@live.com.[br] http://www.youtube.com/user/AirmanerX</Entry> </CATEGORY> <CATEGORY Name="Inventory"? <Entry Name="ItemName_IronKey_1">Iron Key</Entry> <Entry Name="ItemDesc_IronKey_1">Put it in THAT door. Yes, THAT one.</Entry> </CATEGORY> </LANGUAGE> This is correct, right? Sorry, i dont understand scripting at all. Its like alien science to me. If you have any videos to explain it, id watch them but probbaly not learn anything anyway. RE: PLEEAASEE HELP? - Xanthos - 05-06-2012 Make sure that the subset name in the Level Editor for that key is corresponding with the one in the extra lang RE: PLEEAASEE HELP? - AirmanerX - 05-06-2012 (05-06-2012, 12:20 PM)Xanthos Wrote: Make sure that the subset name in the Level Editor for that key is corresponding with the one in the extra langOk, thanks. Another thing (sorry about all the questions) What do I add to the hps file if i want to make more doors + keys. where do i add it? (05-06-2012, 12:20 PM)Xanthos Wrote: Make sure that the subset name in the Level Editor for that key is corresponding with the one in the extra langAlso, when I put a doorframe02 its invisible. Is there a way to solve it? RE: PLEEAASEE HELP? - Rownbear - 05-06-2012 http://wiki.frictionalgames.com/hpl2/amnesia/script_functions Favorite it in your browser and check out the tutorials there. EDIT: also if you want the key to display what you put in the extra_english you must first click on the key in the leveleditor. go to entity, then in the customsubitemtypename and write in IronKey_1. so when you pick it up it should properly show name/desc. The doorframe thats invisible, you sure its just not faceing the wrong way? try rotating it. RE: PLEEAASEE HELP? - Xanthos - 05-06-2012 (05-06-2012, 12:23 PM)AirmanerX Wrote:You would add another Function in the OnStart.(05-06-2012, 12:20 PM)Xanthos Wrote: Make sure that the subset name in the Level Editor for that key is corresponding with the one in the extra langOk, thanks. Another thing (sorry about all the questions) Like So void OnStart { AddEntityCollideCallback("Player", "Blah", "Blah", false, 1); AddUseItemCallback("", "Key", "Blah", "Blah", true); AddUseItemCallback("", "Key", "Blah", "Blah", true); } Then you add another on of the script functions thingys. Directly under the OnStart Section void blah(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick_floor_18", true, false); } void blah(string &in asItem, string &in asEntity) { SetLevelDoorLocked("Blah", false); PlaySoundAtEntity("", "unlock_door", "Player", 0, false); RemoveItem("Key"); } void blah(string &in asItem, string &in asEntity) { SetSwingDoorLocked("blah", false, true); PlaySoundAtEntity("", "unlock_door", "Player", 0, false); RemoveItem("blah"); } (05-06-2012, 12:23 PM)AirmanerX Wrote:Check the "Active" box under the name of it(05-06-2012, 12:20 PM)Xanthos Wrote: Make sure that the subset name in the Level Editor for that key is corresponding with the one in the extra langAlso, when I put a doorframe02 its invisible. Is there a way to solve it? RE: PLEEAASEE HELP? - AirmanerX - 05-06-2012 (05-06-2012, 12:29 PM)Xanthos Wrote:Sorry, not Door Frame. Door Way.(05-06-2012, 12:23 PM)AirmanerX Wrote:You would add another Function in the OnStart.(05-06-2012, 12:20 PM)Xanthos Wrote: Make sure that the subset name in the Level Editor for that key is corresponding with the one in the extra langOk, thanks. Another thing (sorry about all the questions) RE: PLEEAASEE HELP? - Xanthos - 05-06-2012 (05-06-2012, 12:33 PM)AirmanerX Wrote:Check if you have any map_cache files hiding around in your custom story folder.(05-06-2012, 12:29 PM)Xanthos Wrote:Sorry, not Door Frame. Door Way.(05-06-2012, 12:23 PM)AirmanerX Wrote:You would add another Function in the OnStart.(05-06-2012, 12:20 PM)Xanthos Wrote: Make sure that the subset name in the Level Editor for that key is corresponding with the one in the extra langOk, thanks. Another thing (sorry about all the questions) If so delete and try again with the test. |