EmptyEpsilon icon indicating copy to clipboard operation
EmptyEpsilon copied to clipboard

SpaceObject getSize()/setSize() not exposed to lua

Open julopin opened this issue 5 years ago • 3 comments

Hi, Im so far enjoying the game. But unless I missed something the getSize and setSize from spaceObject are not exposed for lua scripting.

I suppose it is normal that not all spaceObjects support resizing but the lack of getSize is a bit troublesome since we can use setSize for a selected few subClass (eg: asteroid, spaceStation). Thus using hardcoded value from the SpaceObject constructor isn't reliable in these case.

The current workAround I am using is: adding getSize/setSize that returns/call the getRadius/setRadius and then using REGISTER_SCRIPT_CLASS_FUNCTION to expose them to lua. So far, the getSize seems to work well and setSize works somewhat on some of them (black hole, nebula and wormHole).

Thus I was wondering if it isn't implemented yet or if this is a design decision.

julopin avatar Apr 28 '19 03:04 julopin

In general, if it's not there, but it makes sense to have it. It's because I haven't encounted that I needed it.

daid avatar Apr 28 '19 17:04 daid

Ah ok, understood.

Basically I am part of a modding group that occasionally contribute to EE events. We had some functionality in mind that weren't compatibles with the current state of the game. I think we will implement our need and if it works I will make a "take it or leave it" pull request.

But for now that answers my question. Thank you.

julopin avatar Apr 30 '19 23:04 julopin

Usually, I have no issue with "add new script API" pull request, if they just expose things that are already there.

daid avatar May 01 '19 05:05 daid