Can you increase or reset hero's health by code?

Hi all,

Let’s say I store hero’s health at the beginning of a level in a variable called initHealth.

initHealth = current.health

   # and then after some battle with enemies, I do a test

if current.health < initHealth / 2:
current.health = initHealth

Is that possible ?

Thanks for your answers.

You cannot programmatically modify your hero’s (or other units or enemies’) health; it is a “read-only” property.

However, later in the game you will have access to paladins, which you can command to heal your hero and friends.

2 Likes

Thanks for your answer.

I thought so, otherwise it would be too easy :slight_smile:

In game dev, you can edit ur heros health/damage/speed

1 Like

Please do not revive dead threads, but good point :slightly_smiling_face:

1 Like