Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API to access item stats (both with and without talents) #54

Open
matpratta opened this issue Nov 5, 2022 · 1 comment
Open

API to access item stats (both with and without talents) #54

matpratta opened this issue Nov 5, 2022 · 1 comment

Comments

@matpratta
Copy link

So the idea here would be adding two new functions: construct.getElementStats(id) and system.getItemStats(id).

They would work in a very similar way to each other, except the construct.getElementStats function would receive a local element id and return the element's stats with any handling talents applied, while system.getItemStats would receive the actual item id and return the base stats for that item.

Those stats would be the same as we can see when we right-click and select "Inspect" on some element:
image

Basically, this would match a Lua table like this:

{
  maxThrust = 2160000,
  warmupTime = 8,
  worksInAtmosphere = true,
  worksInSpace = false,
  fuelConsumption = 3981,
  antimatterResistance = 0.4,
  electromagneticResistance = 0.4,
  kinecticResistance = 0.3,
  thermicResistance = 0.3,
  volume: 3355.4,
  mass: 17000,
}

Those values are the base ones (system.getItemStats) but when calling them via construct.getElementStats we should get them corrected with any handling talents (piloting talents could help too, but would probably mean more complexity, so I'm not sure on that one).

This would allow for the creation of in-game item catalogs and even ship design tools, without the need of hardcoding every single element or having to manually input talent values either.

@NQ-Ligo
Copy link

NQ-Ligo commented Jan 19, 2023

At this time, we do not allow players to access talents-related data via Lua.

However, we could consider having an item status property, perhaps as another table field returned by the getItem function or something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants