AtomicTorch Studio Forums

VoidExpanse => Modding info => Topic started by: BeLugh on August 14, 2014, 03:43:18 AM

Title: Script: Getting level of a skill? Getting Current value of cargo
Post by: BeLugh on August 14, 2014, 03:43:18 AM
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?
Title: Re: Script: Getting level of a skill? Getting Current value of cargo
Post by: Hammish on August 14, 2014, 01:30:39 PM
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.
Title: Re: Script: Getting level of a skill? Getting Current value of cargo
Post by: ai_enabled on August 14, 2014, 08:30:56 PM
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.
Title: Re: Script: Getting level of a skill? Getting Current value of cargo
Post by: BeLugh on August 15, 2014, 10:20:50 AM
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
Title: Re: Script: Getting level of a skill? Getting Current value of cargo
Post by: ai_enabled on August 16, 2014, 03:16:27 AM
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!
Title: Re: Script: Getting level of a skill? Getting Current value of cargo
Post by: BeLugh on August 16, 2014, 01:01:05 PM
Thanks, it works great now :D