Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Class skill display, Displaying the skills available in $data_classes.learnings
richardpilbeam
post Apr 27 2012, 01:10 AM
Post #1


Level 1
Group Icon

Group: Member
Posts: 14
Type: None
RM Skill: Intermediate




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?
Go to the top of the page
 
+Quote Post
   
Moonpearl
post Apr 27 2012, 05:13 AM
Post #2


Level 5
Group Icon

Group: Member
Posts: 73
Type: Developer
RM Skill: Advanced




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.


__________________________





Go to the top of the page
 
+Quote Post
   
richardpilbeam
post Apr 27 2012, 05:33 AM
Post #3


Level 1
Group Icon

Group: Member
Posts: 14
Type: None
RM Skill: Intermediate




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.
Go to the top of the page
 
+Quote Post
   
brewmeister
post May 17 2012, 02:22 AM
Post #4


Paste above Main
Group Icon

Group: Revolutionary
Posts: 408
Type: Scripter
RM Skill: Skilled




"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




__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 11:14 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker