• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Item Ownership

Status
Not open for further replies.
Level 23
Joined
Oct 20, 2012
Messages
3,075
Hey guys, Since in my project, all heroes share the same shops to buy their items and its mostly an FFA map, to prevent stealing items and other stuff, I'm aiming for an item ownership similar in DOTA where when your pick up an item that isn't yours, all of its effects are nulled and its icon will be replaced by DISBTNs. How should I start in making such a system?

EDIT:
Thought of a solution but its pretty time consuming (create disabled versions of each and every one of my items then just replace them once an enemy picks em up). Is there a more efficient/time consuming solution for this?

BTW, Is it also possible to prevent enemy heroes from destroying another player's item but can still allow the owner to destroy that item?
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
Another way, force-drop an item if the unit isn't the item owner. Just save the player number upon first acquisition and do a comparison in an item pickup trigger. You can use a issue order target object event and check if the orderid is equal to attack. Then check player number and pause-stop-unpause if not item owner.

I personally found DotA's method too time-consuming and not really worth it.

Hope I helped :)
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
I would try something like this
  • test
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set unit = (Hero manipulating item)
      • Set id = (Player number of (Owner of unit))
      • Set item = (Item being manipulated)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Custom value of item) Equal to 0
              • (Custom value of item) Equal to id
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of item) Equal to 0
            • Then - Actions
              • Item - Set the custom value of item to id
            • Else - Actions
        • Else - Actions
          • Hero - Drop item from unit
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
I personally found DotA's method too time-consuming and not really worth it.
yes, it doesn't need to create a disabled version of each item,

Well, its good to hear that I don't have to do all that work.

Anyway, I'll try your solutions as soon as I can. The hard drive containing my maps is kinda going nuts so I think I can't really open them.

the only downside is that you can't pick that item at all.

Hopefully, when I try your system. I can get what you mean by this. x3

Thanks for now. I'll be reviving this thread if I have any more problems with the topic. +rep to you three.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Dota has:
1- The actual item

2- The PowerUP version of the item: This allow you to pick the item even if your inventory is full.

3- The Disabled item: For items like Broken Tranquil Boots, Disabled Heart of Terrasque, Disabled Kelen's Dagger, etc. The ones which looses their effects when you get hit or something like that.

4- The Undropable item: Some Aghanim's scepters, and some useable items like Arcane Boots, Refresher ORbs, and most of these that goes into cooldonw. It's made that way to prevent you using DAGON, and transfer the item to someone else to use DAGON too.

5- The Shared item: Like Ring of Regeneration, wich can be yours, but can also be holded by another player and still gain it's bonuses. Can't use them on recipes though.

6- The Courier items: Gem, Radiance, Cuirass, and other items with AoE effect are disabled for Couriers, or have reduced effects

Also each hero has it's own Aghanim's scepter. So, yeah. It's really time consuming.

Maybe these are not just different item types; i think that the not dropable items when they're on cooldown it's done with triggers and timers, instead of item replacement.
 
Status
Not open for further replies.
Top