- Joined
- May 20, 2008
- Messages
- 433
I have a trigger that allows item stacking of certain items, but when you first pick up that item, you get double its normal charge, then as you pick up more, you get the correct amount. In other words: you pick up a medpak with 3 charges in it. You have no other medpaks in your inventory, and when you pick it up, you have 6 medpaks. The medpak was also spawned just before you pick it up, so it wasn't used before. You pick up another, and you have a total of 9 (from 2 packs)
Heres the trigger (might look familiar to the tutorials):
Man this map is getting many glitches (wonder what others there are).
Heres the trigger (might look familiar to the tutorials):
-
Stacking
-
Events
- Unit - A unit owned by Player 1 (Red) Acquires an item
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Item-type of (Item being manipulated)) Equal to Medpak k
- (Item-type of (Item being manipulated)) Equal to Medpak
-
Conditions
-
Or - Any (Conditions) are true
-
Actions
- Set Item_TempItemCount = 0
- Set Item_TempChargeCount = 0
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Medpak k
-
Then - Actions
- Set Item_TempItemCount = (Item_TempItemCount + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_TempItemCount Equal to 2
-
Then - Actions
- Set Item_TempChargeCount = (Charges remaining in (Item being manipulated))
- Item - Remove (Item being manipulated)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_TempItemCount Equal to 1
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-type of (Item being manipulated)) Equal to Medpak k
-
Then - Actions
- Set Item_TempChargeCount = (Charges remaining in (Item being manipulated))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
- Hero - Create Medpak k and give it to (Hero manipulating item)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item - Set charges remaining in (Item carried by (Hero manipulating item) of type Medpak k) to ((Charges remaining in (Item carried by (Hero manipulating item) of type Medpak k)) + Item_TempChargeCount)
-
Events
Man this map is getting many glitches (wonder what others there are).