Adding new functionality to engineers...?

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

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 » Sat Mar 16, 2013 1:31 pm

Remove wall: done!

The difficulty was to find the right wall. And remove only those under the hedge:
Image
Image
Image

This will remove all wall types (except the corners.)
The wall must be positioned under the hedge. But the script tolerate a slight variation for the position. :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 » Sat Mar 16, 2013 2:04 pm

Terraform two steps:

Image
Image
Image
Image
Image
Image
Image
Image

And all of the mod is available: http://amaris-games.com/ba-amaris/improved-engineer/

Enjoy!
“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 » Sat Mar 16, 2013 2:13 pm

Start of test: » 15 Mar 2013 12:10
Release of 1st version: » 16 Mar 2013 15:04

:mrgreen:
“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 » Sat Mar 16, 2013 2:20 pm

UBERWOW!! Less than 24 hours to create several seriously cool new engineer functions.
Merci monsieur, Vous etes vraiment vachement incroyable!!

I will upload and add into the GJS'44 tourney immediately.
The guys are going to adore you (and your code) for this...
:mrgreen: :mrgreen: :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 » Sat Mar 16, 2013 3:45 pm

Err... Is it possible that you added the multiple engineer types only for the Add Tank Trap option... The other functions seem to be disabled (and I'm getting errors trying to modify for British engineers, sorry :oops: )

Also I'm getting a list of *** WARNINGS *** in a brown window to the bottom right, when I run my cursor over places where a British Engineer could carry out actions, but could this be because of the problem above?

PS. Please can I keep the dynamite icon for the "Demolish Wall" option?
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 » Sat Mar 16, 2013 5:56 pm

I forgot to change the other actions that it works with all engineers. :oops:

Fixed! New version, same place: http://amaris-games.com/ba-amaris/improved-engineer/

Warning there may be bugs ;-) And I have not tested this in MP :!:
“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 » Sat Mar 16, 2013 6:26 pm

Thanks Amaris...

Have downloaded but still having problems. For some reason, it's very happy to place Tank Traps, but can't see trees or hedgerow... Screenshot attached

Example 1. Brit Engineer at 25,53 can't see HEDGROW2 right in front of it?

PS. Could this be because HEDGROW2 can be in the same square as the engineer or in the square in front of the engineer? Does the mod test for both places?

Image
Last edited by GottaLove88s on Sat Mar 16, 2013 6:38 pm, edited 2 times in total.
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 » Sat Mar 16, 2013 6:28 pm

SOLVED!! Don't worry about the error box in the screenshot above. Have deleted US Engineer and Afrika Korps Engineer from your new mods (they were removed from my squads.csv)
Last edited by GottaLove88s on Sun Mar 17, 2013 7:35 am, edited 1 time in total.
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 » Sat Mar 16, 2013 6:44 pm

For simplicity, I've attached our MP folder for the GJS'44 Tourney here -> http://dl.dropbox.com/u/31228617/BA/GJS ... OURNEY.zip

The scenario I'm trying to work your improved engineers into is our Carpiquet map. As you'll see, the Allies need a little help to break into the airfield...
There are lots of desert stone walls around the outside. I'm replacing all of the wall corners with straight walls (in Carp2.BAM) to work better with your wonderful new mods. :D
Last edited by GottaLove88s on Sun Mar 17, 2013 8:07 am, edited 1 time in total.
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 » Sat Mar 16, 2013 6:45 pm

PS. The 1st two turns are taken up by a dual-side deploy mod (developed by Merr).
It's the only way I've seen that both players in an MP game can deploy their forces around preset zones of the battle map.
Which might also be rather handy for large Pacific ocean maps? ;-)
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 » Sun Mar 17, 2013 7:06 am

Have been experimenting more with this...

Can place and remove tank traps all day (yay, NICE!).
Can remove trees/forest and clear march (yay again, NICEx2!!).

The mod doesn't like hedgerow...

Let me show you what I mean...

The British Engineer on the left (27,53) has full moves but has no option to blow up the hedge in front of it?
Image

However, the British Engineer on the right (28,53) also has full moves but does have an option to blow up the hedge in front of it?
Image

I've walked both engineers all the way around this T-shape hedgerow, and the piece of hedge between them is the only one that either of them can remove... Any ideas?
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 » Sun Mar 17, 2013 7:33 am

I think this may be a problem of "direction facing"... Experimenting more, I'm realising that sometimes the option to demolish the hedgerow doesn't come show, when I'm facing the hedgerow... BUT if I try facing in different directions, the option will eventually show... Sometimes when I face the same direction when it didn't show before... Am not sure why?

Is it possible to simplify the code so that it will destroy the hedgerow between the engineer and the target cursor, without checking the facing direction?

Maybe to make it even simpler, prevent diagonal cases. So it would only work, in a horizontal or vertical direction, on a hedgerow immediately between the engineer and the yellow target cursor.

I think the Add Tank Trap code may not be checking for AP=12 before permitting it to execute?
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 » Sun Mar 17, 2013 8:04 am

Illustrating the Direction Facing problem for Hedgerow Demolition...

Here, the German engineer (green bordered unit facing top left) can "see" the hedgerow diagonally behind and to the right (but not the hedgerow/wall combi immediately next to him; in his own square)
Image

So he destroys it, which would be an challenging feat for real, vaulting his own hedgerow/wall, blowing up the outer hedge, and then jumping back inside again (they dripfeed these guys good German bier, lol! ;-))
Image

Similarly, a Brit engineer can "see" the hedgerow on the far wall of the square behind him (but again, intriguingly, he cannot see any of the hedgerow/wall combi immediately next to him)
Image

...which he too can destroy
Image

So the Hedgerow code works nicely with two bugs that I can't figure out...
(i) why can't it "see" the hedgerow/wall combi around the airfield?
(ii) how to limit the action so that it only works between the selected unit and the yellow target cursor


Hmmm?
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 » Sun Mar 17, 2013 8:04 am

Engineers from both sides, in MP, can carry out all actions... NICE... with the bug cautions above...
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 » Sun Mar 17, 2013 8:06 am

PS. Mod lets engineers demolish tank traps that are behind them?
(ie. not in the same square)

Is that intentional?

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

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 » Sun Mar 17, 2013 8:07 am

GottaLove88s wrote:I think this may be a problem of "direction facing"... Experimenting more, I'm realising that sometimes the option to demolish the hedgerow doesn't come show, when I'm facing the hedgerow... BUT if I try facing in different directions, the option will eventually show... Sometimes when I face the same direction when it didn't show before... Am not sure why?
As already mentionned, the GetUnitFacing() return the unit facing angle but returned values ​​are not always the same for the same unit's orientation (0 or 16 for example) :shock: without knowing why.
“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 » Sun Mar 17, 2013 8:09 am

Uh oh... Ahhhh, that makes sense... Would it be easier to avoid GetUnitFacing altogether?

Could we demolish any hedgerow between the selected engineer and the yellow target cursor, irrespective of which way the unit is facing?

:?
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 » Sun Mar 17, 2013 8:14 am

Btw... Bon dimanche... Thanks for this wonderful mod... The Terraform and Tank Traps are great.
It's going to be awesome if we can finish the Hedgerow part... I have all faith in you, Amaris!! 8)
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 » Sun Mar 17, 2013 8:16 am

GottaLove88s wrote: ...

So the Hedgerow code works nicely with two bugs that I can't figure out...
(i) why can't it "see" the hedgerow/wall combi around the airfield?
(ii) how to limit the action so that it only works between the selected unit and the yellow target cursor


Hmmm?
Hmm I see.
Looking quickly my code of cutting hedge and found the problem:
First I need to improve the 'face detection' (see abose about GetUnitFacing.)
The problem with hedge that will border tile X,Y is NOT NECESSARY on tile X,Y but on tile X-1,Y, or X,Y-1, ....
So or I undestand how work the GetUnitFacing() or I'll use an another way to detect the good hedge.

Then you know the song: fixed on the next release. :P
“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 » Sun Mar 17, 2013 8:20 am

GottaLove88s wrote:Uh oh... Ahhhh, that makes sense... Would it be easier to avoid GetUnitFacing altogether?

Could we demolish any hedgerow between the selected engineer and the yellow target cursor, irrespective of which way the unit is facing?

:?
This is my plan. ;-)
As I worked on grids (much much more complex than square grids :mrgreen: ) it should be possible to do that without GetUnitFacing().
“Take care, my friend; watch your six, and do one more roll… just for me.”

Post Reply

Return to “Battle Academy : Modders Corner ”