Page 1 of 1

Booby Trap (BT)

Posted: Mon Aug 06, 2012 9:30 pm
by Old_Warrior
Ok - walking through what I think could be a booby trap script. Not using any of the script itself - just the logical progression:

Tile 21 42 on a certain map contains a building. We want to place a Booby Trap (BT) script in the BSF file so that the BT is triggered if a PLAYER unit enters the location there is a percentage that the Booby Trap is sprung.

Has Player unit moved into 21 42? -> If Yes - continue; if No - exit
Is BoobyTrapCounter set to 1? -> If Yes, exit script; If No - continue
Continue: Is unit Infantry or Artillery? If Yes - continue; if No - do nothing
Continue: 30 percent chance for Booby Trap to be sprung
Question: Was Trap Sprung? -> If Yes - set BoobyTrapCounter to 1 and attack unit with HE (value TBD), show banner "Booby Trap!," and exit; if No - leave BoobyTrapCounter at 0 and exit.

Now my only concern is that the program will be constantly running this script so perhaps there is a better way to logically think this one out. I also do not know how to have the script run an attack using an HE value at 1 hex. That would be its own part of the routine.

Sorry I didn't flow chart this one out. Hope you guys could follow it. The idea is that it would only harm infantry or artillery and that once used the script would not run again.

Re: Booby Trap (BT)

Posted: Tue Aug 07, 2012 2:52 pm
by pipfromslitherine
That's pretty much how it would need to happen, yes. On the other hand, the next update includes the ability to have objects react to movement in the same way as units. This is set up in the objects.txt file meaning you can then plant the objects as needed.

Cheers

Pip

Re: Booby Trap (BT)

Posted: Tue Aug 07, 2012 4:30 pm
by GottaLove88s
Interesting OW... Would love to see your final scripts... This flowchart would work for setting landmines too, wouldn't it? Although you'd switch the INF or ART condition to "is this a vehicle"...

Re: Booby Trap (BT)

Posted: Tue Sep 11, 2012 3:05 am
by buffpilot
Would this be similar to a minefield? You can have Anti-armor or anti-personnel mines. Think the old Squad Leader game system and all the variants there. BA is similar in scale and in design philosophy (vs a AH 'Tobruk' view).

Re: Booby Trap (BT)

Posted: Tue Sep 11, 2012 4:17 am
by Old_Warrior
Yes, very similar to AP/AT mines. The difference being that you can tie it to an object whereas minefields are tied to tiles and would need a slightly different script.