Scripts Recollection - 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 Articles (https://www.frictionalgames.com/forum/forum-40.html) +---- Thread: Scripts Recollection (/thread-5117.html) |
RE: Scripts Recollection - Frontcannon - 01-03-2011 The basic structure of a puzzle is having an item the player has to find and an area it is applied on. This could either lead to the solution of the puzzle or changing / improving the puzzle item in some way that leads to the solution. Some examples: Lever puzzles. These involve mostly some special combination to enable the player to advance (unlock a door, cut off steam flow). Unless the combination bases on a mathematical formula or the player has an effective hint, these become very boring after a short time. Can also work with candles and other things. Physics-based puzzles. Most fun and logical for the player. Very difficult to pull off though, as they need custom animation / models / particles etc. One simple way of making these is making something fall down off something. Item-based puzzles. Basically cover the whole rest. The player needs an item which has to be improved in some way sometimes, or he has to combine several items to solve the puzzle. Examples include a key and a locked door, the padlock puzzle in Frictional's prison, gathering ingredients for a special mixture (or spare parts for repairing something) and many more. RE: Scripts Recollection - Equil - 01-03-2011 I see, this is very helpful, thank you. How difficult would the lever puzzles/Item puzzles be to script though? Which functions would I be needing to use? Pardon me if I'm hi-jacking the thread here. RE: Scripts Recollection - DIGI Byte - 01-04-2011 I have a request for some code o/ I haven't had a chance to get to the gritty side of coding, anyone know about this in more detail? Code: SetInsanitySetEnabled(string& asSet, bool abX); Also, how about random number generators? what I'm trying to do in my map, make a random number between 0-100 every 10 seconds if that number is between 0 and 20 generate another random number between 1-10 reduce the sanity by by that random number (0-10) RE: Scripts Recollection - Frontcannon - 01-04-2011 Let me think.. I've never used SetInsanitySetEnabled, so no info on that. It could work like this (you'd obviously have to call InsanityTimer first): Code: void InsanityTimer(string &in asTimer) I haven't tested it out, but that's how it should work. You may want to add a debug message to that, like this: Code: AddDebugMessage("Damage: "+Insanity_2, false); RE: Scripts Recollection - DIGI Byte - 01-04-2011 Cheers, I'll test it out, play around with and and see what I get I'll post a map and code if it works its looking really.. .really good, just need sanity effects EDIT: I've tried simplifying the layout of the script, should make it easier now, but I don't think I'm qualified to code 4am in the morning :S RE: Scripts Recollection - DIGI Byte - 01-05-2011 Ok, I got the script working mostly, but giveSanity isnt working as it should What this script does, Lowers sanity on a random timed event, used for showing sanity props and entities that spawn when then players sanity is low enough Create a random number on start, Creates timer on start when timer goes higher then random number, runs script Code: void OnStart() the script detects player sanity, if higher then 60%, does 10 sanity damage then loops back if its lower then 60%, heals 40% sanity damage then loops back (doesn't work yet) (do NOT place in void OnStart () ) Code: void sanity_drop_loop(string &in asTimer) RE: Scripts Recollection - DIGI Byte - 01-05-2011 Now that I'm more awake, and well rested I can think better, the idea of my previous script is ok, but for what I was using it for, there was a simpler solution and that I could have more control over The problem with sanity activated entities (when your sanity is low enough they spawn) is you have to be facing away from it before it will spawn I wanted it to spawn in front of me This script is activated on start by a simple timer that runs the reset function in the events, which loops back to the start, and starts my timed event Timed Events: activate/fade entities & chaining multiple activate/fade events together and looping them back What this script does in steps; on start, create timer called auto_start_scare to run the void script initial_scare_delay after 5 seconds Code: // This runs when the map first starts This is the Intro to the script, it's where you will setup the initial start (NOT to be included into void OnStart() ) Code: void initial_scare_delay(string &in asTimer) activate (fade in) first object, create random number for timer to run next script, This can be repeated several times making quiet an advanced scene, but simple is better Code: void start_scare(string &in asTimer) this one fades out the entity and loops back to the start Code: void reset_scare(string &in asTimer) RE: Scripts Recollection - Frontcannon - 01-05-2011 So this basically makes objects appear and disappear in 'random' time intervalls? Though I still don't get what initial_scare_delay does. It basically adds a max of 5 seconds before start_scare is called, but reset_scare doesn't use it either so it's basically useless. RE: Scripts Recollection - DIGI Byte - 01-05-2011 this is used for my main menu, where I want the scare/prop to appear quickly before looping at a slower time rate initially i was going to use insanity to make the props appear, however thats quite restrictive on how you use it, so a simple activate/fade is more effective RE: Scripts Recollection - Tony32 - 01-10-2011 Hmm. Can anyone explain/tell me which function is used to trigger something when an item is picked up? ex. When I pickup a bowl, something will happen. (NOT when I use the bowl) Thanks. |