• Welcome to AtomicTorch Studio Forums.
 

Script: Getting level of a skill? Getting Current value of cargo

Started by BeLugh, August 14, 2014, 03:43:18 AM

BeLugh

Is it possible to get the current learned level of a skill with a function? like GetSkillLevel(args.ship_id , haggling) ?
(Instead of asking for effects)

How to request the current value of cargo? cargo_capacity works well, but cargo does not seem to be an effect, so GetCurrentValue GetFinalCacheValue does not work for "cargo", or does it have a different name?

Hammish

I haven't looked at the scripting TOO deeply yet, but from what I remember it might be easier for you to grab effect data as opposed to a skill level data.  That might serve as a stopgap depending on what you need it for, if it's an effect that only has one skill feeding it.

ai_enabled

Well, we have methods:

ship.GetSkills(ship_id)
- returns array, every item of which contains "id" and "level" properties.

ship.GetCargoAmount(ship_id, cargo_type)
- returns number: amount of specific cargo on ship and (if ship docked) on spacestation cargo storage.

We will add in new game build (today):
ship.GetSkill(int ship_id, string skillId)
- return skill level (0 if ship don't have it).

ship.GetCargoAmount(int ship_id)
- returns total amount of cargo on ship and (if docked) plus amount of cargo on spacestation cargo storage.

BeLugh

ship.GetCargoAmount(int ship_id)
- returns total amount of cargo on ship and (if docked) plus amount of cargo on spacestation cargo storage.

It is the same function as fo rspecific cargo. It always retrieves 0

ai_enabled

Sorry, I made mistake: new method named "GetTotalCargoAmount", not "GetCargoAmount". As argument it accepts ship_id and returns number. It should work! Also if ship is docked it adds total cargo amount from cargo storage on the space station.
Regards!