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.

[VX] Visual equipment script

tuti05

Member

I'm requesting a script for VX. When the hero equips a certain body armor then his Character graphic would change accordingly.
I don't really care for shields and helmets, just the body armor because then i can just name the armor "Full chain mail armor" or something.

I guess in the script after all the coding it would be nice to be set up like:

Chain Mail, graphics/characters/HeroChainMail.png
(Armors name in game)      (File name of hero's set)


1. The idea is that in a game the second i buy and equip a mage's robe then my hero would be wearing the robe, or light/heavy armor.

2. I know the character sets have 8 different characters in it, my character sets would just have one character to make it easier for anyone writing the script. I've never scripted but I've been lurking the forums since xp came out, i don't think this script should be hard.

3.  I like that the game Oblivion does it. I always wanted an rpg to show the character when he changes armor.




Quick question, Could i make a common event where it checks to see if a certain armor is equipped? then i can just make that common event change how the hero looks!
 
tuti05":ki5f9jbr said:
...i don't think this script should be hard.

Not a warning, just a suggestion:  If you can't do it yourself, don't assume it's easy!  (Sorry, it's a pet peeve of mine)

Try doing a search on "Visual Equipment" or "Visible Equipment". I know several have been done for XP. You could ask someone to port it to VX. There are a few scripters cranking out ports from XP to VX.

You could do it with a common event, but it wouldn't be too efficient. It would keep checking & resetting the character set when it doesn't need to be changed. Better to have it as part of the "Equip" scene, so the character set only changes when the equipment changes.

Be Well
 

tuti05

Member

Thanks for the reply. I remember using those scripts, specifically for the rtp battler graphics. The only other one i saw let you create a character from scratch.

And porting the script is a good idea but just with the difference in graphics like how the VX chars are shrunken, i figure i don't need to get too much detail like i could with XP.

So you think i could take a look at the equip scene and try some basic scripting?
 
It's not hard if you know what you're doing, here's your script:
Code:
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Charater Name (for your walking graphic)
  #--------------------------------------------------------------------------
  def character_name
    unless @armor3_id == 0
      return @character_name + @armor3_id.to_s
    else
      return @character_name
    end
  end
end
You will probably want to just have the character graphic on a sheet to itself by using a $ in the filename. The alternate sprites should be named like this:
Ralph - No armor
Ralph14 - Leather Breastplate equipped
etc

Hope that helps.
 
tuti05":1s0x5lwy said:
would i put the alternate sprite names after the armor3_id.to_s code?
Alternate sprite names?

Didn't you ask for it to be automatic?
You don't enter any names you just follow the convention.
e.g. if I have no armour:
Ralph
With Leather Breastplate equipped
Ralph14
 
Hi, I was just trying to use the above script, and the character sprite does not change on the map when the item is equipped, yet it does change for the icon in the save and load screen.
I have this script pasted just above main.
Can anyone help me out plz?
Thanks in advance =)
 

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