Workshop.codes
Login
Create
Spiderman31807

Custom Health / Shield Health

This code is over 6 months old. The code may have expired and might no longer function.

10 Comments

Log in or Sign up to leave a comment.
Alyure over 1 year ago

Juno's health doesn't seem to be working as it should, she's always stuck at 125 HP when using no preset. Am I doing something wrong?

Spiderman31807 creator over 1 year ago *

The 125 doesn't make any sense, given her health values of 75 + 150

"Juno"
        Modify Global Variable(HealthSettings, Append To Array, Array(Array(75, 0, 150)));

Thus i can only conclude that shes linked to the wrong hero data, if what your saying is true.

Alyure over 1 year ago

https://imgur.com/a/wxraNVv

I just opened a game with your code, using the "None" preset, I made no changes besides the preset.

But even when using presets, her health is still at 125.

The half preset sets her health to 63.5.

Spiderman31807 creator over 1 year ago *

i'll have to look into that when i have time, but i've been very busy the last 3-4 months because i started hosting a Ark Server.

Rubylich over 1 year ago

How do you actually change health pools? (I don’t really understand variables yet) like giving doom 125 armor for example

Spiderman31807 creator over 1 year ago *

you would go into the modify subroutine, first store the current value for the Hero by setting TempValue to Value in Array(HealthSettings, Index of Array(All Heroes, Hero(Doomfist)).

that Global Variable is now storing the current Health for Doomfist in an Array of 3, where 0 is the Normal HP, 1 is the Armor & 2 is the Shield, so you would then do Modify Global Variable at Index(TempValue, 1, Add, 125) which will add 125 to the Armor in the array.

then finally you can update the HealthSettings with the new Health by doing Set Global Variable at Index(HealthSettings, Index of Array(All Heroes, Hero(Doomfist), TempValue)

Alternatively you can also just go into the Base Subroutine and modify the array that code thinks will be the Normal Health before any edits. each Append to Array that adds a Hero has a Comment above it, saying what hero its for.

Since the only reason its meant to match unmodified values is for easy and less complex modifications in the Modify Subroutine (which is also completely optional, and can be removed).

Alyure over 1 year ago

This is perfect, but DVa's health pool doesn't seem to work.

Spiderman31807 creator over 1 year ago *

Yeah i did say that in the description, and that i would fix it later. later is now tho, i just fixed it & came back to the site to update it.

teakowa over 1 year ago

It works, but the change to the barrier HP causes the hero to have a “near-death” effect.

Spiderman31807 creator over 1 year ago *

im aware but its not possible to fix, its caused by the 30% of the maximum health being higher than the health added by the HealthPools. (i think its 30% might be wrong)

basically like deployables the near death effect triggers based off max health and does not care about any added Health from the Workshop, so if the Maximum health is increased a ton (like in the example OP Barriers) then pretty much any health will display the effect.

however if this triggers on heros you've reduced the health for using the tool, and they have no deployables, just decrease their max health using Set Max Health(Event Player, 1) and it'll fix it. if they do have a deployable it'll decrease the deployables HP as well (also any health buffs, like Lucio Ultimate)

the only reason i didn't do that already in the code, is because it would mean having another large array containing which heroes do & dont have deployables. and there is already 2 large arrays for shield & health, and like 7 variables overall. i haven't done much workshop this year but i feel like its already too many variables for something thats meant to be a tool that gets imported into another code.

Workshop.codes