- Joined
- Sep 24, 2007
- Messages
- 300
So, I made a rank system, that give 1 item per 4 kills/unit.
SO basicaly, unit kills 4 enemies, item1, 8 enemies item2 etc.
Triggers:
Adding custom value:
Now to the problem: After the unit with items get's killed, it's items should be destroyed/removed/not dropped. It basicaly works. All units have human inventory ability, so I disabled dropping items (in object editor) all items also have dropping disabled. So far so good-unit get's killed, no items on the ground.
Now the bug: AFter some time (haven't discovered yet how much, could be fixed, could be random) unit's items appear at the point it died! I tried several times, without clicking anything, but items appeared after some time. Wtf? I even tried to remove items with actions, when unit dies-no help.
edit: Item appearance after death (3 different units): gametime
3:16 death
4:46 appearance
6:10 death
7:26 appearance
7:52 death
instant appearance
The only other trigger that manipulates with rank items is this one, but shouldn't have any effect.
SO basicaly, unit kills 4 enemies, item1, 8 enemies item2 etc.
Triggers:
Adding custom value:
-
Unit custom value
-
Events
- Unit - A unit enters (Playable map area)
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Entering unit)) Not equal to Stuka
- (Unit-type of (Entering unit)) Not equal to Bomber
- (Unit-type of (Entering unit)) Not equal to RocketDummy
- (Unit-type of (Entering unit)) Not equal to Advanced Worker lv3
- (Unit-type of (Entering unit)) Not equal to Improved Worker
- (Unit-type of (Entering unit)) Not equal to Worker
- (Unit-type of (Entering unit)) Not equal to Commander
- ((Entering unit) is A structure) Not equal to True
-
Then - Actions
- Set RankingUnitArray = (RankingUnitArray + 1)
- Unit - Set the custom value of (Entering unit) to RankingUnitArray
- Trigger - Add to Animations <gen> the event (Unit - (Entering unit) Takes damage)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Ranking system
-
Events
- Unit - A unit Dies
-
Conditions
- (Owner of (Dying unit)) Not equal to (Owner of (Killing unit))
- ((Killing unit) is A structure) Not equal to True
- (Unit-type of (Killing unit)) Not equal to Goblin Land Mine
- (Unit-type of (Killing unit)) Not equal to Bomber
- (Unit-type of (Killing unit)) Not equal to Stuka
- (Unit-type of (Killing unit)) Not equal to RocketDummy
- (Unit-type of (Killing unit)) Not equal to Commander
-
Actions
- Item - Remove (Item carried by (Dying unit) in slot 1)
- Item - Remove (Item carried by (Dying unit) in slot 2)
- Item - Remove (Item carried by (Dying unit) in slot 3)
- Item - Remove (Item carried by (Dying unit) in slot 4)
- Item - Remove (Item carried by (Dying unit) in slot 5)
- Item - Remove (Item carried by (Dying unit) in slot 6)
- Set KillsNumber[(Custom value of (Killing unit))] = (KillsNumber[(Custom value of (Killing unit))] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- KillsNumber[(Custom value of (Killing unit))] Equal to 4
-
Then - Actions
- Item - Create Star of Honor (Y) at (Position of (Killing unit))
- Hero - Give (Last created item) to (Killing unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- KillsNumber[(Custom value of (Killing unit))] Equal to 8
-
Then - Actions
- Item - Create Star of Honor (V) at (Position of (Killing unit))
- Hero - Give (Last created item) to (Killing unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- KillsNumber[(Custom value of (Killing unit))] Equal to 12
-
Then - Actions
- Item - Create Star of Honor (B) at (Position of (Killing unit))
- Hero - Give (Last created item) to (Killing unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- KillsNumber[(Custom value of (Killing unit))] Equal to 16
-
Then - Actions
- Item - Create Star of Honor (G) at (Position of (Killing unit))
- Hero - Give (Last created item) to (Killing unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- KillsNumber[(Custom value of (Killing unit))] Equal to 20
-
Then - Actions
- Item - Create Star of Honor (R) at (Position of (Killing unit))
- Hero - Give (Last created item) to (Killing unit)
- 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)
-
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)
-
If - Conditions
-
Events
Now to the problem: After the unit with items get's killed, it's items should be destroyed/removed/not dropped. It basicaly works. All units have human inventory ability, so I disabled dropping items (in object editor) all items also have dropping disabled. So far so good-unit get's killed, no items on the ground.
Now the bug: AFter some time (haven't discovered yet how much, could be fixed, could be random) unit's items appear at the point it died! I tried several times, without clicking anything, but items appeared after some time. Wtf? I even tried to remove items with actions, when unit dies-no help.
edit: Item appearance after death (3 different units): gametime
3:16 death
4:46 appearance
6:10 death
7:26 appearance
7:52 death
instant appearance
The only other trigger that manipulates with rank items is this one, but shouldn't have any effect.
-
First Aid and ranks
-
Events
- Unit - A unit Acquires an item
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-type of (Item being manipulated)) Equal to Health Pack
-
Then - Actions
- Advanced - Heal (Triggering unit) for 300.00 hitpoints
- Item - Remove (Item being manipulated)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-type of (Item being manipulated)) Equal to Star of Honor (Y)
-
Then - Actions
- Unit - Add Yellow Powerup to (Triggering unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-type of (Item being manipulated)) Equal to Star of Honor (V)
-
Then - Actions
- Unit - Add Violet Powerup to (Triggering unit)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-type of (Item being manipulated)) Equal to Star of Honor (B)
-
Then - Actions
- Unit - Add Blue Powerup to (Triggering unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-type of (Item being manipulated)) Equal to Star of Honor (G)
-
Then - Actions
- Unit - Add Green Powerup to (Triggering unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-type of (Item being manipulated)) Equal to Star of Honor (R)
-
Then - Actions
- Unit - Add Heal to (Triggering unit)
- 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)
-
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)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events