Item Muting help?

Frizz.Meister

New Member
Reaction score
0
I am having problems on my map with item stealing. I have been trying to come up with an item muting system similar to dotas. However i im finding it really hard to make and very time consuming. I have searched these forums but found no tutorial or anything.

Any help?
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Maybe something like when a unit "Acquires and item", set the item into a variable and link the variable to the triggering player.
Then when a unit picks that item up, if it's not that heroes variable/item, it gets muted.

Just an idea, I don't know how it will work.
 

Grymlax

Probably not around
Reaction score
138
this would be the simpliest solution, which works the way wolfie suggested.

Trigger:
  • gets item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Custom value of (Item being manipulated)) Equal to 0
    • Actions
      • 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 being manipulated)) Equal to 0
              • (Custom value of (Item being manipulated)) Equal to (Player number of (Owner of (Triggering unit)))
        • Then - Actions
          • Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
        • Else - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)


it simply drops the item if the one who picks it up isn't the owner of the item
 

WolfieeifloW

WEHZ Helper
Reaction score
372
And of course in the main Conditions you'd have to add the items that can be shared, so they don't get dropped.
Just do something like:
Code:
Conditions
    ((Item-Type being manipulated) is <SharableItem>) Equal to False
 

Frizz.Meister

New Member
Reaction score
0
I took a look at that map and although the system may work it is incredibly complex and trigger heavy. I've been fiiddling around with custom values and im sure there must be an easier method.

As for the drop on pick up trigger. Works well but i can see it confusing people alot.

Edit: Reviewed the map again and it makes sense but some explaination on how a muted item cant be sold (so i can make my own custom muted items) would help alot.
 

Nexor

...
Reaction score
74
Here's my Item - Player restriction system:

Trigger:
  • Item Recipes
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) is A structure) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Item being manipulated)) Equal to 0
        • Then - Actions
          • Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Item being manipulated)) Not equal to (Player number of (Owner of (Triggering unit)))
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
          • Cinematic - Clear the screen of text messages for (All players matching ((Matching player) Equal to (Owner of (Triggering unit))))
          • Game - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the text: |cffffcc00This item...
        • Else - Actions
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
sorry for the late reply.

As for the drop on pick up trigger. Works well but i can see it confusing people alot.

you mean those debug message ?

-----------
Now, here is the explanation:

we definitely need the variable PlayerGoldState integer with arrray 12.
(or array 1, but you have to init them)
Trigger:
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Set PlayerGoldState[(Integer A)] = 0


This variable will store the gold amount of players, so, when you add gold, set gold,.. (using Player - Set Property) you must also set this variable. like this:
Trigger:
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Player - Set (Player((Integer A))) Current gold to 5000
      • Set PlayerGoldState[(Integer A)] = 5000

I set current gold of 12 players to 5000 and also PlayerGoldState[1 -> 12] to 5000
---
First, we work with items which are sold in merchant.
You see this trigger:
Trigger:
  • IOR Get Item Cost
    • Events
    • Conditions
    • Actions
      • Set ItemCost = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempItemType Equal to Claws of Attack
        • Then - Actions
          • Set ItemCost = 800
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempItemType Equal to Ring of Protection
        • Then - Actions
          • Set ItemCost = 350
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempItemType Equal to Boots of Speed
        • Then - Actions
          • Set ItemCost = 150
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempItemType Equal to Healing Salve
        • Then - Actions
          • Set ItemCost = 100
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempItemType Equal to Clarity Potion
        • Then - Actions
          • Set ItemCost = 160
        • Else - Actions

before you run this trigger, you should set TempItemType to the type of item you need to check. The cost of item will be set to variable ItemCost
Code:
Set TempItemType = (Item-type of TempItem)
Trigger - Run IOR Get Item Cost <gen> (ignoring conditions)

When an item is sold, check the variable PlayerGoldState with the current gold amount of player 1 -> 12. If PlayerGoldState - current gold amount == ItemCost -> the player who lost the gold is the buyer. -> set custom value of the sold item to the buyer's player number.

Trigger:
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Set TempPlayer = (Player((Integer A)))
      • Set TempInt = (TempPlayer Current gold)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (PlayerGoldState[(Integer A)] - TempInt) Equal to ItemCost
        • Then - Actions
          • -------- we have found the buyer, set custom value of the item to his/her player number --------
          • Item - Set the custom value of TempItem to (Integer A)
          • Set PlayerGoldState[(Integer A)] = (TempPlayer Current gold)
        • Else - Actions

---
ok, now, I will assume items of Purchasable class are sharable and items of Miscellaneous class are muted items.
- with unsharable items, you will have to create two versions, a non-muted version and a muted version.
- with sharable items, of course you don't have to make a muted version.

the trigger IOR Get Muted Version and IOR Get non Muted Version just like IOR Get Item Cost, you set the variable TempItemType to the type of the item you want to get its muted/non muted version, and run the trigger, you will get the item type in TempItemVersion variable.

in the trigger: IOR Acquire Items
when a unit acquires an item, check its class, Purchasable -> it's a sharable item -> stop the trigger ( Skip remaining actions
)
if it is an unsharable item, continue checking:

if its class is... Unknown ( Unknowns is Miscellaneous, I don't know why I have to check Unknown for Miscellaneous :| ) -> it is a muted item -> check the owner. If the picker (unit who picked up the item - currently is TempUnit) is the owner, remove and add the non-muted version to picker.
if its class is not Unknown -> it is a non-muted item -> check owner, if the picker is not the owner, remove and add the muted version to picker.

---
the trigger IOR Sold Items and Unit Dies Set States are used to set the PlayerGoldState to the gold amount of the player who sells items, gets gold bounty.

-----------
In conclusion
if you want to create your own custom muted item, you have to:
- create two version of your item. a non muted and a muted version. muted version has class of Miscellaneous.
- go to trigger: IOR Get Item Cost to "register" the cost of the item, add:
Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • TempItemType Equal to &lt;your item&gt;
    • Then - Actions
      • Set ItemCost = &lt;cost of the item&gt;
    • Else - Actions

- go to trigger: IOR Get Muted Version to "register" the muted version of the item.
Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • TempItemType Equal to &lt;your item&gt;
    • Then - Actions
      • Set TempItemVersion = &lt;your item&#039;s muted version&gt;
    • Else - Actions

and IOR Get non Muted Version to "register" the non-muted version of the item.
Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • TempItemType Equal to &lt;your item&#039;s muted version&gt;
    • Then - Actions
      • Set TempItemVersion = &lt;your item&gt;
    • Else - Actions


done ! :D

Note: about the "disabled icon" of the item, you would have to import them. For example: I use ReplaceableTextures\CommandButtonsDisabled\DISBTNBootsOfSpeed.blp for muted Boots of Speed -> so I have to import an icon: ReplaceableTextures\CommandButtonsDisabled\DISDISBTNBootsOfSpeed.blp
(sorry, the demo map does not have these icons, I'm a little lazy :rolleyes: )

how a muted item cant be sold

just set the field Stats - Can Be Sold to Merchants to False (in the demo map, I forgot this :p )
---------------------
I re-upload the demo map :)

EDIT: I reupload the demo map, fixed a pretty big bug :p
 

Attachments

  • [Demo] Item Owner Restriction 1.1.w3x
    19.7 KB · Views: 111

Frizz.Meister

New Member
Reaction score
0
Thanks a lot for the in depth explaination. Real big help You should make an official tutorial because im sure this would help a whole lot of people. Thanks again.
 
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

      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