Page 1 of 8

Adding new functionality to engineers...?

Posted: Mon Mar 11, 2013 4:26 pm
by GottaLove88s
Hey guys,

I was thinking about combining some of Enric's great work on adding functions to engineers, with Amaris' awesome Naval Academy mod that's beginning to simulate naval/marine Pacific warfare.

Is it possible to enable engineers to terraform? ie. Can I set up a function that permits an engineer to turn Guadalcanal jungle into mud? (one turn). And then turn mud into mud with a track (one more turn).

So it would take one engineer two turns to turn one-square of impenetrable Pacific jungle into a muddy track that vehicles could use...

Re: Adding new functionality to engineers...?

Posted: Mon Mar 11, 2013 5:34 pm
by Amaris
Seen in autodoc:

//returns the ID of a given pairing of set/tile. -1 means the tile doesn't exist. These are the internal folder/tile names, not the displayed localised names. NOTE: this will not be a constant as game data and custom data changes, so don't rely on it.
GetTileID(set, name)

//place a tile in its layer, replacing anything else there. Rotation is [0,3]
PlaceTile(x, y, id, rotation)

//return the id of the tile on the tile at the layer. Returns -1 if nothing there.
GetTileOnTile(layer, x, y)

So... Why not? :P

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 11:10 am
by Amaris
Did you think to something like this:

Image
Image
Image

:P

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 11:33 am
by GottaLove88s
Exactly like that!

Although perhaps being more specific on the action, for example "cut trees" (to turn jungle or forest into mud), and "lay road" (to place a track in the mud).
A brown icon with a wiggly track through it would be awesome...
:-)

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 11:41 am
by Amaris
This was an extremely quick test to evaluate the feasibility of thing. :P

To cut down trees (object) it must also be possible.

Against by road construction may be more complex. Because of the orientation of the road, turns, and road crossing. Not impossible (see my plugin) but not simple.

We can even imagine engineers creating fortifications, like sandbag, open bunker or why not bunker! But also tank trap (or remove it.)

Not need more coder for BA2? :oops: :P

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 12:08 pm
by GottaLove88s
Amaris wrote:Against by road construction may be more complex. Because of the orientation of the road, turns, and road crossing.
Hmmm... Yes, you're right. A challenge with roads might be orienting them with their neighbours... Easy. Don't... Maybe terraform from jungle/forest to mud, then mud to dust instead? Just tell the BA engine to call our road terrain type "rough tracks" instead of "dust". No more requirement for orientation... Jungle/forest and mud don't permit vehicles, but dust already does (and it's colour is similar to tracks)... One day Slith may come up with an internal AI smart enough to orient overlays and objects for us, in-game... Until then, I guess we have to avoid making hassles for ourselves... 8)
Amaris wrote:We can even imagine engineers creating fortifications, like sandbag, open bunker or why not bunker! But also tank trap (or remove it.)
The Sea Bees could set up open fortifications and sand bags for lunch... So sure, totally they should be able to place/remove tank traps... That's a great idea!! :mrgreen:

If you implement this, I'd like to steal it (sorry, borrow it :wink: ) for our GJS'44 campaign please?

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 4:01 pm
by Amaris
Terraform forest with trees:

Image
Image
Image

It can work with all types of terrain.
Note that only the trees were removed (oil drums remained.)
Don't note the ugly warning :oops: I don't know where it's coming because it works :roll:

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 4:18 pm
by Amaris
Remove tank trap:

Image
Image
Image

I did that quickly. It will add a loss of AP, ...

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 4:28 pm
by GottaLove88s
Wow, very cool. I like both functions... Cut forest and remove tank trap!
The dynamite icon makes sense too, because you're destroying stuff.

Thinking about our Carpiquet map, could you add remove hedgerow in front of me?
That would solve a dilemma that the Allies have right now...

Final request... Could you add Construct Tank Trap?
:D

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 4:36 pm
by Amaris
GottaLove88s wrote:Wow, very cool. I like both functions... Cut forest and remove tank trap!
The dynamite icon makes sense too, because you're destroying stuff.
I use a basic icon. Doing a icon is suffering for me. Time to draw an icon, I can write 1k line of code. :P

I'll try to add also bridge construction. (I'm mad :mrgreen: )
GottaLove88s wrote:Thinking about our Carpiquet map, could you add remove hedgerow in front of me?
That would solve a dilemma that the Allies have right now...
I'll try but I think it's difficult to deal with hedgerow.
GottaLove88s wrote:Final request... Could you add Construct Tank Trap?
:D
Underway of course!

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 4:42 pm
by GottaLove88s
Yes, I can see that hedgerow is awkward because it's edging... So it could be assigned to the same square as the engineer, or to the opposite square... Hmmm... How to deal with that?

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 5:10 pm
by Amaris
GottaLove88s wrote: Could you add Construct Tank Trap?
Done:

Image
Image
Image

What's else? :mrgreen:

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 5:16 pm
by GottaLove88s
I wonder if there's an icon we could use to Construct Tank Trap that's different from the icon to destroy it?

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 5:17 pm
by GottaLove88s
Hedgerow? Any chance of a quick fix to remove the hedgerow between the engineer and the targeted (yellow crosshairs) sector?

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 5:18 pm
by GottaLove88s
Btw how much AP do each of these actions consume? 8 or 16?

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 5:19 pm
by GottaLove88s
Please can I have this code? Do you mind if we plug it into GJS'44?
:mrgreen:

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 5:20 pm
by Amaris
GottaLove88s wrote:I wonder if there's an icon we could use to Construct Tank Trap that's different from the icon to destroy it?
No way! :mrgreen:
Ok when I'll finish the scripts.
GottaLove88s wrote:Hedgerow? Any chance of a quick fix to remove the hedgerow between the engineer and the targeted (yellow crosshairs) sector?
Worked on. :wink:
For now I'll try to to remove the hedge in front of the unit.

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 5:23 pm
by Amaris
GottaLove88s wrote:Btw how much AP do each of these actions consume? 8 or 16?
For now all AP are consumed. But we can do what we want, 4, 8, 16, ...
GottaLove88s wrote:Please can I have this code? Do you mind if we plug it into GJS'44?
:mrgreen:
Sure! Let me just finish. :mrgreen:

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 5:23 pm
by GottaLove88s
YAY!! You make awesome icons... I'm sure you can knock up a Tank Trap icon in your sleep! (remember, I've seen your aircraft icons from NAM! ;-))
Removing hedge immediately in front of the unit would toootally solve my problem... :mrgreen:
Amaris wrote:
GottaLove88s wrote:I wonder if there's an icon we could use to Construct Tank Trap that's different from the icon to destroy it?
No way! :mrgreen:
Ok when I'll finish the scripts.
GottaLove88s wrote:Hedgerow? Any chance of a quick fix to remove the hedgerow between the engineer and the targeted (yellow crosshairs) sector?
Worked on. :wink:
For now I'll try to to remove the hedge in front of the unit.

Re: Adding new functionality to engineers...?

Posted: Fri Mar 15, 2013 5:26 pm
by GottaLove88s
Amaris wrote:
GottaLove88s wrote:Btw how much AP do each of these actions consume? 8 or 16?
For now all AP are consumed. But we can do what we want, 4, 8, 16, ...
16 please.

It's a big task so the unit performing the action should be healthy/unsuppressed to achieve it.
And it won't have time left to do anything like fight afterwards...

Engineers working on engineering tasks will need to be well covered by other troops!
:twisted: