Adding new functionality to engineers...?

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Adding new functionality to engineers...?

Post by GottaLove88s »

Haha, that's fair. I just experiment to understand more. I promise to cease and desist, lol...

I suspect I may have misexplained. For all functions, it must be the engineers first move. And all moves consume 8 AP (so they're not easy mortar targets).

Merci encore Amaris!
:-)
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
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris »

GottaLove88s wrote:Haha, that's fair. I just experiment to understand more. I promise to cease and desist, lol...

I suspect I may have misexplained. For all functions, it must be the engineers first move. And all moves consume 8 AP (so they're not easy mortar targets).

Merci encore Amaris!
:-)
You are right. This is the best way to learn.
But I don't help! No comments on code, weird stuff with ';' :P
“Take care, my friend; watch your six, and do one more roll… just for me.”
pk867
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1602
Joined: Fri May 08, 2009 3:18 pm

Re: Adding new functionality to engineers...?

Post by pk867 »

Hi Amaris,
Wonderful work !
I think you are correct about using a satchel charge was removing walls and tank traps. The thing with bridges you may have to require a truck adjacent to the spot you build the bridge. I do not think the engineers carried all that stuff on their backs! :)
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris »

pk867 wrote:Hi Amaris,
Wonderful work !
I think you are correct about using a satchel charge was removing walls and tank traps. The thing with bridges you may have to require a truck adjacent to the spot you build the bridge. I do not think the engineers carried all that stuff on their backs! :)
Thanks!

For the satchel charge I'm not decided yet. :?:

Blow up a bridge:
Image
Image
Image

Construc a pontoon(*):
Image
Image
Image
Image

(*) just a pontoon, not a bridge. So no need to truck (feint of lazy coder.) :wink:
“Take care, my friend; watch your six, and do one more roll… just for me.”
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris »

Version 5 available! Same address: http://amaris-games.com/ba-amaris/improved-engineer/

New special action:
- Add tank trap.
- Remove tank trap.
- Terraform: forest/tree -> mud -> open grass
- Cutting hedge with wall removal.
- Burn High Corn, Tall Corn and Dune Gras.
- Blow up a bridge.
- Construct a pontoon.

All action consume 8 AP. And these actions must be done before move.

Enjoy! :P

I need to feedbacks to finish this mod. :wink: So don't be shy :!:
Particularly for or against the use of a satchel charge for remove tank trap, cut hedge and blow up a bridge. Thanks. :D
“Take care, my friend; watch your six, and do one more roll… just for me.”
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris »

MINI-FAQ:

How to use it in my own campaign?

First this mod is do with the vanilla version of BA. Particularly for the units.
If you have your own squad.csv you must check if the unit of engineer ( "us_engineer", "afrika_korps_engineer", "british_engineer" and "german_engineer") are still here.
If not you must add them or edit all the scripts.

Then just copy the DATA folder of improved engineer mod in your own campaign's folder.
Open the TEXT1.TXT file of improved engineer and copy the marked part into your own TEXT1.TXT.

Finish!
“Take care, my friend; watch your six, and do one more roll… just for me.”
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Adding new functionality to engineers...?

Post by GottaLove88s »

Great work, mon ami!

I was doing some final testing with your latest version, prior to dropping it into our GJS'44 Normandy Ninjas Tourney...

There's one little glitch that's new.

I notice that when I execute one of the new functions, for example Demolish Wall or Cut Trees, the engineer carrying out the action is made visible to the MP opponent, even when the opponent has no units nearby... This would make that engineer highly vulnerable to mortar fire... and it didn't happen in the previous version...

Could this be a factor of making the engineer vulnerable to response fire? I believe that was added between versions?

Btw you've even added Bridge charges and Pontoons??!! WOW!!
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
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris »

No time to make the correction myself today.
But I think it'll ok if you remove the following line:

Code: Select all

SetForceVisible(me, 1) ;
in all scripts.
“Take care, my friend; watch your six, and do one more roll… just for me.”
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Adding new functionality to engineers...?

Post by GottaLove88s »

Thanks Amaris, That makes sense.

It's great to have enemy able to respond if they can see the engineer. They'll hear the explosion so they're bound to be curious.
But they shouldn't be able to see the attacker, if they have no units nearby.

I'll remove the SetForceVisible(me, 1) lines from the new mods.

Great work, monsieur, et merci encore...
:-)
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
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris »

I has add the SetForceVisible(me, 1); because I think it was necessary for opportunity shoot. But this is not the case I guess. Sometimes I want to do too much. :P

I'll take a little break on this mod. Time to decide whether to use or not satchel charges.
I think of other possible actions, but I think it has everything you need. :?:

MINI-FAQ2:

Very nice mod but I don't want this or that feature in my campaign?

Simple! After making the copy described in the 1st FAQ, localized the $DEFAULT.BSF file in your \DATA\BATTLE\Scripts\ campaign's folder.
Edit it (for PC: use notepad / for Mac/Ipad: [mode troll]There Are (may be) Apps (to bought) For That[/mode troll] :mrgreen:).

The part that interests us as follows:

Code: Select all

// IMPROVED ENGINEER:	
include "TERRAFORM1.BSF"
include "TERRAFORM2.BSF"
include "TANKTRAP.BSF"
include "ADDTRAP.BSF"
include "CUTHEDGEDROW.BSF"
include "BURN.BSF"
include "DESTROY_BRIDGE.BSF"
include "ADDBRIDGE.BSF"
// END OF IMPROVED ENGINEER
To disable a feature, simply delete the corresponding line (or put it on comment by placing // at the beginning of the line.)

For example, if you don't want the construction of pontoon, you must have:

Code: Select all

// IMPROVED ENGINEER:	
include "TERRAFORM1.BSF"
include "TERRAFORM2.BSF"
include "TANKTRAP.BSF"
include "ADDTRAP.BSF"
include "CUTHEDGEDROW.BSF"
include "BURN.BSF"
include "DESTROY_BRIDGE.BSF"
//include "ADDBRIDGE.BSF"
// END OF IMPROVED ENGINEER
or

Code: Select all

// IMPROVED ENGINEER:	
include "TERRAFORM1.BSF"
include "TERRAFORM2.BSF"
include "TANKTRAP.BSF"
include "ADDTRAP.BSF"
include "CUTHEDGEDROW.BSF"
include "BURN.BSF"
include "DESTROY_BRIDGE.BSF"
// END OF IMPROVED ENGINEER
'Et voilà!' :mrgreen:
“Take care, my friend; watch your six, and do one more roll… just for me.”
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris »

Amaris wrote: Time to decide whether to use or not satchel charges.
Answer found!
Version 6 is available at the same address: http://amaris-games.com/ba-amaris/improved-engineer/

But there are two different versions. :mrgreen:

One without using a satchel charge (vanilla) and the other where the demolition action (remove tank trap, blow up a bridge, cut hedgedrow and terraform1) require a satchel charge.
“Take care, my friend; watch your six, and do one more roll… just for me.”
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Adding new functionality to engineers...?

Post by GottaLove88s »

Merci Amaris!

Great idea for 'real engineers' to consume their satchel charges to execute demolition actions... I will update with the next version of the Tourney...

I wonder, perhaps stretching the idea that the satchel charge icon represents materials used, please would you consider:
(i) Add Tank Trap also consumes 1 unit of materials (ie. 1 satchel charge)
(ii) Perform a check to prevent the placement of Tank Traps INSIDE FOREST (see below, lol)
GottaLove88s wrote:Painting by Tank Traps...

As a cocktail of Murphy's Law and the Law of Unintended Consequences, it has come to the attention of Strategic Allied Command that certain Enemy Commanders have begun to "Paint by Tank Traps"... Below our Mosquito recon has caught just such an intrepid German engineer brigade in action... where it has laid no less than TWELVE Tank Traps, in about four hours (turns) of battle... drawing a solid line of tank traps from Carpiquet's Main Gate flag and then three squares into the Forest itself...

Tank Traps are considered an asset of war, and may be employed in any natural circumstances, including blockading one's own roads, if Commanders so wish... However, I will have a chat with Amaris about perhaps preventing their placement within Forest... This would seem to be a pixelated fantasy of a historical inaccuracy...

But, NICE TRY BUSTER... The Canucks are still coming for you, eh!! :mrgreen:

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

Re: Adding new functionality to engineers...?

Post by GottaLove88s »

Please explain how to adapt your code so that larger scale actions consume THREE charges, rather than only one...

I would like to enhance the "Blow Bridge" and "Build Pontoon" actions so that they perform a check that the engineer has at least 3 charges, and then deducts 3 units of material (charges) for the action. Blowing or building a bridge seems to be a major order of magnitude bigger than knocking a hole through a hedgerow wall...

What do you reckon?
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
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris »

Damned players! As terrible as my 'users'. :mrgreen:

Look your mail. :wink:
“Take care, my friend; watch your six, and do one more roll… just for me.”
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris »

GottaLove88s wrote:Please explain how to adapt your code so that larger scale actions consume THREE charges, rather than only one...

I would like to enhance the "Blow Bridge" and "Build Pontoon" actions so that they perform a check that the engineer has at least 3 charges, and then deducts 3 units of material (charges) for the action. Blowing or building a bridge seems to be a major order of magnitude bigger than knocking a hole through a hedgerow wall...

What do you reckon?
It's pretty easy :!:

Find following lines in the .bsf files corresponding to the action you want:

Code: Select all

if (GetAttrib(me, "APCharges") < 1)
and :

Code: Select all

AP--;
And change the lines by:

Code: Select all

if (GetAttrib(me, "APCharges") < X)
and :

Code: Select all

AP = AP - X;
And change X by the desired values (ie 1, 2, 3, ...)
“Take care, my friend; watch your six, and do one more roll… just for me.”
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Adding new functionality to engineers...?

Post by GottaLove88s »

Thanks A!

Does this code already exist (in the 1 charge form) for Add Tank Trap and Build Pontoon Bridge?
Or should I just copy it over from the demolish code, into approximately the same location?
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
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Adding new functionality to engineers...?

Post by GottaLove88s »

Amaris wrote:Damned players! As terrible as my 'users'. :mrgreen:
Haha, oui, c'est vrai! Some of my opponents are phenomenally sneaky, mon ami...
Do you know why it's impossible to make anything for humans foolproof? Because fools are truly ingenious!!
:mrgreen:
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
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Adding new functionality to engineers...?

Post by GottaLove88s »

Amaris wrote:Look your mail. :wink:
Just got it! I understand. Good luck mon ami.
As usual, I love and agree with most of your ideas.
Have an interview tomorrow (so should stop messing with BA for the next 48 hours).
But will write a full reply Tuesday... We can do this...!!
:shock: :) :D :mrgreen:
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
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris »

Allright's.

I'm working now on an another 'improved' project. :P
“Take care, my friend; watch your six, and do one more roll… just for me.”
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Adding new functionality to engineers...?

Post by GottaLove88s »

Hi Amaris,

Please could you show us how to add the check step, to verify that the terrain the engineer is standing in, is NOT forest, before it is permitted to construct a Tank Trap? Knowing you, you've probably already done this somewhere. Sorry if I've missed it...

:?
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
Post Reply

Return to “Battle Academy : Modders Corner ”