Like you are doing it now, every actor will have his own alignment, just felt like telling you.
actor (if im not mistaken) refers to an instance of RPG::Actor which is a built-in class of rpg-maker xp.
Exchange actor with "self" without the "s.
"Self" always refers to the object which the method is used on. So in this case, as you are using the "setup" method on this Game_Actor object, so the Game_Actor object is "self". I suck at explaining, but here's the code how it should be:
#Public Instance Variables
attr_reader :alignment
#Setup actor_id : actor id
def setup(actor_id)
@alignment = self.alignment
end
#Get Alignment
def alignment
if @alignment >= 20
return "Saint"
elsif @alignment <= 21 and @alignment >=40
return "Good"
elsif @alignment <= 41 and @alignment >=60
return "Neutral"
elsif @alignment <=61 and @alignment >=80
return "Dark"
elsif @alignment >=81
return "Wicked"
else
return "Not Working!"
end
end