How do I…
I want to be able to find the variable “hp” of a certain instance of “Player”. (in this case, it should be zero)
I’m sorry if this has been asked or answered (which it probably has)
I want to be able to find the variable “hp” of a certain instance of “Player”. (in this case, it should be zero)
I’m sorry if this has been asked or answered (which it probably has)
Give each player different variable let’s call it ID
Now you can give to player 1 ID variable with value of 1 to player 2 with value of 2 and so go on
And now you can
Player variable ID = 3
Change player HP add 15
Good! I’d like to ask though:
How could I set a value to a progress bar?
(So, something like Set progress bar value to [Player[id = 0].hp]
You need to know how long you want it to be
so width of it
FOR EXAMPLE let’s say you want your bar to be 230 pixels wide
And now you need only to know what is max player HP for example 70
In events
Condition
Player ID variable = 0
Action
Change width of progress bar set to
MAX width of your bar / Max player HP * player current HP
So in case of values i give as example at beginning
230 / 70 * Player.HP
Would be wise to have max HP as player variable for example call it MaxHP
And now
230 / Player.MaxHP * Player.HP
If you gonna kill player like delete object
Then smarter thing to do would be to have it as scene/global variable
…bit complicated.
Found my own solution though, but thanks for the help! ![]()
Can you post your solution so others can learn?
If an event doesn’t have any conditions then by default, any actions or expressions apply to all instances. If you only want to read the variable or value of 1 object then you can use a condition to check say the ID object variable. Then any other conditions, actions or expressions would apply to only to that object. The picklist remains in play for all subevents unless another condition alters it or a completely new event is started.
If execution returns to a previous level (indentation) then that picklist is used. Each indentation has it’s own picklist.
Conditions work like filters.