• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Dummy Unit Cast Rain of Chaos

Status
Not open for further replies.
Level 2
Joined
Oct 2, 2021
Messages
7
Hello all. I'm trying to make a dummy unit cast Rain of Chaos so that my hero doesn't need to channel the ability, however, I can't seem to get it to cast the ability (the default issue order targeting point trigger:
1639181735397.png
, unfortunately doesn't work because the spell activation string is none by default for rain of chaos). I've found a few forums that explain how to make it cast in different ways, but I can't figure out how to make it cast at the ability point my hero just casted at. The trigger is:
1639181071180.png

I just need a custom script that incorporates the order id of the spell and points it to cast at the target point of ability being cast, but I have no idea how to do it in custom script. I found the order id for Rain of Chaos (852237), but I can't figure out how to tell the dummy to rain of chaos the spell location. Any help is greatly appreciated!
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
Do this but change:
  • Custom script: call IssuePointOrderLoc(GetTriggerUnit(), "852237", udg_point)
to
  • Custom script: call IssuePointOrderLoc(GetLastCreatedUnit(), "rainofchaos", udg_point)
(If you are using the above one I posted, make sure you create Location Variable and name it "point" and use it to mark (target location of the ability being cast))

but with tests it seems that the "852237" doesn't work, but "rainofchaos" does.
Credits to this thread too.

To use a customscript there must be zero errors or it will fail on testing the map or using validate triggers:
1639193772233.png

Use validate to test if there are errors.

To make a custom script:
1639193742606.png

Find the script you want to copy and paste it in the script code area.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,532
So your Dummy unit does not need to face the (Target point of ability being cast). A properly setup Dummy unit will cast a spell instantly without having to turn to face it's target.

When creating a Dummy unit, do it like this:
  • Copy and paste the Locust unit and use this as the base for the unit (Found under Undead - Special)
  • Set Attacks Enabled to None
  • Set Movement Type to None
  • Set Speed Base to 0
  • Remove Undead classification (99.99% of the time this is unnecessary)

Regarding Orders and Custom script, there are multiple versions of these Order functions so using the correct one can be tricky.
Here is what you're looking for:
vJASS:
IssuePointOrderLoc(whichUnit, order, whichLocation)
IssuePointOrderByIdLoc(whichUnit, order, whichLocation)
The first function here takes a "string" as the order.
The second function here takes an integer as the order.

And if you want to work with Coordinates instead of Points (locations) it's very similar:
vJASS:
IssuePointOrder(whichUnit, order, x, y)
IssuePointOrderById(whichUnit, order, x, y)
The first function takes a "string" as the order.
The second function takes an integer as the order.
 
Last edited:
Level 2
Joined
Oct 2, 2021
Messages
7
Tested out the trigger and it works perfectly! Dummy unit is casting right where I need it to :) Thank you guys for the quick response. And thank you Uncle for explaining that. Maybe in the future I'll be able to figure something like this out with your guys' explanation and I won't need to post :thumbs_up:
 
Status
Not open for further replies.
Top