How to make a shield work?


I want to make a shield that when equipped alters the player’s Armour Class. I also want only certain characters to be able to equip this shield. For example a Fighter can equip a shield, but a Mage cannot.

There is a setting Can be Equipped on the Item Script. Should I try to change this (some how) in Blox, depending on what type of character picks up the shield? Or is there a way to say, if you don’t have the Equip Shield skill, you cannot equip the shield.

I should point out, I want this to work in the rpg_ui when you press the equip button.

(Marshall Heffernan) #2

Leave the check box "can be equipped " checked, or nobody will be allowed to equip it.

As far as defense, you could make an armor attribute and then use blocks like…

Change attribute armor by 20

change attribute armor by -20

(Or instead of “change attribute” you can do SET to A+B and A-B).

Then when you’re hit by an enemy, you need to use a damage resistance formula

I made THIS FORMULA few months ago, feel free to use it.

Lastly, as far as restricting your equipment, you have two options.

  1. Modify the button to do what you want (CLICK HERE to go to my Text tutorial on how to do this)
  2. unequip the item ON EQUIP if the player is the wrong class.

I will be recording an updated video tutorial on how to do this, but it’s video #14 in my upcoming tutorial series so it might be a minute.


Thanks itsmars. I ended up going with unequipping the item ON EQUIP if the player is the wrong class.
I will probably copy ActorAttribute_Set_plyBlock and turn it into your damage formula.

If Leslie is reading, there is a bug where if you drop the item Always to the Scene, the Character Sheet does not clear the icon of the item on the interface. I got around it by closing the Character Sheet.

(Leslie Young) #5

It is not a bug. The Equip Slots system knows nothing about what reads values from it to show on the screen. So it can’t command whatever is looking to update.

The sample UI does not lookup the items every frame, for performance reasons. The character sheet checks the equip slots when it is opened and updates the icons as needed. The sample ui expects that equipping and unequipping will happen via the sample UI. Equipping from the bag and unequipping via the character sheet.

(Marshall Heffernan) #6

I’m on my cellphone so I can’t say for sure, but if there’s an event for “on character unequip” you could close it then immediately open it again.

On actor Unequip item
If [get enabled on CharaSheet = true]
Disable CharaSheet
Enable CharaSheet


That worked great. My first use of a global variable. :smile:

Thanks guys.