I recently ran into a problem with the regular Banshee model and some other models.
It seems to drop items on death even without any triggers and I also set the items in OE to be undroppable.
In addtion the unit seems to exist forever even when removed. So the trigger will constantly try to make new items
into the units position and since there is no unit availabe the new items are generated on the ground.
And to clarify the player units are given to AI so it is intented that pairs are:
1,4 Red, Purple
2,5 Blue, Yellow
3, 6 Teal, Orange
I only have 3 triggers with items
So the items are generated for each unit without any issues. The issue is when a units\undead\Banshee\Banshee or units\creeps\SkeletonOrc\SkeletonOrc dies they drop the items on the ground and somehow they're death location persists and this trigger will always try to create and give items to them even thought they are dead and gone. There are some other models too with the same issue.
I have tried:
1) Changed the OE value to Can Raise, Does not decay
2) Changed the OE value to Can Raise, Does decay
3) Made all items used in the map undroppable in the OE
4) Added "Unit is alive" condition check to the trigger
5) Removed an recreated all regions in the map to make sure there is no copypasted regions
6) Added a variable supplyunit instead of triggering unit, since it caused other issues trying to
create and give units that were already dead
The map has no imported files or models. Only basic wc3 reforged models and icons and so on.
7) No items use the Miscellanous base item class, since it has some very odd interactions.
Then I converted the trigger to locals to see if nullifying the unit would help but still there are random items created on the ground.
At least some of the issues were resolved by doing these steps. I guess 2) Changed the OE value to Can Raise, Does decay did help to some degree, the units no longer drop items on the ground when they die, but there are still random items created on the ground that are try to be given to dead units which blows my mind, cause it literally by passes all the conditions that I have set.
I added an constant item removal which clears the items, but doesn't really solve my original issue.
It seems to drop items on death even without any triggers and I also set the items in OE to be undroppable.
In addtion the unit seems to exist forever even when removed. So the trigger will constantly try to make new items
into the units position and since there is no unit availabe the new items are generated on the ground.
And to clarify the player units are given to AI so it is intented that pairs are:
1,4 Red, Purple
2,5 Blue, Yellow
3, 6 Teal, Orange
I only have 3 triggers with items
-
Player 1 Supply Lines
-
Events
-
Unit - A unit enters Player 1 Spawn <gen>
-
-
Conditions
-
(Owner of (Triggering unit)) Equal to Player 4 (Purple)
-
-
Actions
-
Set VariableSet SupplyUnit = (Triggering unit)
-
For each (Integer SupplyLoopIndex[1]) from 1 to SupplyLinesIndex[1], do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SupplyUnit is alive) Equal to True
-
-
Then - Actions
-
Set VariableSet SupplyRoll[1] = (Random integer number between 1 and 10)
-
Unit - Add Inventory (Hero) to SupplyUnit
-
Hero - Create RandomItem[SupplyRoll[1]] and give it to SupplyUnit
-
-
Else - Actions
-
-
-
-
-
-
Player 2 Supply Lines
-
Events
-
Unit - A unit enters Player 2 Spawn <gen>
-
-
Conditions
-
(Owner of (Triggering unit)) Equal to Player 5 (Yellow)
-
-
Actions
-
Set VariableSet SupplyUnit = (Triggering unit)
-
For each (Integer SupplyLoopIndex[2]) from 1 to SupplyLinesIndex[2], do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SupplyUnit is alive) Equal to True
-
-
Then - Actions
-
Set VariableSet SupplyRoll[2] = (Random integer number between 1 and 10)
-
Unit - Add Inventory (Hero) to SupplyUnit
-
Hero - Create RandomItem[SupplyRoll[2]] and give it to SupplyUnit
-
-
Else - Actions
-
-
-
-
-
-
Player 3 Supply Lines
-
Events
-
Unit - A unit enters Player 3 Spawn <gen>
-
-
Conditions
-
(Owner of (Triggering unit)) Equal to Player 6 (Orange)
-
-
Actions
-
Set VariableSet SupplyUnit = (Triggering unit)
-
For each (Integer SupplyLoopIndex[3]) from 1 to SupplyLinesIndex[3], do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SupplyUnit is alive) Equal to True
-
-
Then - Actions
-
Set VariableSet SupplyRoll[3] = (Random integer number between 1 and 10)
-
Unit - Add Inventory (Hero) to SupplyUnit
-
Hero - Create RandomItem[SupplyRoll[3]] and give it to SupplyUnit
-
-
Else - Actions
-
-
-
-
-
So the items are generated for each unit without any issues. The issue is when a units\undead\Banshee\Banshee or units\creeps\SkeletonOrc\SkeletonOrc dies they drop the items on the ground and somehow they're death location persists and this trigger will always try to create and give items to them even thought they are dead and gone. There are some other models too with the same issue.
I have tried:
1) Changed the OE value to Can Raise, Does not decay
2) Changed the OE value to Can Raise, Does decay
3) Made all items used in the map undroppable in the OE
4) Added "Unit is alive" condition check to the trigger
5) Removed an recreated all regions in the map to make sure there is no copypasted regions
6) Added a variable supplyunit instead of triggering unit, since it caused other issues trying to
create and give units that were already dead
The map has no imported files or models. Only basic wc3 reforged models and icons and so on.
7) No items use the Miscellanous base item class, since it has some very odd interactions.
Then I converted the trigger to locals to see if nullifying the unit would help but still there are random items created on the ground.
-
Player 1 Supply Lines
-
Events
-
Unit - A unit enters Player 1 Spawn <gen>
-
-
Conditions
-
(Owner of (Triggering unit)) Equal to Player 4 (Purple)
-
-
Actions
-
Custom script: local unit u = (GetTriggerUnit())
-
Custom script: local integer i
-
Custom script: call UnitAddAbilityBJ( 'AInv', u)
-
Custom script: set i = GetRandomInt(1, 10)
-
Custom script: call UnitAddItemByIdSwapped( udg_RandomItem[i], u )
-
Custom script: set u = null
-
Custom script: set i = 0
-
-
At least some of the issues were resolved by doing these steps. I guess 2) Changed the OE value to Can Raise, Does decay did help to some degree, the units no longer drop items on the ground when they die, but there are still random items created on the ground that are try to be given to dead units which blows my mind, cause it literally by passes all the conditions that I have set.
I added an constant item removal which clears the items, but doesn't really solve my original issue.
-
Clear Items
-
Events
-
Time - Every 0.25 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
-
((Picked item) is owned) Equal to False
-
-
Then - Actions
-
Item - Remove (Picked item)
-
-
Else - Actions
-
-
-
-
-