• 🏆 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!

Trouble with Issuing an order to Human Mortar Team - Flare

Level 3
Joined
Jan 17, 2024
Messages
11
I've triggered abilities hundreds or thousands of times but I can't seem to get my unit to use a custom ability based on Flare. I have Check Dependencies set to False on the custom ability, I've removed the Flare tech requirement (redundant), and ensured the mana cost is 0. The only other field I changed on my custom flare is to set Cooldown to 0, yet my unit will never use the Flare.

I've tried switching the ability out for other abilities and issuing the appropriate order (Blizzard, etc.) and everything works fine, and I've even swapped my Dummy to a mortar team and commented out the expiration and verified that I can select the unit, see the ready to cast custom Flare, and cast it myself. I've even tried adding a .01 second wait out of despearation, but I can't seem to figure out why I can't get a unit to use Flare with this command. Is this a known bug?

(Edit: I should also note that my dummy unit is spawning at my caster position correctly, and I've printed out the target position and it is correctly being set. This is a big redundant since I mentioned it works with other spells and order combinations, but just wanted to mention it in case anyone was wondering.)

  • Flare
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flare
    • Actions
      • Set VariableSet FlareCast_POS = (Position of (Triggering unit))
      • Set VariableSet FlareCast_Target_POS = (Position of (Target unit of ability being cast))
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at FlareCast_POS facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Flare (Dummy) to (Last created unit)
      • Unit - Order (Last created unit) to Human Mortar Team - Flare FlareCast_Target_POS
      • Custom script: FlareCast_POS = nil
      • Custom script: FlareCast_Target_POS = nil
(As a totally separate topic, feel free to tell me that nilling my point variables isn't sufficient lol, I've had confusion over this for a while ever since I came back and LUA was an option and I read some conflicting posts online, but please don't let trump the conversation! They should probably be udg_ prefixed huh? Yeah probably...😅)
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
You need to call RemoveLocation() to clean up Point (location) memory leaks regardless of which scripting language you use:
  • Custom script: call RemoveLocation( udg_FlareCast_POS )
  • Custom script: call RemoveLocation( udg_FlareCast_Target_POS )
The only difference in Lua mode is that you don't use the word "call":
  • Custom script: RemoveLocation( udg_FlareCast_POS )
  • Custom script: RemoveLocation( udg_FlareCast_Target_POS )
You only ever null/nil local variables, there's no need to do it with globals. Also, integers, reals, booleans, and strings never need to be nulled/niled.

Regarding your actual issue, my guess is that the Flare ability has a Requirement preventing it from being used. Otherwise, it's one of the rare cases where the order is messed up. You can try to rely on a non-GUI function for issuing the order which takes the Order Id in it's Integer form.

Edit: Here's the function:
  • Custom script: IssuePointOrderByIdLoc(whichUnit, order, whichLocation)
And with the proper parameters:
  • Custom script: IssuePointOrderByIdLoc( GetTriggerUnit(), 852060, udg_FlareCast_Target_POS )
Also, since most people seem to make this mistake, here's how to setup a proper Dummy unit:
Step 1: Copy and paste the Locust (undead/special).
Step 2: Set Movement Speed to 0 and Movement Type to None.
Step 3: Disable any other problematic settings like the Model/Shadow/Attacks Enabled, etc...

This will allow you to cast any number of spells instantly.
 
Last edited:
Level 3
Joined
Jan 17, 2024
Messages
11
Hmm, still doesn't work. I got the ID for shockwave and tested giving my unit shockwave and it works. I wonder if there is something strange about flare. My goal was just to use the flare from the dummy purely for the visuals so maybe I'll look for another approach.

I also tried setting flare count to 1 even though 0 is the default and should be infinite, still can't get it to work.

Edit: I decided to just give my Channel custom ability that my unit has the caster art for flare and use a trigger to spawn (and immediately destroy) the flare effect at the target's location as a workaround. The reason I got into this situation in the first place is because the Channel ability wouldn't display the flare effect even though I put it in the effect field. Maybe its related to the original ability expecting a point target and my channel using a unit target. Anyway, problem resolved with a workaround to not issue the flare order to a dummy unit. If anyone ever figures out how to order a unit to Flare feel free to loop back here with an answer to the mystery to help others, thanks!


Thanks, yeah that was what I thought. I still am confused about whether you can use those variables again after you clean them up, I've had results doing that, but perhaps it was just with a destroyed unit group and not locations. Either way, thanks!
 
Last edited:
Top