Hey I'm currently creating a gauge on my map using srd hud maker and I want to create a condition for the gauge so that it will only appear if a specific type of armor is equipped by the party leader. I know Hud Maker's conditions need to be based on Java script and I tried scouring the internet to see if I could find a working script call. but anything and every thing I've tried creates an error and there for will not work.
How to Check armor condition? with hud maker
Javascript/Plugin Support# Check for Name/ID of Player Equipment
# ----------------------------------------------
$game_actors[1].equips[4].id unless $game_actors[1].equips[4] == nil
# Returns the ID of the equipment on actor X, equipped in slot
Okay So I did already try using this code but It still hasn't worked for me
# NOTE: If using any scripts that give or take equipment slots, the #Y is the number of the character's slot
# not the slot's number in the script. I.E. using Yanfly Equip Menu script - if your character has equipment
# slots 6,7,8,15,15,32,75 available then $game_actors[1].equips[0].id would return the ID of the
# item equipped in the slot defined as slot 6 in Yanfly script because it's the 1st equipment slot for the
# specific character.
I am useing Equip core but I don't actually understand what this note is trying to tell me other than Y may not mean Accessory.
Although with said I just turned off Equip core for testing purposes and right now it doesn't seem to make a difference.
# ----------------------------------------------
$game_actors[1].equips[4].id unless $game_actors[1].equips[4] == nil
# Returns the ID of the equipment on actor X, equipped in slot
Okay So I did already try using this code but It still hasn't worked for me
# NOTE: If using any scripts that give or take equipment slots, the #Y is the number of the character's slot
# not the slot's number in the script. I.E. using Yanfly Equip Menu script - if your character has equipment
# slots 6,7,8,15,15,32,75 available then $game_actors[1].equips[0].id would return the ID of the
# item equipped in the slot defined as slot 6 in Yanfly script because it's the 1st equipment slot for the
# specific character.
I am useing Equip core but I don't actually understand what this note is trying to tell me other than Y may not mean Accessory.
Although with said I just turned off Equip core for testing purposes and right now it doesn't seem to make a difference.
if "head armor" is in slot 1 for this example, and it is replaced to 4, the ID of equip is 3,
if it is ID 1 is lot 1, you need to check 0 as first slot, while $gameMembers.battleMembers[0]
if that one is correct (else example) also return to the party leader.
you can assign the party leader on 3 ways, by members[0]. battlemembers[0] and as .leader.
the same way works for equip slots ID. 0 = 1 (if using yanfly equip plugin(s), else just 1.
you just have to play with it, and make sure the HUD is on SHOW, so you can see if it takes
effect or not.
Now if the condition become "RED" it means, the condtion = false, when you close hudmaker,
the armor piece dissapear, while "Green" is condition = true so it stays visible (if the leader
equiped it).
if it is ID 1 is lot 1, you need to check 0 as first slot, while $gameMembers.battleMembers[0]
if that one is correct (else example) also return to the party leader.
you can assign the party leader on 3 ways, by members[0]. battlemembers[0] and as .leader.
the same way works for equip slots ID. 0 = 1 (if using yanfly equip plugin(s), else just 1.
you just have to play with it, and make sure the HUD is on SHOW, so you can see if it takes
effect or not.
Now if the condition become "RED" it means, the condtion = false, when you close hudmaker,
the armor piece dissapear, while "Green" is condition = true so it stays visible (if the leader
equiped it).
So okay ignoring the Equip core for one sec I've tried
$game_actors[0].equips[4].id unless $game_actors[0].equips[4] == nil
$gamePlayer.leader.equips[4].id unless $gamePlayer.leader].equips[4] == nil
and all of them still come up with an error message.
$game_actors[0].equips[4].id unless $game_actors[0].equips[4] == nil
$gamePlayer.leader.equips[4].id unless $gamePlayer.leader].equips[4] == nil
and all of them still come up with an error message.
try this one. Replace itemIdhere with the items id from your database.
$gameParty.leader()._equips[4]._itemId == itemIdhere
example:
$gameParty.leader()._equips[4]._itemId == 1
this returns true or false depending on if party leader has itemId 1 equipped to equip slot 4 in this example.
i've never used equip core before but if this doesn't work I can set up a test project quickly to see whats going on for you, but this is what works by default in MV.
default equip slots are as follows:
._equips[0] is weapon
._equips[1] is shield
._equips[2] is head
._equips[3] is body
._equips[4] is accessory
$gameParty.leader()._equips[4]._itemId == itemIdhere
example:
$gameParty.leader()._equips[4]._itemId == 1
this returns true or false depending on if party leader has itemId 1 equipped to equip slot 4 in this example.
i've never used equip core before but if this doesn't work I can set up a test project quickly to see whats going on for you, but this is what works by default in MV.
default equip slots are as follows:
._equips[0] is weapon
._equips[1] is shield
._equips[2] is head
._equips[3] is body
._equips[4] is accessory
$gameParty.leader()._equips[1]._itemId == 6
Awesome! that was it after all thank you so much Every One for your time and patients ^.^
Awesome! that was it after all thank you so much Every One for your time and patients ^.^
$game_actors is Ace, not MV
I've moved this thread to Plugin Support. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-check-armor-condition-with-hud-maker.121782/