Page 1 of 1

Scripting and random artifact stats

Posted: 09 Feb 2017, 17:08
by Axebeardbeardaxe
I had an idea for randomizing the stats of every artifact that's spawned and adjusting their sale value accordingly. After putting math.random(1,100) after some of their stats and having the stats come up as 0 in game, I started looking at the LootMoney script as a good place to start, but I'm wondering how I would get each artifact to execute a script when it spawns, then check it's local variables to see if they're not equal to 0.

The idea is on spawn, the script goes through each stat (burn immunity, strike immunity etc) and if the stat is not 0, it rolls a random percentage and adjusts the number by that much (positive or negative). Bad traits would affect the value negatively and good traits would increase the value by percentages based on the new results.

Any way, any help would be much appreciated!

Re: Scripting and random artifact stats

Posted: 09 Feb 2017, 17:25
by Alundaio
That might be impossible currently.

here are the only functions for artefacts:

Code: Select all

         float            GetArtefactHealthRestoreSpeed();
         float            GetArtefactRadiationRestoreSpeed();
         float            GetArtefactSatietyRestoreSpeed();
         float            GetArtefactPowerRestoreSpeed();
         float            GetArtefactBleedingRestoreSpeed();

         void            SetArtefactHealthRestoreSpeed(float value);
         void            SetArtefactRadiationRestoreSpeed(float value);
         void            SetArtefactSatietyRestoreSpeed(float value);
         void            SetArtefactPowerRestoreSpeed(float value);
         void            SetArtefactBleedingRestoreSpeed(float value);

ex. obj:SetArtefactHealthRestoreSpeed(0.0001)

Immunities (ie. hit_absorbation_sect) are static, meaning they are loaded only from the system config, which is read only, when the object loads and there is no current way to change them. You would only be able to randomize the restore speed properties.

Re: Scripting and random artifact stats

Posted: 10 Feb 2017, 06:06
by Axebeardbeardaxe
So an outside script can't alter the variables inside an artifact then, right?

Is this a feature that might be available down the line?