Snippet of code to equip a specific armor

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
What's the script line to equip a given armor to a given character (for instance armor ID 12 to actor ID 3)?
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
Code:
$game_actors[your_actor].change_equip(slot_id, item)
"your_actor" is the id of your actor, "slot_id" is the slot id, "item" is the item you want to equip. It can be one of the following:
Code:
$data_armors[id]
$data_weapons[id]
depending on what kind of item you want to equip.
 
Last edited:

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
Thank you, the "shield" has which slot_id, 1 or 0?

EDIT:
I used the following command and it gave me an error message:
$game_actors[2].equip_item(1, $data_armors[51])



Both actor 2 and armor 51 were available.
 
Last edited:

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
Sorry, I just checked and it looks like my memory was failing me: the method is change_equip (same arguments). I will correct that in my first post as well. By the way, "shield" is slot 1, slot 0 is your weapon.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
$game_actors[2].change_equip(1, $data_armors[51])

does work. Thank you very much. :ninja::thumbsup-left:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,035
Messages
1,018,459
Members
137,821
Latest member
Capterson
Top