Check Character Equipment

Checking Currently Equipped Items on a Character
This is a temporary page that explains how to create some code to check to see if a certain weapon or armor is equipped to a character. This page only contains psuedo Stencyl code and is slightly technical. This page exists only until the programmer gets around to implementing this within the Easy RPG Creator Kit.

- Requirements :


 * 2 List Attributes


 * 1 Boolean


 * Character ID


 * Weapon/Armor ID

Checking for a Weapon :

set Boolean to false

set List Attribute #1 equal to value of CharID#Equipment (Replace CharID# with the Character ID, and NO SPACES) (Example, if the character you want to check has an ID of 0, then you would type 0Equipment)

Repeat number of items in List Attribute #1 Times (Current Loop Count)


 * set List Attribute #2 equal to (split Get Item #Current Loop Count from List Attribute #1 using separator ~)


 * if Current Loop Count = 0 AND (Get Item #0 from List Attribute #2) = Weapon ID


 * Set Boolean to True

If Not Boolean (outside of the Repeat Loop)


 * Weapon is not equipped

Otherwise


 * Weapon is equipped

 Checking for an Armor :

set Boolean to false

set List Attribute #1 equal to value of CharID#Equipment (Replace CharID# with the Character ID, and NO SPACES) (Example, if the character you want to check has an ID of 0, then you would type 0Equipment)

Repeat number of items in List Attribute #1 Times (Current Loop Count)


 * set List Attribute #2 equal to (split Get Item #Current Loop Count from List Attribute #1 using separator ~)


 * if Current Loop Count > 0 AND (Get Item #0 from List Attribute #2) = Armor ID


 * Set Boolean to True

If Not Boolean (outside of the Repeat Loop)


 * Armor is not equipped

Otherwise


 * Armor is equipped