Jump to content

NPC reaction to PlaceAtMe explosions


HugePinball

Recommended Posts

I'm working on some features where the player may plant explosives, either on a timer or otherwise triggered. When detonated, I use PlaceAtMe in script to place an explosion at the appropriate spot.

 

What I'm looking for is a good way to make NPCs react properly if they are injured by such an explosion, that is in most cases they should turn hostile and either attack the player or run away, just as if you tossed a grenade near them.

 

I've experimented with a couple methods, but nothing has been satisfactory. I'm hoping some new perspectives might come up with some better ideas. For now, assume that the NPCs in question witnessed the player planting the explosives. Any ideas?

Link to comment
Share on other sites

heres a thought, do you know the way in some areas in FO3 have Trip Wires, make your own way of making them, or the Gernade Pack that Drops in Pinkertons place when you go to him the first time round if you dont disarm it and get caught in the Firebomb like it did the first time round....

 

Trip wires might work for you, but thats my way of maybe doing it

Link to comment
Share on other sites

Thanks for the responses guys!

 

Sounds like you're trying to recreate a land mine the hard way. Anything wrong with just making a custom land mine?
Wouldn't a custom grenade be better? Timing script is already attached.

If I could script and interact with the projectile object, that might work, but I don't think that can be done. I want to control the timer dynamically, as well as make it detonate under other circumstances (for example, a remote trigger). And if I wanted to place or position them in a certain spot, I'd at least need a reference to the spawned projectile. Even if I could do that, the player would not be "attacking" with this in most cases, and I wouldn't want to use the attack animations (and then the original "owership" issue comes up again). Also, when I was experimenting with Timed Mines, I had tried setting the proximity to 0 and changing the timer, and it didn't seem to work, although I'm not sure why as those are the same settings a grenade has.

 

 

Or a custom exploding mailbox? There are a number of things you could probably clone to get the job done properly.
Trip wires might work for you, but thats my way of maybe doing it

Traps don't address the problem I'm looking to solve, that is assigning "ownership" of the explosion to the player, so any injured NPCs react accordingly (unless there's some other method available with an Activator that I'm not aware of).

 

 

Perhaps you've already though of this, but attaching a script effect that does what you want on the explosion might work.

Yes, this is what I've been experimenting with, but getting the details right is where I'm running into trouble. Actually, I haven't been putting the script effect on the damaging explosion itself, because I wanted to avoid modifying them (I'm using various existing explosions). I've been placing a separate "invisible" explosion at the same time, but even with the same settings as the "real" explosion, it doesn't seem to "hit" the actors in the same way. For instance, it doesn't seem to hit any actors unless I set "Ignore LOS", and I don't quite understand how the Area attribute on the object effect applies for explosions either. Any thoughts on this, or different methods?

Link to comment
Share on other sites

I'm thinking you want to be able to apply this to all explosions without changing them, right?

I think I've got new ideas. They're mainly based on the player's actions.

 

You could create a detection event on the player (or the explosive) which is triggered by GetLastPlayerAction on throw grenade or lay mines or triggered by GetIsUsedItem. Hopefully, that will bait the AI to act in the manner you want without attaching object effects.

 

On the area attribute issue, I'm not entirely sure whether area effects spread on after hitting an NPC, but if you attach an object effect on an explosion, every NPC or creature that got hit by the explosion will get the object effect. Unless, that NPC is standing behind a crate, small wall, or anything that blocks the explosion.

Link to comment
Share on other sites

I'm interested in this as well. I've been trying to make a natural gas grenade launcher, and I've had mixed results. Have you tried forcefully assigning ownership onto things? I tried this with the gas traps with mixed results.

 

Basically, I have the initial projectile explosion spawn an activator. The activator runs a script that forcefully assigns ownership to the player. It's very unreliable, but I've actually been awarded xp for certain kills (like every fifth or so, don't know what controls it). This was tested on megaton civilians. The instances where I actually laid a trap when they were still friendly did not make them turn hostile against me, however.

 

Question. When you rearm a trap (say a bear trap) and a person dies from it, do you get xp?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...