• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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