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

[Trigger] Unit don't cast

Status
Not open for further replies.
Level 12
Joined
Mar 23, 2008
Messages
942
My unit refuses to cast Stampede... Tried with "Target of ability being cast", tried ordering it right after creating it, tried removing locust... If I remove locust I can click on it ingame and manually cast the spell.

  • Gate start
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Gate of Babylon (based in channel)
    • Actions
      • Set SpellPoint[1] = (Target point of ability being cast)
      • Unit - Make (Casting unit) face SpellPoint[1] over 0.00 seconds
      • Set SpellPoint[0] = (Position of (Casting unit))
      • Set temppoint = (SpellPoint[0] offset by 150.00 towards (Angle from SpellPoint[1] to SpellPoint[0]) degrees)
      • Unit - Create 1 Gate of Babylon for (Owner of (Casting unit)) at temppoint facing (Angle from SpellPoint[0] to SpellPoint[1]) degrees
      • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_temppoint)
      • Set temppoint = (SpellPoint[0] offset by 100.00 towards (Angle from SpellPoint[0] to SpellPoint[1]) degrees)
      • Unit - Create 1 Dummy Caster Gate for (Owner of (Casting unit)) at temppoint facing (Angle from SpellPoint[0] to SpellPoint[1]) degrees
      • Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_temppoint)
      • Custom script: call RemoveLocation(udg_SpellPoint[0])
      • Set SpellPoint[0] = (Position of (Last created unit))
      • Set temppoint = (SpellPoint[0] offset by 100.00 towards (Facing of (Last created unit)) degrees)
      • Unit - Order (Last created unit) to Neutral Beastmaster - Stampede temppoint
      • Trigger - Turn on Gate off <gen>
      • Custom script: call RemoveLocation(udg_temppoint)
      • Custom script: call RemoveLocation(udg_SpellPoint[0])
      • Custom script: call RemoveLocation(udg_SpellPoint[1])
Just cast it, dammit!
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
First, use (Triggering Unit) instead of (Casting Unit)
Second, the unit which should be casting stampede refers to 'Dummy Caster Gate', doesn't it?
If so, check the spellids.
Plus, try using the maximum range of the stampede-ability as the temppoint, means if range = 800, use for
  • Set temppoint = (SpellPoint[0] offset by 800.00 towards (Facing of (Last created unit)) degrees)
 
Level 12
Joined
Mar 23, 2008
Messages
942
First, use (Triggering Unit) instead of (Casting Unit)
Why?
Second, the unit which should be casting stampede refers to 'Dummy Caster Gate', doesn't it?
Yes
If so, check the spellids.
What?
Plus, try using the maximum range of the stampede-ability as the temppoint, means if range = 800, use for
  • Set temppoint = (SpellPoint[0] offset by 800.00 towards (Facing of (Last created unit)) degrees)
Still nothing :(
 
Level 12
Joined
Mar 23, 2008
Messages
942
prob1da8.jpg

prob2gk9.jpg


  • Gate start
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Gate of Babylon (based in channel)
    • Actions
      • Set SpellPoint[1] = (Target point of ability being cast)
      • Unit - Make (Triggering unit) face SpellPoint[1] over 0.00 seconds
      • Set SpellPoint[0] = (Position of (Triggering unit))
      • Set temppoint = (SpellPoint[0] offset by 150.00 towards (Angle from SpellPoint[1] to SpellPoint[0]) degrees)
      • Unit - Create 1 Gate of Babylon for (Owner of (Triggering unit)) at temppoint facing (Angle from SpellPoint[0] to SpellPoint[1]) degrees
      • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_temppoint)
      • Set temppoint = (SpellPoint[0] offset by 100.00 towards (Angle from SpellPoint[0] to SpellPoint[1]) degrees)
      • Unit - Create 1 Dummy Caster Gate for (Owner of (Triggering unit)) at temppoint facing (Angle from SpellPoint[0] to SpellPoint[1]) degrees
      • Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_temppoint)
      • Custom script: call RemoveLocation(udg_SpellPoint[0])
      • Set SpellPoint[0] = (Position of (Last created unit))
      • Set temppoint = (SpellPoint[0] offset by 100.00 towards (Facing of (Last created unit)) degrees)
      • Unit - Order (Last created unit) to Neutral Beastmaster - Stampede temppoint
      • Trigger - Turn on Gate off <gen>
      • Custom script: call RemoveLocation(udg_temppoint)
      • Custom script: call RemoveLocation(udg_SpellPoint[0])
      • Custom script: call RemoveLocation(udg_SpellPoint[1])
Don't cast :(
 
Level 12
Joined
Mar 23, 2008
Messages
942
Unit - A unit starts an effect of an ability, maybe? Eh?
Its the most basic rule of creating triggered spells...
Still nothing! ¬¬

  • Gate start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Gate of Babylon (based in channel)
    • Actions
      • Set SpellPoint[1] = (Target point of ability being cast)
      • Unit - Make (Triggering unit) face SpellPoint[1] over 0.00 seconds
      • Set SpellPoint[0] = (Position of (Triggering unit))
      • Set temppoint = (SpellPoint[0] offset by 150.00 towards (Angle from SpellPoint[1] to SpellPoint[0]) degrees)
      • Unit - Create 1 Gate of Babylon for (Owner of (Triggering unit)) at temppoint facing (Angle from SpellPoint[0] to SpellPoint[1]) degrees
      • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_temppoint)
      • Set temppoint = (SpellPoint[0] offset by 100.00 towards (Angle from SpellPoint[0] to SpellPoint[1]) degrees)
      • Unit - Create 1 Dummy Caster Gate for (Owner of (Triggering unit)) at temppoint facing (Angle from SpellPoint[0] to SpellPoint[1]) degrees
      • Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_temppoint)
      • Custom script: call RemoveLocation(udg_SpellPoint[0])
      • Set SpellPoint[0] = (Position of (Last created unit))
      • Set temppoint = (SpellPoint[0] offset by 100.00 towards (Facing of (Last created unit)) degrees)
      • Unit - Order (Last created unit) to Neutral Beastmaster - Stampede temppoint
      • Trigger - Turn on Gate off <gen>
      • Custom script: call RemoveLocation(udg_temppoint)
      • Custom script: call RemoveLocation(udg_SpellPoint[0])
      • Custom script: call RemoveLocation(udg_SpellPoint[1])
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Some things you could check:

- Make sure the gate of babylon dummycast spell has a mana cost of 0.
- Make sure the Dummy Caster Gate has at least a movement speed of 1 or higher. Some spells do not trigger properly if the unit cant move.
- Make sure is has no attack properties. (disable both attacks)
- Make sure it's movement type is air or none.
- Make sure its turn speed is greater than 0. I suggest you to put it to 1, since that is the fastest.
 
Level 7
Joined
Apr 27, 2008
Messages
94
Even though the unit began casting, doesn't not mean it finished casting (even if the casting speed is 0), so the spell does not go off. If the spell has a casting time of 0 then make the game wait 0.01 seconds, if its channeling... then you cant give the unit special orders.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Initus, that is a bad solution. At standard all spells starts the effect of the ability 0,5 seconds after the "start channeling" or start casting.

Starts the effect of an ability is best used since:
In that moment all buffs are made
All effects of the ability are made
Cooldown started and mana cost reduced on the casting unit.
 
Level 12
Joined
Mar 23, 2008
Messages
942
Initus, that is a bad solution. At standard all spells starts the effect of the ability 0,5 seconds after the "start channeling" or start casting.

Starts the effect of an ability is best used since:
In that moment all buffs are made
All effects of the ability are made
Cooldown started and mana cost reduced on the casting unit.

That is not true, I'm using a on/off berserker, if the unit is turning on I need to check if he DON'T have the buff, in "Starts the effect of ability", that means the trigger starts to run before the buff is made.

Edit: Checked everything you said, still nothing :(

Okay, the one who solve this problem will receive a delecious cake!
 
Level 6
Joined
Sep 13, 2008
Messages
261
Certain AI orders dont seem to work when issued from triggers. I tried to issue stampede order to someone on text string and it doesnt work like that either.
The orders that don't work that I have tried are devour targeting heroes, and stampede.

If you find a way to order this let me know. It could work in jazz, but I haven't tried.

You can use a spell that has an order command that does work and script all the effects to work the same as stampede. I am not good enough to do this yet, it takes a long time for me to make custom spells.
 
Last edited:
Level 23
Joined
Nov 29, 2006
Messages
2,482
That is not true, I'm using a on/off berserker, if the unit is turning on I need to check if he DON'T have the buff, in "Starts the effect of ability", that means the trigger starts to run before the buff is made.

I tested that and you are right. But it doesn't matter. You want to check if the unit is turning on the ability right? It would still be triggered. Also, using begins casting an ability would not add a buff either. The problem with begins casting/channeling is that it could be interrupt before the effects are made, and therefor trigger without activaing the spell/adding buffs/cooldown/mana cost. Starts the effect of an ability is making this right after (a few miliseconds) the spell effect has been triggered.

Anywho, the issue of ordering a unit with an orderstring exist for some spells. What you should do in that case is, yes, using a jass custom script implent using the orderid instead of the orderstring as mentioned above by howl2000.

I would say though, that it is very weird this current stampade order doesnt work, since when I tried it, it did work.

The orderid for stampade is 852593. If you want to know about a order's orderid instead of using the string (since it could be some issues with other abilities, and since, some abilities doesnt even have any orderstring but still can be triggered by the orderid) I suggest you look on the attached map in this post.

By a custom script you could try, instead of using
  • Unit - Order (Last created unit) to Neutral Beastmaster - Stampede temppoint
try:
  • Custom script: call IssuePointOrderByIdLoc( bj_lastCreatedUnit, 852593, udg_temppoint )
Note that I am using the function for ordering a unit by orderid on a loaction. In jass, you normally use x and y coordinates since they are much faster, but to simplify it, and make it fit for your trigger without changing too much, location could be used as well.

If this would not be the issue, as I actually dont think it is you could try to do:
  • AI - Ignore (Last created unit)'s guard position
right after the unit is created.
 

Attachments

  • OrderIdChecker.w3x
    17.2 KB · Views: 45
Level 6
Joined
Sep 13, 2008
Messages
261
The order for stampede doesnt work if unit is in combat and not under your control. I changed the beastmaster in your map to team 2 and the order no longer works. So how can you make a unit stop combat without changing his enemies etc.
 
Level 14
Joined
Dec 9, 2006
Messages
1,091
AHAH! I just read through your trigger and I KNOW what you did wrong. It took me awhile to connect the dots but here it is.
You are using the command
"Unit - Order (Last created unit) to Neutral Beastmaster - Stampede temppoint"
HOWEVER! You cannot use that order in casting a CUSTOM spell. If you want that order to work, you have to go into the ORIGINAL Stampede (non-rexar) under Neutral hostile, and edit ITS values. You CANNOT create a custom one and use that specific order.

Now, I know there is some other thing you can do with variables to make it work, but the way you are doing it now, it WILL NOT cast it.

Wewt, now I feel better.

~Asomath

P.S. If I screwed somthing up or missed somthing, dont kill me, it was an accident XD
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
The order for stampede doesnt work if unit is in combat and not under your control. I changed the beastmaster in your map to team 2 and the order no longer works. So how can you make a unit stop combat without changing his enemies etc.

Hm? I changed the Beastmaster to blue if that is what you mean... No issue for me. Even thogugh he was attacking my units, he still casted stampede, and channeled it..

Asomath said:
AHAH! I just read through your trigger and I KNOW what you did wrong. It took me awhile to connect the dots but here it is.
You are using the command
"Unit - Order (Last created unit) to Neutral Beastmaster - Stampede temppoint"
HOWEVER! You cannot use that order in casting a CUSTOM spell. If you want that order to work, you have to go into the ORIGINAL Stampede (non-rexar) under Neutral hostile, and edit ITS values. You CANNOT create a custom one and use that specific order.
That is not correct. I made a custom stampede based on the hero ability. It works fine, no matter if it is used as a "unit" ability or a "hero" ability. However it could be, that Stampede doesnt work for "normal" units. Its easy to check though

Saishy... I looked at the trigger you sent me... And I tried to modify it... But I have no idea why it doesnt work >:/
 
Level 22
Joined
Jun 24, 2008
Messages
3,050
Does a normal beastmaster neither stampade?

-Check the following:

Can your BeastMaster stampade?
Can your BeastMaster cast stampade via trigger (when you type stampade, or such)
Can you create him, and order him to cast?

If all theese work, then check your spell base/order ID. If its not Stampade thats why.
 
Level 6
Joined
Sep 13, 2008
Messages
261
I just don't get it. I am using warcraft map editor with jazznewgen pack installed and If I delete your beastmaster and add in my own then change the unit ordered to him it doesn't work(see in attachment).

When I change your already made unit to team 2 it worked fine, but why didnt it work when I just recreated the trigger for a new unit. I did repick him to make sure his <gen> number didnt change. Answer me in a pm if it doesn't help the starter of the thread.
 
Last edited:
Level 12
Joined
Mar 23, 2008
Messages
942
Does a normal beastmaster neither stampade?

-Check the following:

1- Can your BeastMaster stampede?
2- Can your BeastMaster cast stampede via trigger (when you type stampade, or such)
3- Can you create him, and order him to cast?

If all theese work, then check your spell base/order ID. If its not Stampade thats why.
1- Yes
2- Yes
3- Yes

---

I found some strange things:
obs: always when there is "it works" means both the skill and trigger works.

- I can create a trigger like that:

  • Stmp2 hack
    • Events
      • Player - Player 1 (Red) types a chat message containing -stampede2 as An exact match
    • Conditions
    • Actions
      • Unit - Create 1 Dummy Caster Gate for Player 1 (Red) at (Position of Owl Scout (Level 3) 0146 <gen>) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Beastmaster - Stampede ((Position of Owl Scout (Level 3) 0146 <gen>) offset by 0.00 towards 0.00 degrees)
and the trigger works.

- If I choose my hero, learns the skill, cast it, IT DOES NOT WORKS.
- If I run that trigger and them choose my hero and learn the skill and cast it, IT WORKS.
- If I choose my hero, run that trigger, learn the skill and cast it, IT WORKS.
- If I choose my hero, learns the skill, run the trigger, cast it, IT DOES NOT WORKS.
- If I choose my hero, learns the skill, cast it, run the trigger, cast it again, IT DOES NOT WORKS.
- If I choose my hero, learns a different skill, run the trigger, THE TRIGGER WORKS
- If I choose my hero, learns a different skill, up a level, learns the skill, cast it, IT DOES NOT WORKS.
- If I choose my hero, learns a different skill, up a level, run the trigger, cast it, IT WORKS.
- If I choose ANY OTHER HERO, Learns ANY OTHER SKILL, and run the trigger, the trigger works.

By giving my dummy caster to neutral passive and preloading by putting it on the map, THE SKILL WORKS.

Lolz? The one who solve that will receive a delicious cake.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Hmm... It could be that some abilities have to be preloaded before ordering them. After all, when you create a dummy unit, it usually lags a big in game, since it is given a memory reference. If you preload the unit with the ability, or a unit and then give him the ability, the lag will occur when loading (thus not affecting the gameplay) and the ability is stored in the memory. If you meant that after this, it works, that would be the reason. Otherwise? hmm...
 
Level 12
Joined
Mar 23, 2008
Messages
942
Hmm... It could be that some abilities have to be preloaded before ordering them. After all, when you create a dummy unit, it usually lags a big in game, since it is given a memory reference. If you preload the unit with the ability, or a unit and then give him the ability, the lag will occur when loading (thus not affecting the gameplay) and the ability is stored in the memory. If you meant that after this, it works, that would be the reason. Otherwise? hmm...
So, why it only stops working after my unit LEARNS a skill that don't have anything with the stampede?

Also, just creating the dummy and ordering it to stampede works if my unit don't have that skill.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
>So, why it only stops working after my unit LEARNS a skill that don't have anything with the stampede?

No idea...

> Also, just creating the dummy and ordering it to stampede works if my unit don't have that skill.

Meh thats impossible. You cant order a unit to cast a spell it doesnt have.
 
Level 12
Joined
Mar 23, 2008
Messages
942
Meh thats impossible. You cant order a unit to cast a spell it doesnt have.

Unit - Casting Unit
Dummy - Dummy Caster.

Edit: When my unit casts a ability based in channel, my trigger spawns the dummy caster that casts stampede. If the dummy caster don't exist before my unit LEARNS the skill based in channel, the skill will never works for the duration of the game.
 
Status
Not open for further replies.
Top