• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Need help with custom coding

Status
Not open for further replies.
Level 1
Joined
May 26, 2018
Messages
2
Im not new to triggers, but Im very new to custom script.
I know this might have been discussed before, but I struggled to find it, sorry for inconvenience.

So, for the question.
I created dummy for channel spell, have custom script to cast ability but I cant figure out how to encode target point of ability being cast into custom script.
If someone who knows it, I would really appreciate if you shared your wisdom.


Thanks for your time
 
Level 13
Joined
May 10, 2009
Messages
868
GetSpellTargetLoc() // returns a point (location in JASS)
GetSpellTargetX() // returns the X coordinate in real
GetSpellTargetY() // returns the Y coordinate in real

call IssuePointOrder(whichUnit, "orderstring", GetSpellTargetLoc())

Preventing leaks:

JASS:
local location loc = GetSpellTargetLoc()
call IssuePointOrder(whichUnit, "orderstring", loc)
call RemoveLocation(loc)
set loc = null

If you are using WEX or JNGP, create a trigger and use GUI functions, then convert the trigger to custom text. Doing so, you'll be able to know how the function looks like in JASS text form. However, be careful with BJ functions, (the red-highlighted ones) some of them are useless (wrappers), and there are those which are useful, but contain multiple statements in them - like generic unit events.
 
Status
Not open for further replies.
Top