Scripting and random artifact stats

Axebeardbeardaxe
Scavenger
Posts: 6
Joined: 17 Jan 2016, 18:20

Scripting and random artifact stats

Postby Axebeardbeardaxe » 09 Feb 2017, 17:08

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!

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

Re: Scripting and random artifact stats

Postby Alundaio » 09 Feb 2017, 17:25

That might be impossible currently.

here are the only functions for artefacts:

Code: Select all

         //Artifacts
         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.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

Axebeardbeardaxe
Scavenger
Posts: 6
Joined: 17 Jan 2016, 18:20

Re: Scripting and random artifact stats

Postby Axebeardbeardaxe » 10 Feb 2017, 06:06

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?


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests