Adding new functionality to engineers...?

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

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

Adding new functionality to engineers...?

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

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
“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 »

Did you think to something like this:

Image
Image
Image

: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 »

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...
:-)
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 »

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
“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 »

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?
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 »

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:
“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 »

Remove tank trap:

Image
Image
Image

I did that quickly. It will add a loss of AP, ...
“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 »

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
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: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!
“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 »

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?
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: Could you add Construct Tank Trap?
Done:

Image
Image
Image

What's else? :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 »

I wonder if there's an icon we could use to Construct Tank Trap that's different from the icon to destroy 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
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 »

Hedgerow? Any chance of a quick fix to remove the hedgerow between the engineer and the targeted (yellow crosshairs) sector?
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 »

Btw how much AP do each of these actions consume? 8 or 16?
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 can I have this code? Do you mind if we plug it into GJS'44?
:mrgreen:
Last edited by GottaLove88s on Fri Mar 15, 2013 5:20 pm, 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
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: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.
“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: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:
“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 »

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.
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:
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:
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 ”