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


#1

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.


#2

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.


#3

Thanks for your answer.

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


#4

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


#5

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