Windows Forgive me Senpai, How to check players level?

M

MrTholl

Guest
Please tell me if I'm breaking any rules for posting.
I made an attack button and when I click it, it will check what the players level is first. Then it will pick from a range of numbers and then use that number as the attack to the enemy. The error says unexpected symbol ")". The one after the word level, I think.
 

Attachments

Nocturne

Friendly Tyrant
Forum Staff
Admin
In the "Function" action... you put JUST the function name in the "function" field, and then in argument you put "level" (without quotes or ()". Like this:

upload_2018-6-27_18-19-3.png

However, in this case you don't actually have to do that at all... simply do the check without that that action like this:

upload_2018-6-27_18-22-20.png
 
M

MrTholl

Guest
I'm calling because I'm setting the level in a code object.
 

TheouAegis

Member
player_level = get_variable(player_level)? Makes no sense to me.

I can foresee this getting real messy. How many player_levels are there?
 
M

MrTholl

Guest
Ok. I decided to try this. Add a step event and check if the attack button is being pressed. But the enemy health is not updating.
 

Attachments

TheouAegis

Member
Yeah, you use an algorithm, like

irandom_range(player_level div 10, player_level * 2 + 8)

Or you have an array of values for each level to use, but i think algorithms are more fun.


What is attack_obj? Why is it being compared to an event (I'm aussuming that is what you did there)?

What are you trying to set enemy_health to? It cut off the first part.
 
M

MrTholl

Guest
Can you explain your algorithm please? Attack_obj is the attack button. I'm setting the enemy health to enemy_health-player_attack. It's the second blue box.
 

TheouAegis

Member
You can just use -player_attack and cick the Relative box.

My algorithm just does what your randomizer does, but insteadof 0 and 10, it chooses a minimum of 0 and goes up by 1 every 10 levels, and chooses a maximum value based on the level (the higher the level, the higher the max damage every time).
 
Top