This may be helpful for someone in the future. I'm making a map, and part of the gameplay involves killing enemy or neutral units for resources.
While you can set the amount of resources a unit gives directly in its Data fields, this only works on enemy units. If you kill an enemy unit that gives resources, you gain the resources. If you kill a non-enemy unit that gives resources, you do not get the resources.
Fortunately, there's a simple way you can fix this: Use a trigger that sets the neutral player to be your enemy. After that, you'll be able to gain resources by killing neutral units that yield resources.
Unfortunately, that's the best I've got. Other than that, you'd have to make a more involved trigger that gives you the resources when you kill the neutral unit.
For my purposes, the simpler solution will suffice. The player who will be after the neutral units should be considering them an enemy anyway. Though I'd kind of like them to not automatically aggress against the neutral units. But that's another topic altogether.
EDIT: After some testing, I found that only the enemy unit has to see you as an enemy in order for you to gain resources. You can set the alliance one-way and this will work. You can see the unit as neutral and it see you as an enemy, and you gain the resources. If you see it as an enemy, but it does not see you as an enemy, you do not gain the resources.
Very interesting find. I would suggest you edit the wiki to indicate this, so people looking at the reference for those fields can know this information/caveat to it.
For triggers you could check that the killing unit and triggering unit are not enemies. For the action you'd use modify player property, set the amount to unit property, and choose the property bounty (minerals) or bounty (vespene). Or do an action for both. Simpler that what you seem to be doing xP
This may be helpful for someone in the future. I'm making a map, and part of the gameplay involves killing enemy or neutral units for resources.
While you can set the amount of resources a unit gives directly in its Data fields, this only works on enemy units. If you kill an enemy unit that gives resources, you gain the resources. If you kill a non-enemy unit that gives resources, you do not get the resources.
Fortunately, there's a simple way you can fix this: Use a trigger that sets the neutral player to be your enemy. After that, you'll be able to gain resources by killing neutral units that yield resources.
Unfortunately, that's the best I've got. Other than that, you'd have to make a more involved trigger that gives you the resources when you kill the neutral unit.
For my purposes, the simpler solution will suffice. The player who will be after the neutral units should be considering them an enemy anyway. Though I'd kind of like them to not automatically aggress against the neutral units. But that's another topic altogether.
EDIT: After some testing, I found that only the enemy unit has to see you as an enemy in order for you to gain resources. You can set the alliance one-way and this will work. You can see the unit as neutral and it see you as an enemy, and you gain the resources. If you see it as an enemy, but it does not see you as an enemy, you do not gain the resources.
Very interesting find. I would suggest you edit the wiki to indicate this, so people looking at the reference for those fields can know this information/caveat to it.
Good idea. I have no option to edit it, so I'll just leave a comment on the page.
For triggers you could check that the killing unit and triggering unit are not enemies. For the action you'd use modify player property, set the amount to unit property, and choose the property bounty (minerals) or bounty (vespene). Or do an action for both. Simpler that what you seem to be doing xP
Anyone ever tested the Loot field?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg