Conditional Branch for Heavy/Light Armor?

lesbrarians

Villager
Member
Joined
May 23, 2021
Messages
12
Reaction score
6
First Language
English
Primarily Uses
RMMV
So I'm setting up a weather/temperature system, where different maps have different temperatures (e.g. freezing for snowy maps) and the armor a player wears grants them cold resistance/heat resistance. The player will have their choice of multiple types of armor because I love customization, so I'm using the armor type system to determine whether the armor they choose will be good for the environment. So for freezing temperatures, they need at least two pieces of heavy armor equipped. For boiling temperatures, they need at least two pieces of light armor equipped. If they enter the environment with the wrong kind of armor, they'll be notified that they're too hot or too cold, and if they continue, they'll eventually pass out.

So I have a common event for temperature and am setting up a series of conditional branches based on region type, and I need to check for the armor type that the player has equipped (preferably the number of armor types too... i'm doing shirts/pants/hats for armor pieces). Unfortunately, I don't see a condition for type of armor, only for specific armor pieces. I'm guessing I have to use script calls for this, but I've never used script calls before, and I'm struggling to make sense of the spreadsheet with all the script calls. Can anyone nudge me in the right direction as to how to set this up? Thanks so much in advance!
 

Neareyn

Villager
Member
Joined
Apr 21, 2021
Messages
19
Reaction score
3
First Language
German
Primarily Uses
RMMZ
You could call a common event if the player wears a light armor and use switches or variables for it.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,293
Reaction score
8,365
First Language
German
Primarily Uses
RMMV
here is an alternative idea, but unfortunately not an easy one.
go to the help file, plugin specification section and look up the meta function.
you can place notetags for heat and cold on your equipment, then use a (rather convoluted) sequence of script calls to get the values from the equipment the actor wears.
and then you can compare those numbers directly.

not easy, requires some javascript knowledge, but a way to handle the problem.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,699
Reaction score
2,800
First Language
English
Primarily Uses
RMMZ
There's already a property you can use for this: atypeId.

For example, to check that the party leader is wearing 2 pieces of heavy armour (assuming that's armour type #4) your condition would be

$gameParty.leader().armors().filter(armor => armor.atypeId === 4).length >= 2
 

lesbrarians

Villager
Member
Joined
May 23, 2021
Messages
12
Reaction score
6
First Language
English
Primarily Uses
RMMV
Ahhh, thank you so much, that's perfect!! I appreciate the quick response, this is so helpful!
 

Latest Threads

Latest Posts

Latest Profile Posts

The snowy mountains in my game are finally done... what a crazy journey.
I participated in the official video event collection!
Well I am infinitely upset that I finally got a good idea... after the Touch the Stars game jam is pretty much over.

Gather resources to build a spaceship to escape the apocalypse! It would have been cool....
Thinking that if I get MZ, I'll work on a new Project. How about instead of just an RPG, I make it episodic, like an anime? You might even get fanservice. Oh, but I need the right costume for the character.
"but what even is an API??"

Forum statistics

Threads
113,606
Messages
1,076,159
Members
147,609
Latest member
xshwarrior
Top