Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

visual equipment script

Ok i want to make it so when i change armour the sprite changes. I've got all the sprites with armour on i just need to make it so it changes when ever i change armour.

I asked on another forum and they said there's probebly a scipt for it
 
There are several visual equipment scripts, I think there are ones from Rataime and Near Fantastica, go search for those if you desire... they're all for armor overlays, though, if you just wish to change the heroes character graphic, you need a small snipped changed in Game_Actor, equip definition... I show you an example:

Code:
def equip(equip_type, id)
    case equip_type
    when 0
      [...]
    when 1
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor1_id], $data_armors[id])
        $game_party.gain_armor(@armor1_id, 1)
        @armor1_id = id
        $game_party.lose_armor(id, 1)
      end
      actor = $game_actors[1]
      case @armor1_id # database ID of armor equipped
      when 2
        actor.set_graphic("Armor-02", character_hue, battler_name, battler_hue)
        $game_player.refresh
      when 3
        actor.set_graphic("Armor-03", character_hue, battler_name, battler_hue)
        $game_player.refresh
      when 4
        [...]
      else # if no armor is equipped
        actor.set_graphic("Armor-01", character_hue, battler_name, battler_hue)
        $game_player.refresh # this is for directly changing the armor after equipped so you won't see that change on the map
      end
    when 2
      [...]
    end
  end

Though it appears to be pretty obvious for me, Trickster told me how to do it on a requst from myself some time ago, so if you feel like crediting someone, credit him ^_^
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top