Box Throwing Fun!

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Box Throwing Fun!

Post by Cybernetic pig »

How feasible would it be to increase the throwing distance and speed of Microfibral Muscle Aug further? At max level I'd like it to give the player the ability to throw boxes across the room and do minor damage to NPCs a la Invisible War and Human Revolution.
Is this doable considering the old physics engine, would it choke?
G-Flex
Silhouette
Posts: 621
Joined: Mon Jul 11, 2011 10:16 pm

Re: Box Throwing Fun!

Post by G-Flex »

Increasing the speed of thrown objects is really easy. In fact, my mod either already does it or will in the next version (either way, I've implemented it).

Having them do damage to NPCs is a little harder. That's probably in the ScriptedPawn Bump() function, but I'm not sure. Doesn't Shifter do something like this?
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Box Throwing Fun!

Post by DDL »

Three problems:

One: what if they don't want to throw something, but drop it instead? "I'd like to pick up this large crate and put it down over here rather than give myself a hernia trying to fling it away", or "I'd like to be able to pick up and then drop this small crate without having to remember to turn off uber-arms so I don't accidentally hurl it across the room"

Two: how do you indicate that the thrown item should now cause damage? If a pawn is hit in the face with a speeding crate, nothing happens. If they're hit down on the head with one, they take damage (the game assumes "items falling should hurt", but does not apply this to "velocity as a whole")

Three: you're still stuck with DX's crappy physics and collision cylinders, so you'll be hurling a crate that flies through the air while remaining nicely vertical, bounces off someone's face while remaining nicely vertical, and then crashes to the floor, again remaining nicely vertical.

Aside from those caveats, it's actually feasible (I've done it), it's simply not very elegant, nor very pretty.
G-Flex
Silhouette
Posts: 621
Joined: Mon Jul 11, 2011 10:16 pm

Re: Box Throwing Fun!

Post by G-Flex »

DDL wrote:One: what if they don't want to throw something, but drop it instead? "I'd like to pick up this large crate and put it down over here rather than give myself a hernia trying to fling it away", or "I'd like to be able to pick up and then drop this small crate without having to remember to turn off uber-arms so I don't accidentally hurl it across the room"
This is a problem in Deus Ex in general, unfortunately. However, you can always just look down toward the ground first, and if you're placing it on top of another decoration, the game at least attempts to try that before attempting a throw.
Two: how do you indicate that the thrown item should now cause damage? If a pawn is hit in the face with a speeding crate, nothing happens. If they're hit down on the head with one, they take damage (the game assumes "items falling should hurt", but does not apply this to "velocity as a whole")
I feel like you're answering your own question here. You'd just put the relevant code into Bump() instead of SupportActor(), and have it work off of total velocity instead.
Three: you're still stuck with DX's crappy physics and collision cylinders, so you'll be hurling a crate that flies through the air while remaining nicely vertical, bounces off someone's face while remaining nicely vertical, and then crashes to the floor, again remaining nicely vertical.
I've done it, to the extent that having maximum muscle aug allows you to throw small crates relatively far, and it's not that ugly. At least, it's not significantly more ugly than Deus Ex's physics are to begin with.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Box Throwing Fun!

Post by Cybernetic pig »

Thanks guys.
DDL wrote: One: what if they don't want to throw something, but drop it instead? "I'd like to pick up this large crate and put it down over here rather than give myself a hernia trying to fling it away", or "I'd like to be able to pick up and then drop this small crate without having to remember to turn off uber-arms so I don't accidentally hurl it across the room"
What about simply deactivating the aug whilst a box is in your hands? Would that still throw it across the room without additional code, it would right?

Could have left mouse click=Drop, Right click=Throw. And have aug deactivate call on the drop code also.
G-Flex
Silhouette
Posts: 621
Joined: Mon Jul 11, 2011 10:16 pm

Re: Box Throwing Fun!

Post by G-Flex »

Cybernetic pig wrote:Could have left mouse click=Drop, Right click=Throw. And have aug deactivate call on the drop code also.
Of course, this means you couldn't drop a weapon, although I'm not sure that's relevant.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Box Throwing Fun!

Post by Cybernetic pig »

G-Flex wrote:
Cybernetic pig wrote:Could have left mouse click=Drop, Right click=Throw. And have aug deactivate call on the drop code also.
Of course, this means you couldn't drop a weapon, although I'm not sure that's relevant.
It does? I meant the left click drop code only applies to when a box is in your hands. Contextual. Or just mouse 3 could be drop, same as drop weapon. Would make more sense.
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Box Throwing Fun!

Post by DDL »

Yeah, I added a 'throw' binding, so "fire button, while holding shit" = throw, and "use button, while holding shit" = drop, and that seems to work fine.

I seem to remember I had enormous trouble getting the game to handle bump() correctly, though that could be because I was either even crapper at coding back when I was trying, or because I'm not modifying deusex.u, but hey.

Edit: ah, I've just looked it up. My main problem was getting the game to successfully differentiate between dropping and throwing once the objects were in motion. In terms of "damage done" via bump(), accidentally hitting someone with a crate you were just dropping, vs deliberately flinging a beer bottle into someone's face or something...ended up about equivalent, since it's a function of mass and velocity.

Whereas I'd like the game to be able to tell the difference in intent between "whups, was that your foot" and "DIE WITH A FACE FULL O' GLASS, COCKBAG"
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Box Throwing Fun!

Post by Cybernetic pig »

EDIT: Never mind, got it.
Last edited by Cybernetic pig on Sat May 04, 2013 11:25 pm, edited 2 times in total.
G-Flex
Silhouette
Posts: 621
Joined: Mon Jul 11, 2011 10:16 pm

Re: Box Throwing Fun!

Post by G-Flex »

Huh?
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Box Throwing Fun!

Post by Cybernetic pig »

Just saved, reloaded ued & then it played nice. Rusty ol' software :D
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Box Throwing Fun!

Post by Cybernetic pig »

More:

1. I have a room that is initially completely dark but the player can turn on the lights, once the lights are on all actors do not get light cast on them including JC. How do you make triggerlights emitted light dynamic?

2. How do you trigger a SFX source (non-looping) to play only once? I trigger it and it just loops regardless.

3. Is there any way to take any actor property value and modify it with triggers & events. Or even toggle True/False using T's & E's. I'm talking almost ANYTHING you find in the properties of an actor, texture, whatever.

Example: Player turns on light, specific texture becomes "unlit". "Unlit" found in texture properties was set to true in-game via Triggers.

EDIT: Hmm, Flag Trigger might be it, but restricted to boolean only.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Box Throwing Fun!

Post by Cybernetic pig »

Ok got that problem again: Got a bunch of stuff I want to delete but they refuse to delete and duplicate if you try and even drag them!
G-Flex
Silhouette
Posts: 621
Joined: Mon Jul 11, 2011 10:16 pm

Re: Box Throwing Fun!

Post by G-Flex »

Cybernetic pig wrote:2. How do you trigger a SFX source (non-looping) to play only once? I trigger it and it just loops regardless.
What kind of "SFX source"? I know that SpecialEvents can be set to play a sound, so that should work.
3. Is there any way to take any actor property value and modify it with triggers & events. Or even toggle True/False using T's & E's. I'm talking almost ANYTHING you find in the properties of an actor, texture, whatever.

Not really, since the triggering actor's code would need to be aware of all properties it could possibly modify in all classes it could possibly modify.
Example: Player turns on light, specific texture becomes "unlit". "Unlit" found in texture properties was set to true in-game via Triggers.

EDIT: Hmm, Flag Trigger might be it, but restricted to boolean only.
Flag triggers have nothing to do with that; those are for player flags only, as in the ones seen in the 'legend' menu.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Box Throwing Fun!

Post by Cybernetic pig »

Here you go. It's not finished yet but almost there: https://www.youtube.com/watch?v=wKzFBRCDGbY
Post Reply