AstronIsTaken
-
Posts
4 -
Joined
-
Last visited
Posts posted by AstronIsTaken
-
-
4 minutes ago, NQ-Ligo said:
Because of your question and considering that some players seems not know that, but database.lua library is already in the game folder. It's an old library which hasn't been updated since a long time, it was important at the occasion to update it.
This library is simply a collection of functions compiling all API functions you got, to return a structure containing all informations.
You will not get any informations for crafting, like skills ...etc .Thanks for clarification!
In this case I want to request this feature, one way or another
-
DevBlog: Lua Improvements and Changes - Discussion Thread
in General Discussions
Posted
Simplest scenario:
1. Developer (me or someone working on similar tools) provides either lua code to interested Player or shares preconfigured programming board somewhere in game.
2. Player approaches programming board and activates it
3. LUA code reads player ID and fetches their active skills
4. LUA outputs map of skill to value to console. Skill here is skill name used in game, some id or code whichever DU decides to give us)
5. Player copy-pastes output from console into a field on external tool (e.g. du-craft.net)
6. Player uses tool to figure out what resources, factory units etc required for whatever they want to produce.
Currently it's done by player manually (see screenshot) and updating it is a headache: player needs to remember what skills got improved since last time.
Possible in-game API that would allow it (note: I'm not writing LUA code regularly):
<json> getPlayerSkills(<int> pid) - returns all acquired player skills (with 1+ level)
Example of return:
{ "Products.Basic Product Refining.Al-Fe Alloy": 2, "Products.Uncommon Product Refining.Efficiency": 3, "Products.Uncommon Product Refining.Stainless Steel": 2 }
Note: using here arbitrary skill code (used in my tool). It can be anything as long as we as tool developers can map it to in-game skill.
Optional useful methods:
<json> getPlayerSkills(<int> pid, <string> skill_category) - returns all acquired player skills for category
Example of use: getPlayerSkills(somePlayerId, "Products");
<int> getPlayerSkill(<int> pid, <string> skill_code) - returns skill level (0-5)
Example of use: getPlayerSkill(somePlayerId, "Products.Basic Product Refining.Al-Fe Alloy")