- Joined
- Oct 12, 2004
- Messages
- 109
Hey guys i was creating an equipment system in gui and ran into a problem i can't seem to find out whats wrong. It works perfectly except when you use an item that you have just used again it repeats the same process. Heres the triggers and you will see what im talking about.
This is the part of the trigger that doesn't work:
k trigger
UPADTE:
I added the map for everyone to look at:
This is the part of the trigger that doesn't work:
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TempItem Equal to kItem_Old[TempInteger]
-
Then - Actions
- Skip remaining actions
- Else - Actions
-
If - Conditions
-
Events
- Unit - A unit Uses an item
-
Conditions
- (Triggering unit) Equal to hero
-
Actions
- Set TempItem = (Item being manipulated)
- Set TempInteger = (Player number of (Owner of TempItem))
- Set kUnit[TempInteger] = (Hero manipulating item)
-
-------------THIS IS THE PART THAT DOESN'T WORK---------
- -------- Check if item is already in spot --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TempItem Equal to kItem_Old[TempInteger]
-
Then - Actions
- Skip remaining actions
-
Else - Actions
- kItem_Old[TempInteger] = TempItem
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Item-type of TempItem) Equal to k A
- (Item-type of TempItem) Equal to k B
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- kOccupied[TempInteger] Equal to False
-
Then - Actions
- Set kItem_New[TempInteger] = TempItem
- Set kItem_Old[TempInteger] = kItem_New[TempInteger]
- Set kOccupied[TempInteger] = True
- Trigger - Run kEquip <gen> (checking conditions)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- kOccupied[TempInteger] Equal to True
-
Then - Actions
- Set kItem_New[TempInteger] = TempItem
- Item - Create k[kNumber[TempInteger]] at (Center of (Playable map area))
- Hero - Give (Last created item) to kUnit[TempInteger]
- Unit - Remove Damage_Effect from kUnit[TempInteger]
- Unit - Remove kAbility_Old[TempInteger] from kUnit[TempInteger]
- Set kItem_Old[TempInteger] = kItem_New[TempInteger]
- Trigger - Run kEquip <gen> (checking conditions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If - Conditions
k trigger
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- kItem_New[TempInteger] Equal to (Item carried by hero of type k A)
-
Then - Actions
- Set kNumber[TempInteger] = 1
- Item - Remove kItem_New[TempInteger]
- -------- Give Real Item --------
- Unit - Add m42 to kUnit[TempInteger]
- Set kAbility_Old[TempInteger] = m42
- -------- -----------------------------------------------------EFFECTS----------------------------------------------------- --------
- Unit - Add Item Damage Bonus (+5) to hero
- Set Damage_Effect = Item Damage Bonus (+5)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- kItem_New[TempInteger] Equal to (Item carried by hero of type k B)
-
Then - Actions
- Set kNumber[TempInteger] = 2
- Item - Remove kItem_New[TempInteger]
- -------- Give Real Item --------
- Unit - Add m43 to kUnit[TempInteger]
- Set kAbility_Old[TempInteger] = m43
- -------- -----------------------------------------------------EFFECTS----------------------------------------------------- --------
- Unit - Add Item Damage Bonus (+20) to kUnit[TempInteger]
- Set Damage_Effect = Item Damage Bonus (+20)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
UPADTE:
I added the map for everyone to look at:
Attachments
Last edited: