Kreekakon
Pick a god and pray!
Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation:
124
|
Several Script Questions
Alright, I've got two questions that I'd like to ask, and they're not exactly your "usual" sort of questions.
1. Is it possible to use key-bindings in Amnesia? Like say you wanted a script to run when you pressed "R", is it possible?
2. Is there anyway to put a script in some sort of file, or place where it will be functioning, or checking for when to function in the entire custom story? A bit like how inventory.hps will be keeping check on your inventory the whole game.
|
|
07-23-2012, 07:30 PM |
|
JMFStorm
Member
Posts: 205
Threads: 8
Joined: Aug 2011
Reputation:
28
|
RE: Several Script Questions
I believe these kinds of things can be executed if a full conversion mod is made, but I don't know how :S
(This post was last modified: 07-23-2012, 07:54 PM by JMFStorm.)
|
|
07-23-2012, 07:54 PM |
|
Apjjm
Is easy to say
Posts: 496
Threads: 18
Joined: Apr 2011
Reputation:
52
|
RE: Several Script Questions
(07-23-2012, 07:30 PM)Kreekakon Wrote: 1. Is it possible to use key-bindings in Amnesia? Like say you wanted a script to run when you pressed "R", is it possible? Not really. But there are some hacks you can use. You can sacrifice movement / jumping / crouching / lantern for trapping key presses, as well as interaction in certain situations. I've also heard that in dev-mode the "h" key hurts you, and you could abuse this too.
(07-23-2012, 07:30 PM)Kreekakon Wrote: 2. Is there anyway to put a script in some sort of file, or place where it will be functioning, or checking for when to function in the entire custom story? A bit like how inventory.hps will be keeping check on your inventory the whole game. You could try putting the script in a custom inventory.hps or global.hps file under certain restrictions (I haven't really played about with this, so some experimentation here is a good bet). Failing that, make use of a pre-processor and just stick includes at the start of you script file.
(This post was last modified: 07-23-2012, 10:28 PM by Apjjm.)
|
|
07-23-2012, 10:27 PM |
|
Kreekakon
Pick a god and pray!
Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation:
124
|
RE: Several Script Questions
(07-23-2012, 10:27 PM)Apjjm Wrote: Not really. But there are some hacks you can use. You can sacrifice movement / jumping / crouching / lantern for trapping key presses, as well as interaction in certain situations. I've also heard that in dev-mode the "h" key hurts you, and you could abuse this too. Well, I tried H like you said, and it does hurt you as well as lowering your sanity. But still, how could I abuse this? Aren't the functions of the keys locked inside the engine's source code?
|
|
07-23-2012, 10:32 PM |
|
Apjjm
Is easy to say
Posts: 496
Threads: 18
Joined: Apr 2011
Reputation:
52
|
RE: Several Script Questions
(07-23-2012, 10:32 PM)Kreekakon Wrote: (07-23-2012, 10:27 PM)Apjjm Wrote: Not really. But there are some hacks you can use. You can sacrifice movement / jumping / crouching / lantern for trapping key presses, as well as interaction in certain situations. I've also heard that in dev-mode the "h" key hurts you, and you could abuse this too. Well, I tried H like you said, and it does hurt you as well as lowering your sanity. But still, how could I abuse this? Aren't the functions of the keys locked inside the engine's source code?
Sadly, yes. You could have a timer trigging quickly (every 1/60th of a second) which checks for sanity and health damage of the amount the "H" key deals - you can then just restore the health and sanity and fire whatever event you wanted to fire (It is unlikely that some combination of events deals both health and sanity damage similar to the H key could occur). Hacks like this really depend on what you are trying to achieve though.
(This post was last modified: 07-23-2012, 10:43 PM by Apjjm.)
|
|
07-23-2012, 10:42 PM |
|
Kreekakon
Pick a god and pray!
Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation:
124
|
RE: Several Script Questions
(07-23-2012, 10:42 PM)Apjjm Wrote: Sadly, yes. You could have a timer trigging quickly (every 1/60th of a second) which checks for sanity and health damage of the amount the "H" key deals - you can then just restore the health and sanity and fire whatever event you wanted to fire (It is unlikely that some combination of events deals both health and sanity damage similar to the H key could occur). Hacks like this really depend on what you are trying to achieve though. I don't think that would really work out, as the effects of sanity, and health damage caused by H are very visually noticeable, which would be very weird in almost all cases.
I think I might actually be better off with the back up plan I came up with: which is double-clicking F.
EDIT: This also brings up another question that's been bugging me ever since I started scripting. Is there any more efficient way/function BESIDES super fast timer checks that can constantly be checking for occurrences that can change in the map at any given time?
(This post was last modified: 07-23-2012, 10:50 PM by Kreekakon.)
|
|
07-23-2012, 10:48 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Several Script Questions
(07-23-2012, 10:48 PM)Kreekakon Wrote: EDIT: This also brings up another question that's been bugging me ever since I started scripting. Is there any more efficient way/function BESIDES super fast timer checks that can constantly be checking for occurrences that can change in the map at any given time?
As mentioned, it depends on what you're trying to do. Many things are handled by callbacks anyway, so calling a generic function at the end of these callbacks is one method you can take. If you're trying to manage player attributes, then a timer is useful.
Of course, you can always wait for HPL3 to come out.
(This post was last modified: 07-24-2012, 01:41 AM by Your Computer.)
|
|
07-24-2012, 01:41 AM |
|
|