Random Traps

Post » Tue May 17, 2011 3:58 pm

So, here's what I figured out so far. Originally, I was hoping that I could just plop down mines then have them random either disable themselves (become not armed) or hide/delete themselves entirely. The idea being that I would put up to half a dozen down in a cell, but only 1/3 of them would stay alive after the cell gets loaded for the first time. I considered doing this for a few other entities (tripwires w/ grenade clusters, additional abandoned vehicles, etc).

Well, the first hitch is that a lot of these objects - can't have scripts attached to them. Things like tripwires or grenade clusters don't have any place to hang a script off of so you can do things during "onload".

The second hitch is that a "live" or "armed" mine is a different item from the 1hand mine item. The item under "1hand" mine is what you see when you'll find a few frag mines sitting on a shelf, ready to be picked up. Live mines, OTOH, are projectiles - and projectiles don't have a script attribute.

All is not completely lost though at this point - I was able to place a customized copy of the "1hand" mine type at a location. That item can have a script attached to it. Then, in the "onload" event for that custom copy of the frag mine, I do a GetRandomPercent and if it is 70 or greater, I spawn a "projectile" frag mine at the object's location. Then the placeholder mine calls "disable" and "markfordelete" to remove itself. What you're left with is an active, armed, mine that is ready to go boom when something comes close. The mines, like other traps, don't respawn at cell reset.

But there were a few issues:

- it works great on flat surfaces
- on slanted surfaces, you often can't disarm the mine if crouched as it will be slightly sunk into the ground (gotta be standing to disarm)
- a lot of hand-placed projectile mines have faction/ownership so that they don't go off due to NPCs
- because I'm calling "PlaceAtMe" to create the armed mine, I can't set ownership easily

All that being said... it almost works. The ownership of the spawned mine is an issue. The sinking into the ground could probably be fixed if I always put the placeholder mine 1-3 z-axis units above the terrain. Then the spawned mine can fall into place on the ground. I got around the ownership issue by keeping the new mine locations away from known NPC spawn points or patrol paths.

In terms of game-play... it definitely adds a bit of suspense to entering places like drainage chambers (nearly all of which ended up with at least 1 mine spawn). Instead of knowing exactly where the traps are from previous plays, now there's a 30% chance that there might be a nasty surprise laying somewhere in the clutter. Even when I wasn't cruel and kept the mines placed mostly visible (under a table, on a shelf, along the side of a corridor), it forced me to stop and look rather then rush in and loot the drainage chamber.

Some of the methods I used:

- mix in a live mine spawn with a pile of inactive mines, so 30% of the time you'd best be looking carefully to see if any of them are lit up in the pile

- placed an inactive mine along the side of a corridor

- live mines on shelves, presented to you just like you'd normally see inactive mine loot

- in a storeroom, put inactive mines on the shelves by the door, with a live one farther in

- added mines to the stairwells, bedrooms, and corridors in the Statesman Hotel and Our Lady of Hope

- adding them inside the various campers was interesting

- abandoned boats and the docks along the water, such as putting a mine on top of a pile

- additional mines in places that already had mines

- randomly placed mines besides shelters, garbage cans, phone booths, columns in outdoor locations
User avatar
Laura Shipley
 
Posts: 3564
Joined: Thu Oct 26, 2006 4:47 am

Post » Tue May 17, 2011 8:28 am

If you figure out how to solve the ownership issue be sure and let us know as I looked (although not too in-depth) and couldn't figure it out. Would be nice for one of my mods.
User avatar
Milad Hajipour
 
Posts: 3482
Joined: Tue May 29, 2007 3:01 am

Post » Tue May 17, 2011 12:17 am

Well, still struggling with placed mines not being disarmed easily... but copying the baby carriage trap and turning it into a chance-based appearance works well.

The more complex tripwire/grenades pairing is going to be tricky.

For the mines, I may end up having to create a trap object similar to the buried mine or baby carriage.
User avatar
Lil Miss
 
Posts: 3373
Joined: Thu Nov 23, 2006 12:57 pm

Post » Tue May 17, 2011 5:29 am

One possible technique... "getLinkedRef". This can be seen in the PinkertonDoorUnlockSwitch object in the broken bow. There is a wall switch (activator object) that is tied to a door object leading to the exterior. The activator script is able to call "getLinkedRef" and then manipulate the referred to object. It determines all this when the activator switch is placed into the cell, the "Linked Ref" tab points it at the door object. So you could have an activator that can disable/markfordelete a 2nd object. It doesn't suit my purpose at the moment, because most traps are constructed in the opposite direction and with a different tool.

"getParentRef" is almost what I want...

Well, I can definitely use "getLinkedRef" to have the tripwire disable/markfordelete the linked grenade cluster if it fails to pass the random check.

I'm still debating what to do about mines. Ideally, I'd just place a projectile "MineFragProjectile" and then have it enable/disabled during cell load. I may have to do something like pair a projectile mine object with an activator of some sort (maybe "Clutter\GenElecSwitch01.NIF" hidden away from the player).
User avatar
Ashley Clifft
 
Posts: 3468
Joined: Thu Jul 26, 2007 5:56 am

Post » Tue May 17, 2011 1:07 pm

Grenade bunches work well. I created a special version of the standard grenade cluster trap and a 2nd copy of the script. The special version does the 30% roll of the die during "onload" and will disable/markfordelete on itself and the linkedref trigger. So both the tripwire (or whatever activator) and the grenade cluster vanish 70% of the time. Setting it up is just like any other trap pairing, you just have to add an entry to the "LinkedRef" tab of the trap element as well as setting the parent activator reference.

1. Place tripwire / pressure plate, make it persistent
2. Place the special version of the grenade cluster
3. Point the grenade cluster at the activator as normal (Activate Parents link)
4. Also create a linked reference pointing from the grenades to the activator trigger

So now I can add grenade clusters to the wastes.

Can't link-reference a non-persistent activator object... and I'm not sure if I want to make projectile-object mines persistent.
User avatar
Harinder Ghag
 
Posts: 3405
Joined: Wed Jan 17, 2007 11:26 am

Post » Tue May 17, 2011 3:56 am

GECK hates me tonight... (mutter) I used to be able to put Projectile objects on the palette, but now they simply turn into a palette entry with no associated object.

(The GECK crashes are getting old as well. I'm having flashbacks to my CoD:UO map-making days.)
User avatar
RAww DInsaww
 
Posts: 3439
Joined: Sun Feb 25, 2007 5:47 pm

Post » Tue May 17, 2011 12:19 am

This is not your fault - you cannot put projectiles into the Object Palette. I have no idea why. :shrug:
User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am

Post » Tue May 17, 2011 4:19 pm

Yeah... it's annoying and I'm discovering that you can't have projectiles in the palette. The main reason that I wanted that is that when doing a project like this, I like to make heavy use of the "use info" dialog. But you can't save when that dialog is open (and I prefer to save after every few edits). So I'm having to flip back and forth in the object window a lot. Go find the list of existing frag mines, find a spot that looks tempting, then flip back to Projectiles and drag-n-drop a mine into the render window. Fiddle with it, then place the activator object that controls whether it appears (at least that works with the palette).

What confused me is that my previous attempt at adding mines to the wastes was done with the "item" mine objects. Which can be added to the object palette.

The next thing that I'm pondering is whether I really want to fix the ownership of mine projectiles so that NPCs don't set them off. The poor raiders in Dupont Circle tend to constantly set off the mines in the center as they walk around. This happens because those mines aren't owned by anyone. If you change the ownership - now you get the "red" text when you mouseover the live mine to disarm/pickup. But it doesn't seem to result in karma loss.

(The ownership flag is an issue - because some of the mines/traps that I'm placing are very near faction-based NPCs like raiders or Talon Company.)

I laid down almost 4 dozen new mines tonight. The scripts are working fine, things are vanishing or staying nicely. But I really want to place probably a full 100-200 additional mines (vanilla Fallout 3 has about 340 active frag mines already). So it's going to be long and a bit tedious compared to my original method.

The suspense factor is alive and kicking. Especially when combined with my "Deadlier Explosive Traps" mod, which kicks up the damage that grenades and mines do. Screw up with a grenade cluster tripwire or frag mine in a small space, and it's going to hurt a whole lot. You'll probably never cross another doorway without checking for a tripwire... or come around a pillar without peeking for a mine. And those surviving Reilly's Rangers? They've left a few more presents for you when you attempt to rescue them this time around.
User avatar
Theodore Walling
 
Posts: 3420
Joined: Sat Jun 02, 2007 12:48 pm

Post » Tue May 17, 2011 7:41 am

Blech... so grenade bunches come with a meter long cable on it that sticks out of anything that isn't hidden from the player.

http://www.wuphonsreach.org/Games/Fallout3/RandomExtraTraps/FO3ArefuGrenadeBouquetModelProblemWithCamper1.jpg
http://www.wuphonsreach.org/Games/Fallout3/RandomExtraTraps/FO3ArefuGrenadeBouquetModelProblemWithCamper2.jpg

For indoor locations, that's not a problem, but in cases where I'm putting a trap in the doorway of a camper... it doesn't work. Or rather, everything functions but it doesn't look right. Not sure what I'm going to do in a situation like that - except rely on the fallback choice of a frag mine. Or figure out how to do a single grenade type trap.

(I looked at Blender/NIF tools earlier... I'm going to need a few tutorials.)
User avatar
Monika
 
Posts: 3469
Joined: Wed Jan 10, 2007 7:50 pm

Post » Tue May 17, 2011 5:08 am

Rotate it 90 degrees? (I dunno if you can or not, never messed with those)
User avatar
Amy Siebenhaar
 
Posts: 3426
Joined: Fri Aug 10, 2007 1:51 am

Post » Tue May 17, 2011 2:24 pm

I may do that... it'll look slightly screwy, but passable if I hide the wire in the front half of the camper.

Or I need to figure out Blender and trim it down.

Or I might put a fire extinguisher inside and call DamageObject on it.
User avatar
james reed
 
Posts: 3371
Joined: Tue Sep 18, 2007 12:18 am


Return to Fallout 3