System Making Equipment System

linamus

I r bak!
Reaction score
57
In this tutorial I'm going to represent you how to do equipable items in GUI.





Introducion

This is easy to make and use system alowing hero to equip items from inventory to virtual backpack

Why this is usefull?
1) It saves inventory slots
2) You can make as many equipable items as you want
3) Usually only 5 item stats allowed in abilities list. Here it's unlimited




Starting

We gonna need:
1) Channel based ability called "Equip"
2) Backpack called "Unequip" (if you are planning more than 11 equipable items, make more backpacks)
3) Several "Unequip" channel-based abilities, number depends on how many equipable items you will have
Example: In Unequip spellbook lies four channel-based abilities: Unequip Weapon ; Unequip Shield ; Unequip Chest ; Unequip Head

Variables:
For each equipable item type we will use two variables

We have equipable Weapon:

EquipWeaponCheck [boolean array]
EquipWeaponItem [item-type array]

We have equipable Shield:

EquipShieldCheck [boolean array]
EquipShieldItem [item-type array]

And so on depending how much equipable items you will make...




Triggers


Here we will only learn how to equip/unequip weapon. For other items just copy paste and change variables.



Code:
Equip
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Q Equip Item 
    Actions
        -------- Weapons --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item-type of (Target item of ability being cast)) Equal to Sharpened Sword   [COLOR="DarkGreen"]---Here we check which item was targeted[/COLOR]
                EquipWeaponCheck[(Player number of (Owner of (Casting unit)))] Not equal to True   [COLOR="DarkGreen"]---Here we check if equiping unit don't alredy have any weapon equiped[/COLOR]
                (Hero level of (Casting unit)) Greater than or equal to 2 [COLOR="DarkGreen"]---It's a condition, Sharpened Sword requires level two to be equiped[/COLOR]
            Then - Actions
                Hero - Drop (Target item of ability being cast) from (Random unit from (Units owned by (Owner of (Casting unit)) matching (((Matching unit) is A Hero) Equal to True))) 
                Item - Remove (Last dropped item)
                Set EquipWeaponCheck[(Player number of (Owner of (Casting unit)))] = True [COLOR="DarkGreen"]---Here we set that equiping unit now has some weapon[/COLOR]
                Set EquipWeaponItem[(Player number of (Owner of (Casting unit)))] = Target item of ability beeing cast [COLOR="DarkGreen"]---And here which weapon type has been equiped[/COLOR]
                Unit - Add Item Damage Bonus (+2) to (Casting unit) [COLOR="DarkGreen"]---And here we add stats that item has (ensure that you're making separate abilities for each item, couse two Inteligence +2 won't stack[/COLOR]
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions) [COLOR="DarkGreen"]---Add another weapon or shield with different variables[/COLOR]



Code:
Unequip Weapon  [COLOR="DarkGreen"]---For each Shield/Chest/Head/So on, make DIFFERENT TRIGGERS[/COLOR]
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Q Unequip Weapon 
        EquipWeaponCheck[(Player number of (Owner of (Casting unit)))] Equal to True [COLOR="DarkGreen"]---Check if unequiping unit really has something to unequip[/COLOR]
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                EquipWeaponItem[(Player number of (Owner of (Casting unit)))] Equal to Sharpened Sword [COLOR="DarkGreen"]---In each IfThenElse action we're checking item type[/COLOR]
            Then - Actions
                Unit - Remove Item Damage Bonus (+2) from (Casting unit) [COLOR="DarkGreen"]---Removing ability[/COLOR]
                Set EquipWeaponCheck[(Player number of (Owner of (Casting unit)))] = False [COLOR="DarkGreen"]---Setting that unit's weapon slot is free again[/COLOR]
                Hero - Create EquipWeaponSlot2[(Player number of (Owner of (Casting unit)))] and give it to (Casting unit) [COLOR="DarkGreen"]---Giving back unequiped item[/COLOR]
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions) [COLOR="DarkGreen"]---Another IfThenElse with other weapon[/COLOR]






This is all, depending on map you're creating depends and items number. In Equip trigger there's easy to classify when adding custom text like "-----weapons-----" after weapon IfThenElse actions have ended, and starts Shields IfThenElse's.
Ty for reading






___________________________

Best Ideas Comes When You're Not Thinking
-> The Land Of Wonders
-> Simple Equipment System TuT
-> Enhance Your Terraining
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,694
Nicely done.

Opinions:

1. A few stuffs may need some italizing.
Variables:
For each equipable item type we will use two variables

We have equipable Weapon:

EquipWeaponCheck [boolean array]
EquipWeaponItem [item-type array]


We have equipable Shield:

EquipShieldCheck [boolean array]
EquipShieldItem [item-type array]


And so on depending how much equipable items you will make...

2. Is it bug-free?

That's all.
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,694
1. No, it's just the text only. I just think that making the text italicized might be more readable.
2. Perhaps it's me not supporting TFT. I owe an apology.
 

Squll2

je'ne sais pas
Reaction score
76
always needed one of these tuts around here, and in GUI even better! +rep :thup:
 

Mr.Tutorial

Hard in the Paint.
Reaction score
42
Pictures of what it is... if possible of course... :) Anyways looks decent, never read tutorials without seeing a picture :p

Start off by spelling "Introduction" Correctly :) Catch up on more detail, explain deeper, make the tutorial easy, less boring, detail.
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,694
And add some font colors to it. It's just being plain to read all the texts in black.
 

ShadowSun

New Member
Reaction score
0
Can you tell me how to get this line:

Hero - Drop (Target item of ability being cast) from (Random unit from (Units owned by (Owner of (Casting unit)) matching (((Matching unit) is A Hero) Equal to True)))

all that i can get is:

Hero - Drop (Target item of ability being cast) from (Random unit from (Units owned by (Owner of (Casting unit))

i can't get the end.:banghead:

Also what skill should i use to base the Equip and Unequip skills off and do they work if they are in a spell book?
 

Sneakster

Active Member
Reaction score
24
Umm there is a variable named EquipWeaponSlot2 that was not mentioned in the variables list. What kind of variable is it and when is it loaded in the equip trigger to know which item to unequip? Can you post a demo map?

And instead of Hero - Drop (Target item of ability being cast) from (Random unit from (Units owned by (Owner of (Casting unit)) matching (((Matching unit) is A Hero) Equal to True))).....you could just say from (Casting Unit)

and instead of Item - Remove (Last dropped item) you could say Item - Remove (Target Item of Ability Being Cast)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top