Page 4 of 8
Re: Adding new functionality to engineers...?
Posted: Sat Mar 16, 2013 1:31 pm
by Amaris
Remove wall: done!
The difficulty was to find the right wall. And remove only those under the hedge:
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.

Re: Adding new functionality to engineers...?
Posted: Sat Mar 16, 2013 2:04 pm
by Amaris
Re: Adding new functionality to engineers...?
Posted: Sat Mar 16, 2013 2:13 pm
by Amaris
Start of test: » 15 Mar 2013 12:10
Release of 1st version: » 16 Mar 2013 15:04

Re: Adding new functionality to engineers...?
Posted: Sat Mar 16, 2013 2:20 pm
by GottaLove88s
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...

Re: Adding new functionality to engineers...?
Posted: Sat Mar 16, 2013 3:45 pm
by GottaLove88s
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

)
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?
Re: Adding new functionality to engineers...?
Posted: Sat Mar 16, 2013 5:56 pm
by Amaris
I forgot to change the other actions that it works with all engineers.
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

Re: Adding new functionality to engineers...?
Posted: Sat Mar 16, 2013 6:26 pm
by GottaLove88s
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?

Re: Adding new functionality to engineers...?
Posted: Sat Mar 16, 2013 6:28 pm
by GottaLove88s
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)
Re: Adding new functionality to engineers...?
Posted: Sat Mar 16, 2013 6:44 pm
by GottaLove88s
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.

Re: Adding new functionality to engineers...?
Posted: Sat Mar 16, 2013 6:45 pm
by GottaLove88s
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?

Re: Adding new functionality to engineers...?
Posted: Sun Mar 17, 2013 7:06 am
by GottaLove88s
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?
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?
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?
Re: Adding new functionality to engineers...?
Posted: Sun Mar 17, 2013 7:33 am
by GottaLove88s
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?
Re: Adding new functionality to engineers...?
Posted: Sun Mar 17, 2013 8:04 am
by GottaLove88s
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)
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!

)
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)
...which he too can destroy
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?
Re: Adding new functionality to engineers...?
Posted: Sun Mar 17, 2013 8:04 am
by GottaLove88s
Engineers from both sides, in MP, can carry out all actions... NICE... with the bug cautions above...
Re: Adding new functionality to engineers...?
Posted: Sun Mar 17, 2013 8:06 am
by GottaLove88s
PS. Mod lets engineers demolish tank traps that are behind them?
(ie. not in the same square)
Is that intentional?

Re: Adding new functionality to engineers...?
Posted: Sun Mar 17, 2013 8:07 am
by Amaris
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)

without knowing why.
Re: Adding new functionality to engineers...?
Posted: Sun Mar 17, 2013 8:09 am
by GottaLove88s
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?

Re: Adding new functionality to engineers...?
Posted: Sun Mar 17, 2013 8:14 am
by GottaLove88s
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!!

Re: Adding new functionality to engineers...?
Posted: Sun Mar 17, 2013 8:16 am
by Amaris
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.

Re: Adding new functionality to engineers...?
Posted: Sun Mar 17, 2013 8:20 am
by Amaris
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

) it should be possible to do that without GetUnitFacing().