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

Auto Cast Help

Status
Not open for further replies.
Level 2
Joined
Nov 3, 2016
Messages
7
I am trying to make a orc raider auto cast ensnare when NEAR any enemy flying unit. I was following this tutorial...

Making any Spell Autocasting

,but i am still unable to make my orc raider auto cast. Any ideas you guys come up with do not have to follow the tutorial i linked. anything will help as long as it works. I Based my dummy spell off searing arrow. what i currently have is ...
(PS.. i am still new to this so please explain as much as you can)

Ensnare in object manager ...
ensnare.png


dummy spell(searing arrow) in object manager...
dummy.png



raider changes in object manager...
raider.png



trigger...
trigger.png
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
IMO the method Ralle used has some questionable choices. For example it doesn't make sense to give your custom ensnare ability mana cost and cooldown and you don't have to add it to the raider because you can use a dummy caster unit to cast the actual ensnare instead. For all intents and purposes the dummy autocast ability SHOULD be the main ability with all cooldown/manacost/targeting options set to what you want the spell to actually have-- pretty much every custom spell does it this way.

I probably wouldn't use Searing Arrows because it might interact weird with what you can actually target due to it being an attack modifier. Faerie Fire or Inner Fire are better choices IMO, though now that I think about it the fact that they would apply a buff briefly (giving them 0 duration makes them endless) might make them not a good choice. It is ultimately up to you, but know there might be downsides to which autocast ability you choose.

I noticed you changed the Order String for Searing Arrows to "ensnare", and you should know that this does not do anything. The only spell that can have its order strings/base order changed is Channel (ANcl). You also can't just give a buff to an ability that doesn't use one naturally (as you added "Ensnare (Air)" to Searing Arrows)-- it won't show up. In general, a lot of fields that do nothing for any given base spell still appear in the OE, so don't assume that because the field is there it will actually do something.

Finally, don't use "Begins channeling an ability". "Starts the Effect of an ability" is the proper event for detecting when a spell has been successfully cast. My trigger would look something like this:
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to DummyAutocastAbility
  • Actions
    • Set TempPoint = Position of (triggering unit)
    • -------- ^^ For leak removal later ^^ --------
    • Unit - Create one DUMMY_CASTER_UNIT for (owner of (triggering unit))) at (TempPoint) facing Default Building Facing degrees
    • Unit - Add a 1.00 second generic expiration timer to (last created unit)
    • Unit - Add Ensnare (your custom version) to (last created unit)
    • Unit - Set level of Ensnare (your custom version) for (last created unit) to (level of (ability being cast) for (triggering unit))
    • -------- ^^ if the ability was a hero ability and has multiple levels you would need to add the above line ^^ --------
    • Unit - order (last created unit) to (Orc Raider - Ensnare) (target unit of ability being cast)
    • Custom script: call RemoveLocation(udg_TempPoint) //look up leaks and how to fix them to understand this
 
Level 2
Joined
Nov 3, 2016
Messages
7
IMO the method Ralle used has some questionable choices. For example it doesn't make sense to give your custom ensnare ability mana cost and cooldown and you don't have to add it to the raider because you can use a dummy caster unit to cast the actual ensnare instead. For all intents and purposes the dummy autocast ability SHOULD be the main ability with all cooldown/manacost/targeting options set to what you want the spell to actually have-- pretty much every custom spell does it this way.

I probably wouldn't use Searing Arrows because it might interact weird with what you can actually target due to it being an attack modifier. Faerie Fire or Inner Fire are better choices IMO, though now that I think about it the fact that they would apply a buff briefly (giving them 0 duration makes them endless) might make them not a good choice. It is ultimately up to you, but know there might be downsides to which autocast ability you choose.

I noticed you changed the Order String for Searing Arrows to "ensnare", and you should know that this does not do anything. The only spell that can have its order strings/base order changed is Channel (ANcl). You also can't just give a buff to an ability that doesn't use one naturally (as you added "Ensnare (Air)" to Searing Arrows)-- it won't show up. In general, a lot of fields that do nothing for any given base spell still appear in the OE, so don't assume that because the field is there it will actually do something.

Finally, don't use "Begins channeling an ability". "Starts the Effect of an ability" is the proper event for detecting when a spell has been successfully cast. My trigger would look something like this:
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to DummyAutocastAbility
  • Actions
    • Set TempPoint = Position of (triggering unit)
    • -------- ^^ For leak removal later ^^ --------
    • Unit - Create one DUMMY_CASTER_UNIT for (owner of (triggering unit))) at (TempPoint) facing Default Building Facing degrees
    • Unit - Add a 1.00 second generic expiration timer to (last created unit)
    • Unit - Add Ensnare (your custom version) to (last created unit)
    • Unit - Set level of Ensnare (your custom version) for (last created unit) to (level of (ability being cast) for (triggering unit))
    • -------- ^^ if the ability was a hero ability and has multiple levels you would need to add the above line ^^ --------
    • Unit - order (last created unit) to (Orc Raider - Ensnare) (target unit of ability being cast)
    • Custom script: call RemoveLocation(udg_TempPoint) //look up leaks and how to fix them to understand this


It seemed to work. THANK YOU. however i am not sure if i am doing the custom script part right. all i did was ...
cf78445996d9bb6847cbe9481ab6495b.png


06463fd0b6124e40a2da90d6b66ce276.png


b95aaf05eda217d37954f61934b9dfb0.png


And if there is way to preform the auto cast without making a temp unit please let me know. I am asking because it kinda looks ugly for game play, But i can live if there is no other way. Again THANK YOU a bunch.
 
Level 2
Joined
Nov 3, 2016
Messages
7
For those who see my post and want an answer to my question follow what has been said, but the trigger look different. I changed mine to look like this ...
da25a3fc60b99d4d828e6e5d358a8429.png


This trigger makes casting look only visually appealing. The raider will cast the dummy spell (which will do nothing) then will cast the snare (which snares the target). this means the raider will swing his sword twice before snaring the target and it will snare the same target multiple times. So even though it looks more visually appealing it is less effective. (you can remove the custom script, i forgot to remove it)
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
I am asking because it kinda looks ugly for game play, But i can live if there is no other way. Again THANK YOU a bunch.
Don't make a copy of the unit casting the spell-- that will definitely look ugly! You just need to make one generic dummy caster unit in the OE and create one of those whenever you need to dummy cast a spell. Give it no model, 0 cast point and backswing, highest movespeed and mana, 0 sight radius (that might not be strictly necessary), and the ability "Locust" ('Aloc').

Download pretty much any approved spell and you should see the creator's version of a dummy caster in the map-- you can just copy that over directly instead of making your own if you're lazy.


Also you can right click a part of any trigger and select "copy as text" and then paste here between [trigger][/trigger] tags instead of uploading screenshots.
 
Level 2
Joined
Nov 3, 2016
Messages
7
Don't make a copy of the unit casting the spell-- that will definitely look ugly! You just need to make one generic dummy caster unit in the OE and create one of those whenever you need to dummy cast a spell. Give it no model, 0 cast point and backswing, highest movespeed and mana, 0 sight radius (that might not be strictly necessary), and the ability "Locust" ('Aloc').

Download pretty much any approved spell and you should see the creator's version of a dummy caster in the map-- you can just copy that over directly instead of making your own if you're lazy.


Also you can right click a part of any trigger and select "copy as text" and then paste here between [trigger][/trigger] tags instead of uploading screenshots.

OHHHHH!!!!!!!!!!!!!!!!! like i said i am still new at this. That is way better! thanks a bunch Pyrogasm
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
Curious, but did you try using SetUnitPropWindow(u,0.00) to see if that un-did the problem? Seems like it would achieve the same thing as 0 MS. Obviously this is not a better solution but I don't see any other reason simply being able to move would cause a delay in cast as long as spells have max range.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
I already had its Propulsion Window, Backswing, and Cast Point set to 0 in the Object Editor. I believe setting the unit's movement speed to 0 doesn't allow you to change its fly height, so this should done be used on dummy casters.

I forgot to mention that the "issue" I talk about is really hard to see if you have it in a loop timer running every 0.03 seconds. If you go to the Volatile Light thread, you can see IcemanBo pointing out the issue to me.
 
Status
Not open for further replies.
Top