all on 20/4/2013 at 17:22
I'd like to have a very big key in my fm, too big to justify having it as a standard inventory item. I'd like to have it more like a "junk" object (ex: if the door is not frobbed, the key will be ejected from inventory when frobbed). Is this possible? I've tried simply adding the "junk" property to a key, but this doesn't work. Does anyone know how to achieve this, please?
kdau on 20/4/2013 at 21:05
Hi, all. The behavior you described corresponds to the following Engine Features\FrobInfo settings:
Code:
World Action: Move
Inv Action: Move
Tool Action: Script
The two aspects of the "junk" behavior that this doesn't take care of are: (1) junk is immediately moved to the center of the screen, and (2) inventory cycling is blocked while junk is held. #2 can be simulated with the NVCursedObj script from NVScript, though it has a 100-millisecond lag. #1 may not be possible with a tool item (though I've done it before with a non-tool item).
If you want the key to be destroyed after being successfully used, just set Game\Damage Model\Slay Result to Normal as usual. If you want it to be
dropped after successful use, however, you need to do more; the Move option doesn't work under Tool Action. The simplest way would be to trigger the drop_item command with the CommandControl script from tnhScript, triggered by TrigUnlock on the door in question. (If the key works on more than one door, or something else could unlock that door, you'd need something more complicated.)
Don't forget to increase the key's Mass in its Physics\Attributes property so that it will behave correctly when dropped. If it's big and heavy enough that Garrett should grunt and slow down while carrying it, you also need to add the Lugged script to the key. (Note that Lugged doesn't work with destroying the key on use, as Garrett would stay slowed down for the rest of the mission.)
all on 24/4/2013 at 16:10
Thanks! That's all very useful. But, I still have a problem regarding the "Inv action: move" setting: when I click, the key isn't dropped from the inventory if I'm facing a wall, floor or ceiling, or if I'm standing too close to a wall. Is there a way around this?
Nameless Voice on 24/4/2013 at 17:19
You shouldn't really be able to throw things into walls. That's what the "drop item" key is for.
all on 24/4/2013 at 19:57
Quote Posted by Nameless Voice
You shouldn't really be able to throw things into walls. That's what the "drop item" key is for.
Yes. The problem is that the drop item key does not work when I'm anywhere near a wall, nor does the "inventory:move" frob setting...
kdau on 24/4/2013 at 20:32
Quote Posted by all
Yes. The problem is that the drop item key does not work when I'm anywhere near a wall, nor does the "inventory:move" frob setting...
Strange. I don't get that behavior with the test setup I put together for this. Do you hear Garrett's "can't-put-this-down-here" grunt when you try to drop the key? Are there any objects in frobbing range that the engine might be mistakenly trying to use the key on? It might also help to see the physics properties on your key object.
Yandros on 25/4/2013 at 03:02
Have you resized the starting point by any chance? Because that increases the distance of the drop key and thus might make it impossible to drop when close to and facing a wall.
Weasel on 25/4/2013 at 03:19
I wonder if NewDark changed anything that might make dropping a little buggy? I was testing a mission recently and had trouble dropping a bucket when close to a wall, while a crate could be dropped from the same position.
Just now, my girlfriend was playing Transitions in Chaos pt 1: Conspiracies in the Dark by Ramirez' old fat Burrick Based on the novel Push by Sapphire, and she was having trouble dropping the lute.
kdau on 12/7/2013 at 01:25
all, if you're still working on something like this, I've written a script that should help. Introduced in (
http://www.ttlg.com/forums/showthread.php?t=141906) KDScript 0.3.0, the KDJunkTool script does a little better than the setup discussed above. (I wanted to experiment with the inventory script commands, so this seemed like a good opportunity. :)) See the documentation file for details, and please let me know if you have any questions.
Edit: to clarify, this won't improve the situation with dropping/throwing near a wall; that's an engine-level issue. But it does everything else more smoothly.