Booby Trap (BT)

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
Old_Warrior
Major - Jagdpanther
Major - Jagdpanther
Posts: 1019
Joined: Fri Apr 30, 2010 3:13 am

Booby Trap (BT)

Post 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.
pipfromslitherine
Site Admin
Site Admin
Posts: 9929
Joined: Wed Mar 23, 2005 10:35 pm

Re: Booby Trap (BT)

Post 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
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Booby Trap (BT)

Post 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"...
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
buffpilot
Lance Corporal - Panzer IA
Lance Corporal - Panzer IA
Posts: 14
Joined: Tue Aug 28, 2012 11:11 pm

Re: Booby Trap (BT)

Post 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).
Old_Warrior
Major - Jagdpanther
Major - Jagdpanther
Posts: 1019
Joined: Fri Apr 30, 2010 3:13 am

Re: Booby Trap (BT)

Post 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.
Post Reply

Return to “Battle Academy : Modders Corner ”