Hey all. Im making my first map, and im having a little trouble getting this trigger to work. The conditions under the first conditions section seam to work just fine. That part prevents the player from gaining points from killing those units, or from killing themselves.
The actions however, don't work as I think they should. I want the player to gain 400 points for killing a wraith, scout, goliath, or vulture, but instead it only gives 100 points. As you can see, the 400 points variable change is under "Then do action". Why is it passing to the "Else do action"?
Theres actually an easier(?) way to do this.
There is a function for units called Unit Set Custom value/ Unit Get Custom Value.
Im assuming here that the units you speak of are spawned and not built.
Upon spawning your units, you could set this custom value, and then read it upon their death. This way you shouldn't even need if/else conditions. Store all your units and custom values into two arrays for easy access.
This is just the pseudocode, I use galaxy to script so I'm not familiar with how it would be done in GUI, but conceptually this is a much simpler way to implement what you are attempting to do.
Awesome, it works. Im wondering why my first conditions work, but not the conditions in the actions part. They are nearly identical. Theres something that im missing here lol.
Im a newbie to map making, and galaxy code is way over my head at this point lol, but I think you are right. Il look into this concept. This is how I originally wanted to do things, but couldn't figure it out :P
Have no fear :P The idea above can be done in GUI as easily as it could be done in Galaxy. You just need to set up 3 triggers and have global arrays to store the information.
Where * are your indexes. Good luck with the triggering! It's quite a steep learning curve, but once you get it, its a plateau. The main downfall is you would still need to check the unit type if the unit was not created through a trigger.
Hey all. Im making my first map, and im having a little trouble getting this trigger to work. The conditions under the first conditions section seam to work just fine. That part prevents the player from gaining points from killing those units, or from killing themselves.
The actions however, don't work as I think they should. I want the player to gain 400 points for killing a wraith, scout, goliath, or vulture, but instead it only gives 100 points. As you can see, the 400 points variable change is under "Then do action". Why is it passing to the "Else do action"?
What am I doing wrong here? Any Ideas?
This works like you want to (I hope)
You could still check for the unit type or owner of killing unit.
Theres actually an easier(?) way to do this. There is a function for units called Unit Set Custom value/ Unit Get Custom Value.
Im assuming here that the units you speak of are spawned and not built. Upon spawning your units, you could set this custom value, and then read it upon their death. This way you shouldn't even need if/else conditions. Store all your units and custom values into two arrays for easy access.
This is just the pseudocode, I use galaxy to script so I'm not familiar with how it would be done in GUI, but conceptually this is a much simpler way to implement what you are attempting to do.
@miheinen: Go
Awesome, it works. Im wondering why my first conditions work, but not the conditions in the actions part. They are nearly identical. Theres something that im missing here lol.
Anyways, thank you for the reply!
@FuzzYD: Go
Im a newbie to map making, and galaxy code is way over my head at this point lol, but I think you are right. Il look into this concept. This is how I originally wanted to do things, but couldn't figure it out :P
Thanks for your reply!
@MonsterModular: Go
Have no fear :P The idea above can be done in GUI as easily as it could be done in Galaxy. You just need to set up 3 triggers and have global arrays to store the information.
Where * are your indexes. Good luck with the triggering! It's quite a steep learning curve, but once you get it, its a plateau. The main downfall is you would still need to check the unit type if the unit was not created through a trigger.
Cleaner Solution: add kill resources to the unit types, of type custom resource.