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.

Query regarding equipping during in-battle common events

First, if there is already something like this somewhere on the forum, I apologize, and request to be pointed there. I used a search which did not find anything, but I realize that I may not have used the right terms.

I'm experimenting a bit with an idea for battles, and for some of the tricks I'm playing with, I'd need to be able to force equipment changes during battle. (I'm working in RMXP, currently using the default battle setup. The only script change I'm planning to make is to relocate the battlers so the system looks sideview.) Specifically, I'm needing to add/remove certain pieces of equipment based on skills used by the party/the enemy party.

I thought I had this worked out. I created a set of 'target' status effects to be used in skills that are intended to call common events. A character hit by the skill is effectively 'tagged' by the status, allowing me to (in theory) cause the called common event to determine who needs to be checked on by comparing character states. It would then check on, and if necessary change, the equipment in question during the body of a dedicated common event called from the original. However, the code I have set up doesn't appear to be actually changing the equipped items, and I'm not sure why.

What follows is a pseudo-code version of the event in question.

Code:
Common event 1 - general skill processing

{

  If (Chara1) in party:

  Call Chara1 Equipment Read

  Call Chara1 Equipment Set

}

Repeat for charas 2-N

End Common event 1

 

Common event 2 - Chara1 Equipment Read

Chara1 Weapon/Armor/Shield/Helm/Accessory = 0 (Five variables)

If (Chara 1 Item X equipped) then //(Repeated for all equipment)

{

  Variable Chara1 Weapon/Armor/Shield/Helm/Accessory = Y

}

End Common event 2

 

Common event 3 - Chara1 Equipment Set

If (Chara1 Wep/etc == 0) 

{

  If (Chara1 State Z inflicted)

  {

    Equip/Unequip correct item based on status and variable.

  }

  Repeat above as necessary

}

Repeat above as necessary

End Common event 3

 

At the moment, I'm using a set of skills that should equip a specific set of accessories to the character to induce after-battle status effects; the status effects of the accessories in question can magnify, hence the determination of what equipment is present in all cases. (Skill[1] hits Character[1], invoking State[1]EX and calling the common event, which force-equips Character[1] with Accessory[1] that auto-generates State[1]. Skill[2] then hits Character[1] with State[2]EX, the common event determines that Character[1] is already equipped with Accessory[1], and the combined result Accessory[1][2] has State[1][2] with the effects of both State[1] and State[2].)

The event code above appears to run through correctly for the sample I'm working with (little text box notes posted throughout it, including inside the conditional branches, show on the screen), but I'm not seeing any changes in the equipment when this code runs. Nor am I seeing the accessories in that slot for the character in question after battle, even when I know they've been hit with the skills and gone through the various self-notes in the event.

None of my test character's equipment slots are fixed, and the test accessories I'm using are equippable by the test character's class.

Does anyone see anything I'm doing that is preventing me from having my equipment changed by the events in question?
 

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