• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Disable transfer items for first x seconds.

Status
Not open for further replies.
Level 18
Joined
Jun 2, 2009
Messages
1,233
Hello. I want to create system just like this.
You cannot give your items to your friends for first 30 seconds.
I just want to disable this feature for first 30 seconds..

Details: In my moba map you are selecting your hero and purchasing items. First 30 seconds players are not able to leave base. They are simply buying items for themselves and waits for game start for 30 seconds.

Why do i need system like this?

Players are able to use -repick command and can select another heroes.

Now i am working on new version and disabled these

1-) When the player repicks, i am picking every item and if Custom Value of Picked Item equal to Player Number of Triggering Unit that means this player dropped item on the ground.
I am simply removing any item that player drops on ground. Done

2-) When the player repicks, i am selecting it's personal stash and removing any items. Done

3-) What if i will purchase item, give it to another player, repick my character and get jungle role? (when player picks jungler role, player get 1 special item)
There are few items you can trade. They cannot sell it but they can use. + player can get back items from friend.
That means if you pick hero, buy these items, give these items to one of your friends, then repick and pick jungler role = you will get jungle item AND YOU CAN GET BACK YOUR ITEMS FROM YOUR FRIEND


In my map you can trade these items with your friends. But i want to prevent this for first x seconds.

  • Ilk30SaniyeDropEngelle
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Not equal to Essence of Life
          • (Item-type of (Item being manipulated)) Not equal to Ring of Regeneration
          • (Item-type of (Item being manipulated)) Not equal to Ring of Regeneration..
          • (Item-type of (Item being manipulated)) Not equal to Experience Pouch
          • (Item-type of (Item being manipulated)) Not equal to Experience Pouch..
          • (Item-type of (Item being manipulated)) Not equal to Gem of True Seeing
          • (Item-type of (Item being manipulated)) Not equal to Gem of True Seeing..
          • (Item-type of (Item being manipulated)) Not equal to Gidbinn
          • (Item-type of (Item being manipulated)) Not equal to Izual's Map
          • (Item-type of (Item being manipulated)) Not equal to Izual's Report I
          • (Item-type of (Item being manipulated)) Not equal to Izual's Report II
    • 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 (Player number of (Owner of (Triggering unit)))
              • (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
          • Set TempLoc = (Position of (Item being manipulated))
          • Hero - Drop (Item being manipulated) from (Triggering unit)
And you can suggest alternative solutions if you want. Probably solution stands before our eyes but i am tired and i don't know yet. I have created boolean NoTradeFirst30Seconds and probably i will put this somewhere and make it drop any item given to another players (and dropped items removed) but no more i can think for now..
 
Last edited:
Level 30
Joined
Aug 29, 2012
Messages
1,383
I'd do it like this:

  • Drop
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • Boolean_NoTrade Equal to True
    • Actions
      • Hero - Give (Item being manipulated) to (Triggering unit)
      • Game - Display to (Player group((Owner of (Triggering unit)))) for 5.00 seconds the text: You cannot give you...
  • Enable Trade
    • Events
      • Time - Elapsed game time is 30.00 seconds
    • Conditions
    • Actions
      • Set Boolean_NoTrade = False
One thing about your condition: you're checking if the item is type 1 AND type 2 AND type 3 AND type 4... That will always be false, you should use OR instead of AND
 
Level 18
Joined
Jun 2, 2009
Messages
1,233
@Chaosium When i try to drop item within 30 seconds, game crashes. Now i have to go sleep now because i am very tired. I will check this one when i woke.


  • Events
    • Time - Elapsed game time is 1.00 seconds
  • Conditions
  • Actions
    • Set NoTradeFirst30 = True
  • Events
    • Unit - A unit Loses an item
  • Conditions
    • NoTradeFirst30 Equal to True
  • Actions
    • Hero - Give (Item being manipulated) to (Triggering unit)

Update: Simply putting 0.10 seconds wait before give the item again solved the issue but i haven't tested it with my friends yet. I will try to give these items to them. I will tell you what happens when i try.
Update 2: Still i am able to give any items to my friend (check the items list at the top)
 
Last edited:
Level 30
Joined
Aug 29, 2012
Messages
1,383
Okay, I managed to get it done with another way, and on the plus side, it doesn't crash

With this system you can drop your items, but nobody else can pick them, just using the "item ownership" feature. If you want to disable that after 30 seconds, you'll need to remove ownership from these items
 

Attachments

  • Test.w3x
    17.7 KB · Views: 5
Status
Not open for further replies.
Top