Author Topic: Causing an NPC to fall  (Read 12574 times)

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Causing an NPC to fall
« on: January 19, 2007, 01:32:22 am »
Don't ask why I need this.  I just do.

I'm trying to find a way to get a recently-spawned NPC hero to fall to his death (well, his unconsciousness).  I can spawn him and set his HP to zero, trivially.  It's getting him to fall down that doesn't seem to be working.  So far I've tried...

1) Spawn point high up in the air: agent actually spawns on top of a solid object at the same (x,y) as spawn point, not at spawn position itself.  Meaning, on the ground.
2) Put invisible barrier under agent; animate barrier away (downward).  Result, agent remains standing in same place.  Apparently if he started in contact with the mesh, he doesn't recalculate whether it's still there later, or something.
3) Instead of animating platform, disable it. Same result as above.
4) Slant platform to, like, eighty degrees, then spawn onto it, hoping for the slide-down-cliff effect.  Curiously, nothing; troop runs down sheer slope to its bottom edge, runs in place at the edge.

Anybody have any other ideas or suggestions to pull this off?  There will be a reward if you can - added content will make it into the v0.1 Schattenlander release...

- Hellequin

svaucher

  • Guest
Re: Causing an NPC to fall
« Reply #1 on: January 19, 2007, 02:04:08 am »
I really don't know, so I'll just throw a wild suggestion... could you give him an invisible mount and then kill him? When he falls from his "horse", his position might be recalculated.
« Last Edit: January 19, 2007, 11:31:22 am by svaucher »

Highlander

  • Guest
Re: Causing an NPC to fall
« Reply #2 on: January 19, 2007, 07:35:58 am »
when Thor releases a BRFEdit version that supports skeleton saving, you can edit one animation to a lying animation and use agent_set_animation constantly not to let him stand up.
That definatelly works, but the agent isn't 'dead', he is just lying around without doing anything

Offline Fisheye

  • Blues Brother
  • Moderator
  • *****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: Causing an NPC to fall
« Reply #3 on: January 19, 2007, 08:11:44 am »
Make him in the enemy party, then...

Spawn on an invisible ledge, he'll try to walk towards you and thus fall off?

Spawn on an invisible ledge, script him to move off the edge?

Spawn on an invisible ledge, have one-way AI barriers preventing him from moving backwards until he falls off?


Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Causing an NPC to fall
« Reply #4 on: January 19, 2007, 08:43:49 am »
Make him in the enemy party, then...

Spawn on an invisible ledge, he'll try to walk towards you and thus fall off?

Spawn on an invisible ledge, script him to move off the edge?

Spawn on an invisible ledge, have one-way AI barriers preventing him from moving backwards until he falls off?

He can't move off the edge. Remember the trouble you had with M&B putting automatic (crashing) barriers on the edges of your rafters in Storymod? Edges have magic collisions to keep agents from falling off.

You'd basically be hoping for a collisions failure. Not exactly reliable.

Luciferously,
Winter

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: Causing an NPC to fall
« Reply #5 on: January 19, 2007, 10:50:43 am »
As far as I can tell, spawn_agent always puts it on your team.  But yes, scripting him to move toward you is something I still want to try.

Also giving him no edge, but an 85-degree ramp that goes all the way to the ground, that's on my list to try too, with and without scripting him to run down it.

The invisible mount is actually quite a good idea; thanks.

The other thought in my toolbox is to hide a third team, one unit strong, inside an AI-barrier box just inside the building he's spawning next to (and on the second floor), with a 10foot reach invisible mega-greatsword and Str30/PwrStrk10.  Hopefully the knockdown will be reliable at that kind of magnitude, and that might do it.  (And even if he then slides, already unconscious, down the aforementioned 85-degree ramp, that would be okay too.)  I can set the mission template to not care that you haven't killed the invisible/hidden guy, it's just a variant on the arena basically.

Highlander - yes, but in this case I'm looking for the "fall" part as part of it.  If I can't get him precipitously to the ground from a great height, then I may as well rescript the scene and get him shot or something.  (Put in obvious line of sight of enemy with crossbow & only one bolt & ridiculous skills; set HP to zero; watch him die.)

Thanks, guys... that gives me a few more things to try.  I'll report back with what I get, if I'm able to make this work.

Incidentally, if anyone were willing to contribute an invisible troop, invisible weapon mesh, and invisible horse, that would help; I'm not confident enough in my own modelling ability to do the imports etc. correctly, but I'm sure it's a pretty trivial task to one who is comfortable with that process.  I'll get there eventually, no doubt; but I'm not there yet.

- Hellequin

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Causing an NPC to fall
« Reply #6 on: January 19, 2007, 12:45:02 pm »

Incidentally, if anyone were willing to contribute an invisible troop, invisible weapon mesh, and invisible horse, that would help; I'm not confident enough in my own modelling ability to do the imports etc. correctly, but I'm sure it's a pretty trivial task to one who is comfortable with that process.  I'll get there eventually, no doubt; but I'm not there yet.

- Hellequin

You don't need any of that. There is a mesh called "nothing" in one of the Craftmod BRFs. Use that, and make a troop type in module_skins with "nothing" as the head, body and leg meshes. Then give him a weapon with "nothing" as its mesh, and a horse with "nothing" as its mesh.

Problem solved.

Glassily,
Winter

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: Causing an NPC to fall
« Reply #7 on: January 19, 2007, 01:05:23 pm »
Danke.

Making the troop disappear was something I hadn't yet figured out how to do, not having poked around in module_skins at all yet.  That's clear and straightforward; thanks.

Yoshiboy

  • Guest
Re: Causing an NPC to fall
« Reply #8 on: January 20, 2007, 04:36:12 am »
Why don't you just use the animate scene prop trigger to rotate the collision mesh around, forcing him to drop.

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: Causing an NPC to fall
« Reply #9 on: January 20, 2007, 09:57:46 am »
Because it wouldn't work, any more than animating it away from under him did.  A moving scene prop has no collision mesh (or, perhaps, its collision mesh does not interact) during the animation.

Highlander

  • Guest
Re: Causing an NPC to fall
« Reply #10 on: January 20, 2007, 09:59:42 am »
A moving scene prop has no collision mesh (or, perhaps, its collision mesh does not interact) during the animation.
Oh, it does.

Yoshiboy

  • Guest
Re: Causing an NPC to fall
« Reply #11 on: January 20, 2007, 10:02:32 am »

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: Causing an NPC to fall
« Reply #12 on: January 20, 2007, 10:20:37 am »
Highlander's asserted that before, but I still have yet to see any evidence of it (despite his trying to be helpful by PM, it's not Highlander's fault).

Every singe test I've done, the moving object "shuts down" its collision mesh during the animation and "turns it back on" afterward.  Every single one.  See #2 up above... agent is standing on barrier in midair, barrier moves, agent does not.

If anyone can reconcile these two experiences I'll be very grateful.

Thorgrim

  • Guest
Re: Causing an NPC to fall
« Reply #13 on: January 20, 2007, 10:30:51 am »
Ok, simple test that worked every time for me:

Use an flat scene prop (like a door turned on its side) and place it near the ground.  Add a trigger to move it up over a short period of time when you press the inventory key or something.  Jump onto the scene prop then press i.  The scene prop will move upwards and so will you.  To make things more interesting, make the scene prop move sideways very fast, and it will usually fling you off it (though this is a bit less reliable).

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: Causing an NPC to fall
« Reply #14 on: January 20, 2007, 11:19:41 am »
HAHAHAHAHAHA...

Okay, I still haven't figured out the dynamics here fully, maybe it has to do with the spawned agent, but that was one of the funniest things I've seen in a while.

Put a visible prop under the guy in midair, so I could see what it was doing.  Dropping it downward 5m in 0.01s - nothing happens to him at all, he continues to run in midair.  Subsequently, to see if it would pick him up when moving the other way, I animated it upward 10m in 0.25s.

It's a bird! It's a plane! It's a high pop fly into left field!  My NPC flies easily 30 meters up in the air from the impact...

... and lands, unharmed, on a roof nearby.  He had zero hit points before he ever took his trip through the skies above Leipzig.  The dynamics of this interaction are very, very strange.

Still working on this...