Help - Search - Members - Calendar
Full Version: Class skill display
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion
richardpilbeam
What I'm trying and failing to do is make something like Window_Skill that, rather than reference the skills known by an actor, references the skills in $data_classes[whatever].learnings. Doesn't have to do anything besides draw a list.

eg. if I'd made class 6 a healer that learned Cure, Cura, Curaga and Remedy, then got it to call up $data_classes[6].learnings it'd draw up...

*Cure *Cura
*Curaga *Remedy

...with * being the skill's icon.

All my attempts to do this have failed miserably so I don't have any example code.

Any ideas on how to fix this?
Moonpearl
QUOTE (richardpilbeam @ Apr 27 2012, 01:10 AM) *
All my attempts to do this have failed miserably so I don't have any example code.

Yes you do. If we can't see what code you tried, we can't tell you why it failed.
richardpilbeam
Well, more accurately "I don't have any example code because it ended up in such a horrible mess that I deleted it" ermm.gif

The relevant bit of Window_Skill I messed around with was:

CODE
@data = []
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills[i]]
      if skill != nil
        @data.push(skill)
      end
    end


To

CODE
@data = []
    for i in 0...$data_classes[6].learnings.size
      skill = $data_classes[6].learnings
      if skill != nil
        @data.push(skill)
      end
    end


And after about a dozen variations on the above I figured it was beyond me.
brewmeister
"learnings" is an array, so you need to tell it which element in the array to assign to "skill"

CODE
@data = []
    for i in 0...$data_classes[6].learnings.size
      skill = $data_classes[6].learnings[i]
      if skill != nil
        @data.push(skill)
      end
    end


This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.