I have an order that targets both units and points (attack.) I want to switch actions depending on whether the order is targeting a unit or a point. "Target point for triggering order" ONLY works if the order is targeting a point. Likewise, "Target unit for triggering order" ONLY works if the order is targeting a unit. I tried "Target Type of Triggering Order" as the switch parameter but it doesn't work - probably because it checks the XML data rather than the dynamic targeting information.
Is there any switch parameter I could use that would work?
In Galaxy, you would need to use OrderGetTargetType() and check the return value to be one of c_orderTargetNone, c_orderTargetPoint, c_orderTargetUnit or c_orderTargetItem.
That stuff is probably exposed in trigger stuff too, search for it.
My trigger works flawlessly without any error message, suggesting you have another error in your trigger.
Why do you use Target unit for Triggering order for the check, but Position of Triggering ability target unit for the execution? There is no triggering ability, use the Target unit for Triggering order again.
Are you using a ability to active the attack instead of the normal unit attack command/order?
Change "Triggering unit" to "EventTargetUnit" because your referring to your unit and not the unit your attacking.
Why do you use Target unit for Triggering order for the check, but Position of Triggering ability target unit for the execution? There is no triggering ability, use the Target unit for Triggering order again.
That was it, thanks. It's always the little mistakes that are the most frustrating :P
Yep. The only solution I've found is to use a debug message for every line of code displaying a copy of whatever the line is doing/getting and converting it to text. Time consuming but it works. Oh, the amount of debugs I've done, the nightmares!
I have an order that targets both units and points (attack.) I want to switch actions depending on whether the order is targeting a unit or a point. "Target point for triggering order" ONLY works if the order is targeting a point. Likewise, "Target unit for triggering order" ONLY works if the order is targeting a unit. I tried "Target Type of Triggering Order" as the switch parameter but it doesn't work - probably because it checks the XML data rather than the dynamic targeting information.
Is there any switch parameter I could use that would work?
You could to something like if target unit for triggering order has >0 hitpoints, it is a unit order, otherwise, its a point order.
@Kueken531: Go
I tried something similar. I checked to see if Target Unit For Triggering Order == No Unit, but that didn't work. It only caused an error :(
Because of the way my system is set up I can't change the ability to point-only targeting either...
@BasharTeg: Go
Try the hp check, it seems to work for me; at least in data.
€ just tested following trigger:
Seems to work flawlessly.
Thanks, I'll give it a try when I can access the editor tonight.
I tried it but no success. I get an error when targeting a unit. Targeting a point seems to work just fine though, oddly enough. Here's my trigger:
In Galaxy, you would need to use OrderGetTargetType() and check the return value to be one of c_orderTargetNone, c_orderTargetPoint, c_orderTargetUnit or c_orderTargetItem.
That stuff is probably exposed in trigger stuff too, search for it.
My trigger works flawlessly without any error message, suggesting you have another error in your trigger.
Why do you use Target unit for Triggering order for the check, but Position of Triggering ability target unit for the execution? There is no triggering ability, use the Target unit for Triggering order again.
You could try StragusMapster's check as well.
Are you using a ability to active the attack instead of the normal unit attack command/order? Change "Triggering unit" to "EventTargetUnit" because your referring to your unit and not the unit your attacking.
Here's my version:
@BasharTeg: Go
Did you find a solution yet?
That was it, thanks. It's always the little mistakes that are the most frustrating :P
Yep. The only solution I've found is to use a debug message for every line of code displaying a copy of whatever the line is doing/getting and converting it to text. Time consuming but it works. Oh, the amount of debugs I've done, the nightmares!