The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: blazinhandle on February 22, 2007, 05:42:51 AM

Title: [Resolved] status as icons?
Post by: blazinhandle on February 22, 2007, 05:42:51 AM
anyone know where i can get a script that will display a character's status as icons (i already have ones made) rather than the name? Like if a character is stunned it'll show a lightning bolt, but if he's also slow it'll show 2 icons? Thanks!
Title: Re: status as icons?
Post by: modern algebra on February 22, 2007, 05:46:10 AM
It's late so I'm not really thinking, but can't you just make the icon into an animation and just have the state activate that animation?
Title: Re: status as icons?
Post by: blazinhandle on February 22, 2007, 01:46:27 PM
Quote from: modern algebra on February 22, 2007, 05:46:10 AM
It's late so I'm not really thinking, but can't you just make the icon into an animation and just have the state activate that animation?


hmmm, well i'm looking to display the icon(s) in the battle status window and replace those for the text.
Title: Re: status as icons?
Post by: italianstal1ion on February 22, 2007, 09:07:56 PM
The images = [] is where you put your images named after your status'. Ex: you have Poison as a status, have a picture in the icons folder called Poison.

def make_battler_state_images(battler)
    images = []
    for i in battler.states
      images.push(RPG::Cache.icon($data_states[i].name))
    end
   
    return images
  end
 
  def draw_actor_state(actor, x, y, width = 120)
    images = make_battler_state_images(actor)
    for i in 0...images.length
      rect = Rect.new(x + (i * 26), y, self.width - 32, 24)
      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
      self.contents.blt(x + (i * 26), y, images[i], Rect.new(0, 0, 24, 24), 255)
    end
  end
Title: Re: status as icons?
Post by: blazinhandle on February 23, 2007, 05:49:25 AM
sweet! thanks man!
Title: Re: [Resolved] status as icons?
Post by: fadark on March 02, 2007, 12:10:43 AM
It doesn't work for me.  :(
Title: Re: [Resolved] status as icons?
Post by: radha2g on March 07, 2007, 08:20:34 AM
I cant believe how quick was that
very useful for showing all status, just what i was looking for but with pictures :)
thanks
by the way, i didnt add any images name to 'images' variable and it worked just fine jeje

Quote from: fadark on March 02, 2007, 12:10:43 AM
It doesn't work for me.  :(
you have to add the code to Window_Base before the last 'end', and add the images with the name of the status to the Icons folder. They have to be png, i think
Title: Re: [Resolved] status as icons?
Post by: fadark on March 07, 2007, 10:03:27 PM
whats png mean?
Title: Re: [Resolved] status as icons?
Post by: blazinhandle on March 07, 2007, 10:21:58 PM
it's the file extension
Title: Re: [Resolved] status as icons?
Post by: fadark on March 08, 2007, 12:38:21 AM
whats that?
Title: Re: [Resolved] status as icons?
Post by: blazinhandle on March 08, 2007, 02:53:28 AM
most pictures in RMXP use .png files for example Arshes character sprite is a .png (Arshes.png).
Title: Re: [Resolved] status as icons?
Post by: fadark on March 08, 2007, 12:54:36 PM
okay thanks it works! :D
Title: Re: [Resolved] status as icons?
Post by: Irgna on March 17, 2007, 11:51:36 PM
I did it correctly but I keep getting an error message... I followed what y'all said exactly. Any idea what I might be doing wrong? I can't seem to do anything that has to do with scripts without completely screwing it up... :'(