- Joined
- Mar 31, 2019
- Messages
- 7
- Reaction score
- 0
- First Language
- English
- Primarily Uses
- N/A
I probably only messed up something simple.
I want to convert a numerical level to alphabetical so instead of 1,2,3 , A,B,C is displayed instead
I decided to make an array and just match them
which actually works when I input a fixed number, such as 3 into it
But when I try to call the actor's current level, the error "undefined local variable or method "actor" is shown
which is very weird because in the default, actor.level is used in draw_text
I want to convert a numerical level to alphabetical so instead of 1,2,3 , A,B,C is displayed instead
I decided to make an array and just match them
which actually works when I input a fixed number, such as 3 into it
But when I try to call the actor's current level, the error "undefined local variable or method "actor" is shown
which is very weird because in the default, actor.level is used in draw_text
Ruby:
class Window_Base < Window
Alph = ("A".."Z").to_a
def grade
grade=Alph[6-actor.level]
return grade
end
def draw_actor_level(actor, x, y)
change_color(system_color)
draw_text(x, y, 32, line_height, "Result")
change_color(normal_color)
draw_text(x + 32, y, 24, line_height, grade, 2)
end
end

