• 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.

[Trigger] Small system

Status
Not open for further replies.
Level 9
Joined
Jun 20, 2008
Messages
476
I need a little bag system

every player has 1 worker if the player click on their worker i want them to have 6 extra slots and when they click it again it turns back to normal

so it will look like this

Worker>6 empty spots>item taken (potion)>worker>normal slots>worker>potion in the extra slot
 
I need a little bag system

every player has 1 worker if the player click on their worker i want them to have 6 extra slots and when they click it again it turns back to normal

so it will look like this

Worker>6 empty spots>item taken (potion)>worker>normal slots>worker>potion in the extra slot

maybe explain more clearly? I think I get it but I'm kinda confused..
 
okay.. just save each item into a variable specific for that player when you click the unit (there's only one worker per player right?) then remove the items then create the items that are saved for the next bag.. and vice versa.

I guess this will work...
  • Event
    • Unit - Unit is clicked
  • Actions
    • IF
      • Conditions
        • Bag equal to 1
    • Then
      • For Each Integer A from 1 to 6 do actions
        • Actions
          • Set ItemBag1[IntegerA] to ItemTypeofItemCarriedByUnit in Slot(IntegerA)
          • Item - Remove ItemCarriedByUnit in Slot(IntegerA)
          • Item - Create ItemBag2[IntegerA] and give it to unit
      • Set Bag = 2
    • Else
      • For Each Integer A from 1 to 6 do actions
        • Actions
          • Set ItemBag2[IntegerA] to ItemTypeofItemCarriedByUnit in Slot(IntegerA)
          • Item - Remove ItemCarriedByUnit in Slot(IntegerA)
          • Item - Create ItemBag1[IntegerA] and give it to unit
      • Set Bag = 1
ItemBag1 and 2 should be item types....

EDIT: I forgot to set the bag number... fixed it..
 
Last edited:
But that will remove cooldowns etc :p

oh... well yeah... well if he needs the cooldowns he can just change the unit.. he would have 2 workers from the start where 1 is hidden... then just hide the clicked unit and show the other one and transport it to the clicked unit's position.....
 
shouldnt i set the variable to other number ?

no, because there are 2 item type arrays.. ItemBag1[] and ItemBag2[].... or if you're talking about the integerA, its a loop so every run of the loop will change the value of integerA... and I edited the trigger I posted because I realized that I haven't set the value of Bag...
 
Status
Not open for further replies.
Top