Anyway to have active mines respawn?

Post » Tue May 17, 2011 7:53 am

I've been experimenting with UseWeapon and FireWeapon but no luck...

I want to have essentially mines in a minefield respawn if they've gone off, after X number of days, and I also want them to be "friendly" to the player (so you can't set them off).
User avatar
Kirsty Wood
 
Posts: 3461
Joined: Tue Aug 15, 2006 10:41 am

Post » Tue May 17, 2011 1:59 am

Once a mine has gone off, it is gone as an object and replaced with the explosion/debris. Thus there is nothing left to respawn, the mines are removed (not disabled).

I would have the exploding mine load a new (disabled) mine in its place, and have the script on the new mine "enable" itself after a set period of time (thus allowing you to respawn each mine exactly X days after the original went off). You should be able to insert a small script in the Destruction Data for the mine that would load the replacement. Then a small script to simple enable the new mine and your good to go.

Its all very possible with scripting but there is no "easy" button for this as far as I know.

Luck,

Miax
User avatar
D IV
 
Posts: 3406
Joined: Fri Nov 24, 2006 1:32 am

Post » Tue May 17, 2011 12:35 pm

Hmm, thanks for the response, quite a clever idea; but would it be possible to add them as not hostile to the player?

Fake Edit: Actually for some reason I forgot about AddToFaction, gonna see if that works.
User avatar
Jade Barnes-Mackey
 
Posts: 3418
Joined: Thu Jul 13, 2006 7:29 am

Post » Tue May 17, 2011 12:05 pm

Hmm, thanks for the response, quite a clever idea; but would it be possible to add them as not hostile to the player?

Fake Edit: Actually for some reason I forgot about AddToFaction, gonna see if that works.


Yeah you can load any object you want, just have it load a non-enabled mine (the kind you can pick-up as loot).
User avatar
Matt Fletcher
 
Posts: 3355
Joined: Mon Sep 24, 2007 3:48 am

Post » Tue May 17, 2011 2:33 pm

Yeah you can load any object you want, just have it load a non-enabled mine (the kind you can pick-up as loot).

Another option is to place activators for the minefield, and the activators place the mines. It's very easy to use OnReset on an activator to do something at a cell reset (and thereby avoid codeblocks running on lots of objects), and here that could be placing a mine if one isn't already placed. This way only destroyed mines need get replaced as well (you use 'set ref to placeatme mine' to allocate a reference that can be checked, disabled, enabled etc from the actvator.).

If you want to get a bit trickier, the entire minefield can be placed from a single activator -- you just use randomised X and Y placement values when placing the mines, and store a reference for each mine on the activator's script which you can play with (again to check, enable, disable, markfordelete etc)
User avatar
Darrell Fawcett
 
Posts: 3336
Joined: Tue May 22, 2007 12:16 am


Return to Fallout 3