Page 1 of 1

Determine max build/reach/etc distance?

Posted: Sun Oct 02, 2016 5:16 pm
by aubergine18
Using the Lua API, I can determine the bonuses applied to player distances (reach, build, etc) but don't seem to be able to determine the original distances, either via the player or character entities or their prototypes. Is there some way to ascertain the missing information? (I'm aware I can serpent-encode raw prototype data in to a .order property that's readable during control phase of mod operation, but would rather avoid that).

Re: Determine max build/reach/etc distance?

Posted: Mon Oct 03, 2016 1:58 am
by aubergine18
bump

Re: Determine max build/reach/etc distance?

Posted: Mon Oct 03, 2016 6:13 am
by Rseding91
There is no way to currently do it.

I still haven't thought of a decent way to expose all of the entity prototype properties runtime. There are a plethora of different properties that are of no use to mods and I don't want to just dump them all out slowing down everything else from them existing.

Stuff like render frame count, visual offsets, and sound data.

Re: Determine max build/reach/etc distance?

Posted: Mon Oct 03, 2016 3:48 pm
by aubergine18
Adding all the prototype properties would be unwise - I can't think of any use for knowing frame counts in animations for example. So I agree with the approach being taken currently.

When building certain entities, I want to show a map overlay indicating best placement for those entities, essentially making terrain a factor in the decision making process when building. Here's what I've got so far:

Image

(Aside: Would be great if flying-text accepted custom fonts)

At the moment, I've just hard-coded the build-distance for the player, however that will become cumbersome longer term as my mod also adds different character classes (human, metahuman, cyborg, android), each with their own set of characteristics and abilities. I could just hard-code them all, but ideally want to pull from the 'player' prototype of the selected .character so that additional character classes can be added without needing alterations to the code.