- Joined
- Jan 11, 2009
- Messages
- 3,414
I'm trying to trigger it so that when a unit attacks, it also casts "cluster rockets". The way i solved this was to attach a dummy unit to it, give the spell to the dummy, and order it to cast it at the target location. Problem is, it doesn't work.
I'm not gonna paste all of the code, but here is the attack part (pretty straightforward):
When the unit attacks, the debug text "failed to cast" appears. However, if i make the dummy visible and selectable, i can manually order it to cast the spell without problem. The dummy will move instantly to the location of the attacking unit, just as it is supposed to. The dummy does not have "locust", and is owned by the same player as the attacker. I feel like i've tried everything here, but it just won't work.
I'm not gonna paste all of the code, but here is the attack part (pretty straightforward):
JASS:
method attack takes unit target returns nothing
call SetUnitX(.dummy, GetUnitX(.u))
call SetUnitY(.dummy, GetUnitY(.u))
if IssuePointOrderById(.dummy, OrderId("clusterrockets"), GetUnitX(target), GetUnitY(target)) == false then
call BJDebugMsg("Failed to cast...")
endif
endmethod
When the unit attacks, the debug text "failed to cast" appears. However, if i make the dummy visible and selectable, i can manually order it to cast the spell without problem. The dummy will move instantly to the location of the attacking unit, just as it is supposed to. The dummy does not have "locust", and is owned by the same player as the attacker. I feel like i've tried everything here, but it just won't work.
