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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top