[Suggestion] Get/Set for Struc

Started by GoodMorning, January 07, 2017, 08:59:39 PM

Previous topic - Next topic

GoodMorning

Struc is currently very hard to interact with through PRPL. I propose:

GetStruc # [ X Y Enemy - Type Grown ]
SetStruc # [ X Y Enemy Type Grown - ]

With a possible option on:
SetStrucBulk # [ X Y Enemy Type Grown Radius Square - ]

Type: 0 for none, 1 for normal, 2 for armour.

Note:
I make "Enemy" a parameter to GetStruc in order to handle a case I have seen where there was both red and blue Struc built on the same cell (due to manual editing).
A narrative is a lightly-marked path to another reality.

knucracker

Slipped these in for the beta going out later today.

There are four APIs, and one more argument is required on the set.

SetStruc(int x, int y, bool enemy, int type, bool built)
SetStrucBulk(int x, int y, bool enemy, int type, bool built, int range, bool square)
bool GetStruc(int x, int y, bool enemy)
bool GetStrucBuilt(int x, int y, bool enemy)

The last argument on SetStruc says whether to set the struc to be already built or not.

GoodMorning

Your "Built" seems to be my "Grown". Thank you.
A narrative is a lightly-marked path to another reality.