Some Coding Questions - 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: Some Coding Questions (/thread-22075.html) |
Some Coding Questions - Alex Ros - 07-09-2013 As long as I am not a coder I have to ask a few questions. I do understand theoretically what is coding and I can read and understand functions and what do they do exactly. But I can't script anything new by myself. So... 1. There's an option to turn off all sanity visual effects. I mean the main menu Options. Is it possible to script FC in such a way so all sanity effects are always turned off? And is it possible to make such a custom main menu where those sanity checkers would be hidden so the player could not even see them? 2. Is it possible to turn off inventory? I mean completely, no inventory at all, no button for opening it. 3. Is it possible to turn off mementos and notes sections, but leave only diary alone? RE: Some Coding Questions - Streetboat - 07-09-2013 1) SetSanityDrainDisabled(bool abX); 2) SetInventoryDisabled(bool abX); 3) No, if you disable inventory you disable notes, mementos, and diary as well. If you're making a Full Conversion, I'm sure you can rig up some clever in-game way of simulating a diary, though. RE: Some Coding Questions - Adrianis - 07-10-2013 (07-09-2013, 05:37 PM)Streetboat Wrote: 1) SetSanityDrainDisabled(bool abX); That only disables the drain on your sanity 'points', you still get the visual effects. Alex, if you're using an FC there are settings in the game.cfg (iirc) that control the visual parts, as far as I know there is no way to do it in the script, but from the config you should be able to set it up so there are no visual effects from standing in darkness - however I'm pretty sure there is no way to get rid of the visual effect from looking at enemies (does that get disabled too when turning it off in Options?). Although you can customise the main menu, I don't think you can change the contents of the Options screen specifically RE: Some Coding Questions - DnALANGE - 07-10-2013 3. Is it possible to turn off mementos and notes sections, but leave only diary alone? ---You can try all these things below--- This IS excually possible, I need to check it. 1 thing i know is JUST, when you are in the inventory, you see the notebook on the right corner. replace that in the INVENTORY with BLACKNESS, So : open up inventory in your mod "must be FC " go look for the book, open it with for example paint.net and make the book totally black! <- OVERWRITE ORIGINAL!!! then you wont see the book in inventory. ---------------------------------- Then next thing. 2 - how to remove the part where you toutch it with the mouse : go to : MENU.cfg and open it look for these : JournalCenter = "720 472 1"<Like make the JournalCenter like -5000 { maybe you will not see it anymore} JournalLabelCenter = "720 472 1" JournalFrameSize = "100 -1" JournalFrameHPadding = "0 0" PLAY WITH THESE, try get it out of the screen! JournalFrameVPadding = "10 10"<Like make the frameoffset like -5000 { maybe will nog seen anymore} JournalFrameOffset = "-5 0 0" --------- Then for the last question.. you might remove the M , and N from the base_english.cfg try it never done it, might crash teh game but worth a try!!! ALSO REMOVE THESE LINES TO BE 100% SURE: <Entry Name="Journal">Guide</Entry> <Entry Name="JournalDesc">Contains notes and valuable information. Click to open.</Entry> --- AND THIS --- <CATEGORY Name="Journal"> <Entry Name="Notes">LETTERS</Entry> <Entry Name="Diaries">LOG</Entry> <Entry Name="Quest Log">TASKS</Entry> <Entry Name="Back">Back</Entry> <Entry Name="MainBack">BACK</Entry> <Entry Name="NotesEmpty">No letters are available!</Entry> <Entry Name="DiariesEmpty">No logs are available!</Entry> <Entry Name="QuestsEmpty">No tasks are available!</Entry> </CATEGORY> AND this maybe : <Entry Name="M">M</Entry> <Entry Name="N">N</Entry> ---------------------- Just try, Don't even know WHY you want to change it, but there are some solutions but they are difficult!!! _*_*_* MODDING = TRYING & DO STUFF WRONG, ---> MAKE BACKUPS!!! RE: Some Coding Questions - The chaser - 07-10-2013 One thing I do for some occasions is putting a un-pickable note and putting a Sign Area. It's ok for some areas, just to say things like: "Beware! The modder hasn't added a ground yet." RE: Some Coding Questions - Alex Ros - 07-10-2013 Thank you very much Streetboat, Adrianis, DnAlange and dear mr. Chaser for support, understanding and help. And it did help a lot, really. When I'll got maps themselves ready I will ask a bit more questions, a bit more presize questions with screenshots. Anyway, all I can peek in other stories and original game I do peek, so I ask only when I am really stuck. I am not a lazy one shithole, do not worry about that, I won't be nasty )))))) New question. Is it possible to script areas so when a player just looks at them the voiced over monologue would be pronounced aloud? I mean free-roaming and free-looking. For example, if a player by himself will look at the window (just for example) and at the moment he will point his eyes at the window a voiced-over monologue would be triggered? Is that possible at all? Without touching anything, just by looking at some particular area. I presume it's not possible. I suppose it's not possible with just a player looking at something. I suppose player should enter the area and that would trigger voice-script, no other way... or I am wrong and looking at the area is also could trigger scripted voice-over? RE: Some Coding Questions - Kreekakon - 07-15-2013 You're actually in luck! Code: void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt); Quote:Calls a function when the player looks at a certain entity.Many people have already used this to produce certain neat effects on their own mods. RE: Some Coding Questions - Adrianis - 07-15-2013 (07-15-2013, 02:17 PM)Alex Ros Wrote: New question. Yeh it's totally possible. http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#entities 5th on the list for Entity related functions is SetEntityPlayerLookAtCallback, you can use a script area in place of the entity name. Then in the function that the LookAtCallback calls, you can use PlayMusic or whichever function suits for the sound files you have Here's some sample code Code: void OnStart() I'm only using the PlayMusic function because it's the simplest, you'll only need the sound file in .ogg to use it. Check out the details for the parameters to give to PlayMusic so that it suits you're needs. With the LookAtCallback, once you've implemeneted that test it to make sure it doesn't trigger through a wall, I've had issues with that before. You could potentially make the window into an Entity just for the purposes of using that function in case you have problems with the script area. EDIT: ninja'd! scum! oh well. In addition to all that Alex, you may find it useful to take the time to read through the whole list of functions on the engine script page. You don't need to understand them all, or even know how to use them instantly, but it's really helpful just from the name & descriptions to know what is technically possible given the options there. Many people underestimate how important it is just to have a basic overview of everything first, before you get into specifics RE: Some Coding Questions - Alex Ros - 07-15-2013 That's cool... no inventory is possible, no sanity loss ann no visual effects of sanity loss while in the dark areas is also possible. And finally triggering voiced-over monologues while a player just looking at the particular objects. That's just really cool! Thank you Kreekakon and Adrianis!!! P.S. I hope custom models and textures would be nice help-in-back when I would finish my tiny mod... or discontinue it. |