Archaegeo / DualUniverseLuaIssues

DualUniverse LUA Issue Tracking
GNU General Public License v3.0
5 stars 0 forks source link

Implement getProductInfo(productType) #29

Closed samdeane closed 2 years ago

samdeane commented 3 years ago

Analogous to getSchematicInfo(schematicId), but returning information about a particular product, indexed by the type that getSchematicInfo supplies for products.

It would return a JSON record containing such useful things as:

EasternGamer commented 3 years ago

I would rather it return a Lua table than a JSON tbh.

samdeane commented 3 years ago

I would rather it return a Lua table than a JSON tbh.

I completely agree, but I think that's a different request -- since I would want it to apply to all APIs that currently return JSON.

The JSON thing feels to me like it's just the devs being a bit lazy and not bothering to do a proper mapping. It's easier to just get your C++ objects to output a string, and pass that across, so that's what they are doing.

It's really not that difficult though to have a dictionary concept on the C++ side and have them output that, then bridge a dictionary across to Lua. Would be way more sensible, and ought to be more efficient if done right.

NQ-Ligo commented 2 years ago

Hi there !

We added the function system.getItem( itemId) to get a Lua table containing the item info on the 0.29 Athena update. It should fit what you wish ;) .

Archaegeo commented 2 years ago

Closed as complete