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.

[Resolved] Equip armor using a call script?

I'm wondering how to automatically equip armor using a call script? So say if i wanted to automatically equip an accessory to Actor1, or equip a shield to Actor5 etc.
I know there is a default event-type that can change equipment for you, but i'm creating a multi-equip system so i need to be able to auto-equip armour/weapons that aren't part of the default five (weapon, shield, body armor, boots, accessory).
How would I do this using a call script? I'm assuming it has something to do with armor_id?

Any help would be appreciated,
~Thanks in advance.
 
well...call script and type:

Code:
actor = $game_party.actors[n]
"n" is the id of the character you want the equip changed
ex: actor = $game_party.actors[0]  <- Aluxes

then right beloe that write:
Code:
actor.equip(type_id, number)
type id means the kind of equip you want to change: 0 is weapon, 1 is shield, 2 is head, 3 is body, 4 is accessory
number means the the item number in the database, for example 12, 13, or 14.

so, if you want to change aluxes's weapon to a bronze knife, just add the weapon, and then type:
Code:
actor = $game_party.actors[0]
actor.equip(0, 13)

hope it's clear, good luck!
 

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