How to Apply Item Abilities to Heroes Without Using Items

eskimojoe_66

Member
Reaction score
2
In my map, im using the inventory to show items that would be in the selected hero's bag, and using a multiboard system to allow players to view equipped items, such as helmets, armor, weapons and boots. Because of this, I cannot simply create items with item abilities to apply their effects to the hero, so I need to know how I can apply/remove item abilities to/from heroes without the use of actual items.

I have already tried giving the heroes the item abilities and disabling them using the "Player - Enable/Disable ability for hero" and then enabling them when they equip different items, but it doesnt work :banghead:
 

Komaqtion

You can change this now in User CP.
Reaction score
469
You need to change the abilitys to Hero Abilities instead of Item Abilities in the object editor, under Stats - Hero ability = True and Item ability = false
 

eskimojoe_66

Member
Reaction score
2
O um is there another way? see, my "heroes" are actually just units that have an inventory. To make things simpler, I wanted to avoid all of the additional elements that accompany using heroes (e.g. attributes, levels, etc.)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
well, then make them unit abilities ;) set both those fields to false, and there you have it :D
 

eskimojoe_66

Member
Reaction score
2
i have tried doing that, but it doesnt work :(
do i still use the "Player - Enable/Disable ability for player" action?
 

mathiashl

New Member
Reaction score
0
i have tried doing that, but it doesnt work :(
do i still use the "Player - Enable/Disable ability for player" action?

Anyway dont use disable/enable just set to
Stats - hero ability : False
Stats - item ability : False

Now when you select abilitys for your units, the ability will be under the
Units- Custom

;)
 

eskimojoe_66

Member
Reaction score
2
Anyway dont use disable/enable just set to
Stats - hero ability : False
Stats - item ability : False

Now when you select abilitys for your units, the ability will be under the
Units- Custom
O I see whats going on

sorry if I didnt make this clear before. Im want the 6 inventory slots to be used for UNEQUIPPED items. You will be able to click EQUIPPABLE items (e.g. helmets, breastplates, staves, boots, etc.) in your inventory to equip them. The thing is, once their equipped, they dissapear from you're inventory and are shown in a custom multiboard that is unique for each player (this is supposed to happen by the way).

Because of this, you cannot simply add item abilities to items to apply their effects to the heroes, I have to trigger them. I thought it would be simple, like an "add ability" thing. I tried using the "Player - Enable/Disable ability for player" to do this, disable ALL item abilities at the beggining and triggering them so that when a hero EQUIPS an item, i use the "Enable ability for player" function to apply the desired item abilties to the hero, as if that item was right there in their inventory...

BUT IT DOESNT WORK :(
so i need another way to apply and remove item abilities to units when the items are equipped and unequipped.

I hope this explained things more clearly :p
 

mathiashl

New Member
Reaction score
0
O I see whats going on

sorry if I didnt make this clear before. Im want the 6 inventory slots to be used for UNEQUIPPED items. You will be able to click EQUIPPABLE items (e.g. helmets, breastplates, staves, boots, etc.) in your inventory to equip them. The thing is, once their equipped, they dissapear from you're inventory and are shown in a custom multiboard that is unique for each player (this is supposed to happen by the way).

Because of this, you cannot simply add item abilities to items to apply their effects to the heroes, I have to trigger them. I thought it would be simple, like an "add ability" thing. I tried using the "Player - Enable/Disable ability for player" to do this, disable ALL item abilities at the beggining and triggering them so that when a hero EQUIPS an item, i use the "Enable ability for player" function to apply the desired item abilties to the hero, as if that item was right there in their inventory...

BUT IT DOESNT WORK :(
so i need another way to apply and remove item abilities to units when the items are equipped and unequipped.

I hope this explained things more clearly :p

No:confused:
it is confusing but i think i got it.

you want to make the unequipped items to stay in your inventory and the equipped intems to be shown in the multiboard, but you cant apply the abilitys from the equipped items to work. you wanted to diable the abilitys when the items was unequipped.

hmm. have i understanded it :eek:

another question: are you DK
 

Defi4nc3

Developer of DORPG
Reaction score
20
Trigger:
  • Equip One Handed Slashing
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to |cfff0ffffRusty Sword|r
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of Hero[(Player number of (Owner of (Hero manipulating item)))]) Greater than or equal to (Item level of (Item being manipulated))
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • (Race of (Hero manipulating item)) Not equal to Undead
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • WeaponChk[(Player number of (Owner of (Hero manipulating item)))] Equal to 0
                      • InvChk[(Player number of (Owner of (Hero manipulating item)))] Less than 6
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • And - All (Conditions) are true
                            • Conditions
                              • (Custom value of (Item being manipulated)) Not equal to BindItems[(Player number of (Owner of (Hero manipulating item)))]
                        • Then - Actions
                          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                          • Hero - Give (Last dropped item) to HeroInventory[(Player number of (Owner of (Hero manipulating item)))]
                          • Set Player[3] = (Owner of (Hero manipulating item))
                          • Set PlayerGroup[3] = (Player group(Player[3]))
                          • Game - Display to PlayerGroup[3] the text: ((|c00ffff33System:|r |c00ffffffYou have equipped + (Name of (Item being manipulated))) + !|r)
                          • Game - Display to PlayerGroup[3] the text: |c00ffff33System:|r...
                          • Custom script: call DestroyForce( udg_PlayerGroup[3])
                        • Else - Actions
                          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                          • Hero - Give (Last dropped item) to HeroInventory[(Player number of (Owner of (Hero manipulating item)))]
                          • Set Player[3] = (Owner of (Hero manipulating item))
                          • Set PlayerGroup[3] = (Player group(Player[3]))
                          • Game - Display to PlayerGroup[3] the text: ((|c00ffff33System:|r |c00ffffffYou have equipped + (Name of (Item being manipulated))) + !|r)
                          • Custom script: call DestroyForce( udg_PlayerGroup[3])
                    • Else - Actions
                      • Set Player[3] = (Owner of (Hero manipulating item))
                      • Set PlayerGroup[3] = (Player group(Player[3]))
                      • Game - Display to PlayerGroup[3] the text: |c00ffff33System:|r...
                      • Custom script: call DestroyForce( udg_PlayerGroup[3])
                • Else - Actions
                  • Set Player[3] = (Owner of (Hero manipulating item))
                  • Set PlayerGroup[3] = (Player group(Player[3]))
                  • Game - Display to PlayerGroup[3] the text: |c00ffff33System:|r...
                  • Custom script: call DestroyForce( udg_PlayerGroup[3])
            • Else - Actions
              • Set Player[3] = (Owner of (Hero manipulating item))
              • Set PlayerGroup[3] = (Player group(Player[3]))
              • Game - Display to PlayerGroup[3] the text: |c00ffff33System:|r...
              • Custom script: call DestroyForce( udg_PlayerGroup[3])
        • Else - Actions
          • Do nothing


Trigger:
  • Sword1
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to Hero Inventory
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cfff0ffffRusty Sword|r
        • Then - Actions
          • Set DmgMod[(Player number of (Owner of (Hero manipulating item)))] = (DmgMod[(Player number of (Owner of (Hero manipulating item)))] + 1)
          • Set AgiMod[(Player number of (Owner of (Hero manipulating item)))] = (AgiMod[(Player number of (Owner of (Hero manipulating item)))] + 1)
          • Unit - Set level of Agility Bonus for Hero[(Player number of (Owner of (Hero manipulating item)))] to AgiMod[(Player number of (Owner of (Hero manipulating item)))]
          • Unit - Set level of Item Damage Bonus (Item Stats) for Hero[(Player number of (Owner of (Hero manipulating item)))] to DmgMod[(Player number of (Owner of (Hero manipulating item)))]
          • Unit - Add Melee Weapons to Hero[(Player number of (Owner of (Hero manipulating item)))]
          • Set WeaponChk[(Player number of (Owner of (Hero manipulating item)))] = 1
          • Set InvChk[(Player number of (Owner of (Hero manipulating item)))] = (InvChk[(Player number of (Owner of (Hero manipulating item)))] + 1)
          • Item - Set the custom value of (Item being manipulated) to BindItems[(Player number of (Owner of (Hero manipulating item)))]
          • Multiboard - Set the icon for (Last created multiboard) item in column 3, row ((Player number of (Owner of (Hero manipulating item))) + 1) to ReplaceableTextures\CommandButtons\BTNSteelMelee.blp
        • Else - Actions
          • Do nothing





These triggers were directly from my first SOT release, if you've ever played my map you can see I have a fully working inventory system that you want.

Basically I made variables for each correct check, to make sure inventories can't pass 6, if you wanted more you would have to make a 2nd Hero Inventory. The Hero Inventory is a dummy unit which carries the items for the Hero when equipped to act as if they were acutally equipping a item, then of course you show it on the multiboard...

My other checks were if the hero matches the correct level of the item and if the hero was Undead(Intelligence) it would not allow it to equip a sword.

WeaponChk was to make sure the Hero could not equip 2 swords of course, besides that all the abilities will need to be made, if you want a map with just the inventory system I can supply that.

DmgMod/AgiMod is the integers I used to keep track of well... Damage... Agility :p...

With these variables I could literally just adjust the integer to change the Hero's stats that way I wouldn't need to create multiple abilities for each item.

Add Ability Melee Weapons is added because in my map you cannot attack without a weapon :p

Besides that this is a really good GUI way of accomplishing what you want, and its easy to add onto... Very easy...

Another check was "Bind Items" this check is to make sure players are not trading items after equipping... That way they can't equip than save and duplicate items...

Oh and another variable is Hero which I set all the Hero's to a unit array to keep track of them throughout the entire game...

Of course there is the un-equip trigger too :p

Trigger:
  • Sword1 UN
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to Hero Inventory
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cfff0ffffRusty Sword|r
        • Then - Actions
          • Set DmgMod[(Player number of (Owner of (Hero manipulating item)))] = (DmgMod[(Player number of (Owner of (Hero manipulating item)))] - 1)
          • Set AgiMod[(Player number of (Owner of (Hero manipulating item)))] = (AgiMod[(Player number of (Owner of (Hero manipulating item)))] - 1)
          • Unit - Set level of Agility Bonus for Hero[(Player number of (Owner of (Hero manipulating item)))] to AgiMod[(Player number of (Owner of (Hero manipulating item)))]
          • Unit - Set level of Item Damage Bonus (Item Stats) for Hero[(Player number of (Owner of (Hero manipulating item)))] to DmgMod[(Player number of (Owner of (Hero manipulating item)))]
          • Unit - Remove Melee Weapons from Hero[(Player number of (Owner of (Hero manipulating item)))]
          • Set WeaponChk[(Player number of (Owner of (Hero manipulating item)))] = 0
          • Set InvChk[(Player number of (Owner of (Hero manipulating item)))] = (InvChk[(Player number of (Owner of (Hero manipulating item)))] - 1)
          • Multiboard - Set the icon for (Last created multiboard) item in column 3, row ((Player number of (Owner of (Hero manipulating item))) + 1) to ReplaceableTextures\CommandButtons\BTNSelectHeroOn.blp
        • Else - Actions
          • Do nothing


I should prolly turn this into a tutorial since I don't see any Hero Inventory tutorials on this site...
 

Tom Jones

N/A
Reaction score
437
O I see whats going on

sorry if I didnt make this clear before. Im want the 6 inventory slots to be used for UNEQUIPPED items. You will be able to click EQUIPPABLE items (e.g. helmets, breastplates, staves, boots, etc.) in your inventory to equip them. The thing is, once their equipped, they dissapear from you're inventory and are shown in a custom multiboard that is unique for each player (this is supposed to happen by the way).

Because of this, you cannot simply add item abilities to items to apply their effects to the heroes, I have to trigger them. I thought it would be simple, like an "add ability" thing. I tried using the "Player - Enable/Disable ability for player" to do this, disable ALL item abilities at the beggining and triggering them so that when a hero EQUIPS an item, i use the "Enable ability for player" function to apply the desired item abilties to the hero, as if that item was right there in their inventory...

BUT IT DOESNT WORK :(
so i need another way to apply and remove item abilities to units when the items are equipped and unequipped.

I hope this explained things more clearly :p
Do you want me to believe that you're the only one out there not able to add item abilities to units through triggers? Now I take it that you have a trigger that adds an ability to a unit once it aquires a specific item. Post that trigger here, inside either [noparse]
Code:
or
Trigger:
  • [/wc][/noparse] tags.
    • Here's my guess. You probably also have a trigger for removing the ability from the unit when it drops a specific item. My bet is that you in your aquire trigger removes the item from the unit, and thus triggers your drop trigger, adding and removing the ability to the unit in less than a micro second.
 

eskimojoe_66

Member
Reaction score
2
Wow thx Defiance, i rly owe you :)
anyway the essential point i took away from this is that you can use item abilities (turned into unit abilities) and set their levels when a hero acquires an item to apply the effect.

The other triggers are a nice bonus though, and i will certainly credit you for helping me with this is my map :D

and yes, mathiashl, you understand it now :thup: sorry i cant rly explain it clearly
 
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