- Joined
- Aug 9, 2015
- Messages
- 18
Phew, I'm dealing with a tough issue atm. So far I managed to tackle all my triggering dead ends myself but this one is really giving me a hard time.
So there is an item called meat. When meat is created it gets assigned a custom value and every second this custom value is reduced by 1. Once it reaches zero, the meat disappears.
I have units with a 1 slot unit inventory that can pick this item up, also ships with a 6 slot hero inventory, that can do the same. Ships have a hero inventory, since they hunt big fish on the ocean and just making the meat drop on open water doesn't really work so it has to be added to the killing unit directly which apparently only works with hero inventories *sigh*
While meat is in a units inventory (either regular troops or ships) it won't be detected by my trigger that causes the custom value subtraction / removal of items with custom value = 0
How the fudge do I make my item loose custom value / get removed while being carried?
If you guys can't help me out at least I got that much out of the experience xD
So there is an item called meat. When meat is created it gets assigned a custom value and every second this custom value is reduced by 1. Once it reaches zero, the meat disappears.
I have units with a 1 slot unit inventory that can pick this item up, also ships with a 6 slot hero inventory, that can do the same. Ships have a hero inventory, since they hunt big fish on the ocean and just making the meat drop on open water doesn't really work so it has to be added to the killing unit directly which apparently only works with hero inventories *sigh*
While meat is in a units inventory (either regular troops or ships) it won't be detected by my trigger that causes the custom value subtraction / removal of items with custom value = 0
How the fudge do I make my item loose custom value / get removed while being carried?
-
Item decay time
-
Events
- Unit - A unit Dies
-
Conditions
- (Owner of (Triggering unit)) Equal to Neutral Passive
-
Actions
- Set Temp_Point = (Position of (Triggering unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Unit-type of (Triggering unit)) Equal to Stag
- (Unit-type of (Triggering unit)) Equal to Seal
- (Unit-type of (Triggering unit)) Equal to Pig
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Item - Create Meat at Temp_Point
- Item - Set the custom value of (Last created item) to 60
- Item - Create Meat at Temp_Point
- Item - Set the custom value of (Last created item) to 60
- Item - Create Meat at Temp_Point
- Item - Set the custom value of (Last created item) to 60
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
- (Unit-type of (Triggering unit)) Equal to Northern Bullhead
- (Unit-type of (Killing unit)) Equal to Whaling Ship
-
Conditions
-
And - All (Conditions) are true
-
Then - Actions
- Hero - Create Meat and give it to (Killing unit)
- Item - Set the custom value of (Last created item) to 60
-
Else - Actions
- Item - Create Meat at Temp_Point
- Item - Set the custom value of (Last created item) to 60
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Custom script: call RemoveLocation (udg_Temp_Point)
-
Events
-
Item decay time 2
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
-
Item - Pick every item in (Playable map area) and do (Actions)
-
Loop - Actions
- Item - Set the custom value of (Picked item) to ((Custom value of (Picked item)) - 1)
-
Loop - Actions
-
Item - Pick every item in (Playable map area) and do (Actions)
-
Events
-
Item decay time 3
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
-
Item - Pick every item in (Playable map area) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Picked item)) Equal to 0
-
Then - Actions
- Item - Remove (Picked item)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Item - Pick every item in (Playable map area) and do (Actions)
-
Events
If you guys can't help me out at least I got that much out of the experience xD