removing an item in heroes inventory

Dest

New Member
Reaction score
26
you get points i would have to post all of them they are probably more work then i should've done. and could have been done with variables. and yeah it resets itself when i have the strength i will learn how to incorporate a timer with it.

It's very easy to add a timer - you're going to have set some variables, some triggers and that's it.
 

Exide

I am amazingly focused right now!
Reaction score
448
This is how I would've done it:

Trigger:
  • Acquire Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Flag Equal to Flag
    • Actions
      • Countdown Timer - Start ItemRemoveTimer as a One-shot timer that will expire in 30.00 seconds
      • Set Flag_Horde_Remove = (Item being manipulated)
      • Set FlagCourier = (Triggering unit)


Trigger:
  • Remove Item
    • Events
      • Time - ItemRemoveTimer expires
    • Conditions
      • (FlagCourier has Flag_Horde_Remove) Equal to True
    • Actions
      • Item - Remove Flag_Horde_Remove



EDIT: Even better is to move the item to where it was spawned.
EDIT #2: At Cake: There are three variables.
 

Dest

New Member
Reaction score
26
This is how I would've done it:

Trigger:
  • Acquire Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Flag Equal to Flag
    • Actions
      • Countdown Timer - Start ItemRemoveTimer as a One-shot timer that will expire in 30.00 seconds
      • Set Flag_Horde_Remove = (Item being manipulated)
      • Set FlagCourier = (Triggering unit)


Trigger:
  • Remove Item
    • Events
      • Time - ItemRemoveTimer expires
    • Conditions
      • (FlagCourier has Flag_Horde_Remove) Equal to True
    • Actions
      • Item - Remove Flag_Horde_Remove

Only one variable? I thought you need 2? (for timer)
 

BacTyrael

New Member
Reaction score
1
Trigger:
  • Alliance flag pickup red
    • Events
      • Unit - A unit comes within 200.00 of The Flag 0023 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) is in Player Group - Player 1 (Red)) Equal to True
    • Actions
      • Unit - Move The Flag 0023 <gen> instantly to (Center of Flag tele Horde <gen>)
      • Item - Create Orc Flag at (Center of (Playable map area))
      • Hero - Give (Last created item) to (Triggering unit)
      • Game - Display to (All players) for 4.00 seconds the text: The alliance has pi...

Picking up for player 1
Trigger:
  • Alliance flag capture red
    • Events
      • Unit - A unit comes within 200.00 of The Flag 0022 <gen>
    • Conditions
      • ((Triggering unit) has an item of type Orc Flag) Equal to True
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) is in Player Group - Player 1 (Red)) Equal to True
    • Actions
      • Item - Remove (Item carried by (Triggering unit) of type Orc Flag)
      • Set AllCapture = (AllCapture + 1.00)
      • Unit - Move The Flag 0023 <gen> instantly to (Center of Flag Capture Horde <gen>)
      • Game - Display to (All players) for 4.00 seconds the text: The alliance has ca...
      • Sound - Play VictorySound

flag capture for player 1
Trigger:
  • Alliance flag recapture red
    • Events
      • Unit - A unit enters Flag Capture Allaince <gen>
    • Conditions
      • ((Triggering unit) has an item of type Human Flag) Equal to True
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) is in Player Group - Player 1 (Red)) Equal to True
    • Actions
      • Item - Remove (Item carried by (Triggering unit) of type Human Flag)
      • Unit - Move The Flag 0022 <gen> instantly to (Center of Flag Capture Allaince <gen>)
      • Game - Display to (All players) for 4.00 seconds the text: The alliance has re...
      • Sound - Play VictorySound
flag recapture for player 1

that's how my system works. you can only score when your flags at base. and both sides flags can be up at a time. which is why turtling a flag can be bad.
 

Exide

I am amazingly focused right now!
Reaction score
448
No, it's the same timer. It just resets the timer each time a unit picks up the flag.
 

Dest

New Member
Reaction score
26
This is how I would've done it:

Trigger:
  • Acquire Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Flag Equal to Flag
    • Actions
      • Countdown Timer - Start ItemRemoveTimer as a One-shot timer that will expire in 30.00 seconds
      • Set Flag_Horde_Remove = (Item being manipulated)
      • Set FlagCourier = (Triggering unit)


Trigger:
  • Remove Item
    • Events
      • Time - ItemRemoveTimer expires
    • Conditions
      • (FlagCourier has Flag_Horde_Remove) Equal to True
    • Actions
      • Item - Remove Flag_Horde_Remove



EDIT: Even better is to move the item to where it was spawned.
EDIT #2: At Cake: There are three variables.

Actually I could be wrong, but the countdown timer leaks, I think. You need to put this custom script and destroy the timer:
JASS:
Custom script: call DestroyTimer( udg_ItemRemoveTimer )
 

BacTyrael

New Member
Reaction score
1
No, it's the same timer. It just resets the timer each time a unit picks up the flag.

alright this means i can change it so that when the flag drops it returns to base. or find a way to keep the timer from resetting because then people can just juggle and turtle all game.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top