AtomicTorch Studio Forums

VoidExpanse => Help section => Topic started by: ninekorn on February 03, 2018, 06:13:03 AM

Title: Is there ass IMCache.GretValue and IMCache.SetValue?
Post by: ninekorn on February 03, 2018, 06:13:03 AM
discontinued 2023 july 29th . by ninekorn
Title: Re: Is there a IMCache.GetValue and IMCache.SetValue?
Post by: Lurler on February 04, 2018, 09:33:32 PM
Just to make sure - did you add all required dependencies for all of those functions/classes?
Title: Re: Is there a IMCache.GetValue and IMCache.SetValue?
Post by: ninekorn on February 04, 2018, 10:35:57 PM
discontinued 2023 july 29th . by ninekorn
Title: Re: Is there a IMCache.GetValue and IMCache.SetValue?
Post by: ai_enabled on February 05, 2018, 12:27:13 PM
IMCache is done on purpose in such way to build the "ship stats cache".

The cache re-calculation is expensive should not happen too often (ideally it should happen only once for every NPC ship - on spawn or savegame reload).

Basically, it's the "stats" parameters of the ship which are populated with by the scripts (with AddValue and MulValue methods) and then combined with other caches (such as weapons/equipment cache) and finalized. You should never use it in any other cases. I'm not even sure if you can override/extend it and use in other scripts (I mean it could break the code from CalculateShip.js).

Alas, VE was made in a big rush years ago (with 99% of these scripts written by a member of the team who left even before the release) and now it's all legacy code and incomplete documentation...