• 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.

[Trigger] Order unit to cast + other problems

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
Ok, I made this trigger
  • Unknown
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to A_Ability
    • Actions
      • Set TempLoc = (Position of (Triggering unit))
      • Special Effect - Create a special effect at TempLoc using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Set Effect[1] = (Last created special effect)
      • Special Effect - Create a special effect at TempLoc using Abilities\Spells\Other\Charm\CharmTarget.mdl
      • Set Effect[2] = (Last created special effect)
      • Region - Center My_Region <gen> on TempLoc
      • Custom script: call RemoveLocation( udg_TempLoc )
      • Animation - Change (Triggering unit)'s animation speed to 1000.00% of its original speed
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of A_Skill for (Triggering unit)) Equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to 5, do (Actions)
            • Loop - Actions
              • Set TempLoc = (Random point in My_Region <gen>)
              • Unit - Order (Triggering unit) to Orc Tauren Chieftain - Shockwave TempLoc
              • Custom script: call RemoveLocation( udg_TempLoc )
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of A_Skill for (Triggering unit)) Equal to 2
            • Then - Actions
              • For each (Integer A) from 1 to 15, do (Actions)
                • Loop - Actions
                  • Set TempLoc = (Random point in My_Region <gen>)
                  • Unit - Order (Triggering unit) to Orc Tauren Chieftain - Shockwave TempLoc
                  • Custom script: call RemoveLocation( udg_TempLoc )
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of A_Skill for (Triggering unit)) Equal to 3
                • Then - Actions
                  • For each (Integer A) from 1 to 40, do (Actions)
                    • Loop - Actions
                      • Set TempLoc = (Random point in My_Region <gen>)
                      • Unit - Order (Triggering unit) to Orc Tauren Chieftain - Shockwave TempLoc
                      • Custom script: call RemoveLocation( udg_TempLoc )
                • Else - Actions
      • Animation - Change (Triggering unit)'s animation speed to 100.00% of its original speed
      • Special Effect - Destroy Effect[1]
      • Special Effect - Destroy Effect[2]
Now im totaly new to the "Integar A" thingy (actualy I don't even know what it does... but I think I did it right didn't I ?), and this trigger dosn't work at all.
The only thing it does is making the special effects and removing them.

Now another question, how do I use that "order unit to cast ---" if I want him to cast my own spell ?
Saw some comment saying "you can do also on skills BASED on the skills in the list" but dunno what that means I should do.

Now a second trigger
  • Unknown
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Teleport
    • Actions
      • Set TeleportLoc[1] = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (A_Region <gen> contains (Triggering unit)) Equal to True
        • Then - Actions
          • Set TeleportLoc[2] = ((Position of (Triggering unit)) offset by (-1000.00, 0.00))
          • Unit - Move (Triggering unit) instantly to TeleportLoc[2], facing Default building facing degrees
        • Else - Actions
          • Set TeleportLoc[2] = ((Position of (Triggering unit)) offset by (1000.00, 0.00))
          • Unit - Move (Triggering unit) instantly to TeleportLoc[2], facing Default building facing degrees
      • Custom script: call RemoveLocation( udg_TeleportLoc[1])
      • Custom script: call RemoveLocation( udg_TeleportLoc[2])
Again 2 questions.
First, the unit teleports also when not in A_Region, I don't really see any reason why :eekani:
And second, can I really use the custom script I used - call RemoveLocation( udg_TeleportLoc[2]) - I don't know if I can use harrays in it - TeleportLoc[1] instead of TeleportLoc.

Thanks in advance :thumbs_up:
 
ok, well the first one, you are ordering the triggering unit to use a shockwave? so does the triggering unit even have a shockwave ability?

for casting custom abilities; look at the spell. there is a data file called OrderID, check what that is, so e.g. if it says shockwave, then the order you would use for triggers would be TaurenChieftain - Shockwave.

your third trigger, your else action is teleporting your unit as well so that it will still teleport.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
1. First of all, saw other people use it the same way without giving, AND I also gave him the skill and nothing changed.

2. Thanks :thumbs_up:

3. Lol didn't notice :xxd:

(+rep)

Oh and another question now.
If I will make a new ability with orderID of shock wave, how would the editor know which one to cast ? should I also change the original shock wave to NONE ?
 
Level 11
Joined
Aug 25, 2006
Messages
971
In 99% of cases changing the orderID doesn't actually work. It stays the same. But if you base two spells on the same spell (thus they have the same orderID) even if you click on one of the spells it'll attempt to cast both. (So annoying) An exception to this is the ability 'Channel' which you can change the orderID of.
The unit MUST have the ability to be able to cast it.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Damn, I tried using the original shock wave just to check the trigger... even with 0 cool down and 0 cast time warcraft can't stand with the speed of the trigger thus it shoots only 1 shock wave :cry:
I must use for it "create units" instead of a real pure spell ? :cry::cry::cry:
(And yea you are right... tried the ID and it really didn't work)
 
Level 3
Joined
Nov 11, 2007
Messages
39
Are you trying to shoot 5 shockwaves 1 after anouther, or 5 all at once in different directions? The way you have it set now the caster is sent 5 orders all at once so only one of them is registered. I've tried it before and it doesn't work even with 0 CD and 0 CT.

As for your loop "integer A" it looks like proper usage.

Adding a wait command in there may help you out as well, but that can cause major problems with the dynamic variables "triggering unit" etc.

Also you cannot center regions on points it seems, I tried it one day and although when i minimap pinged the region it came up in the correct spot the other trigger i had set to it only worked in the origina location and continued to work in original location when it was moved and would not function in the new location at all. I belive you have to move a location onto anouther location to have it work properly.

This Trigger is starting to look suspiciously like the one I posted a few days ago and i managed to get it working, maybe ill have a go at this one too.

If it were me I would clone fan of knives if you want it all at once or add a wait command. Maybe ill make yea a test map.
 
Level 3
Joined
Nov 11, 2007
Messages
39
Got It, well a simple one anyhow, just add levels and clean up my leaks!!

I found the best way was to use dummy units 1 for each shockwave. Seems to work great!

Test map included:infl_thumbs_up:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to YourAbility
    • Actions
      • Region - Center YourRegion on (Position of (Triggering unit))
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • Set temppoint = (Random point in myregion)
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
          • Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave temppoint
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)

/victorydance

edit: oh yea and i actually insta crashed my Pc when i left out that condidtion for testing, seems it triggered off each shockwave and snowballed lol.

As for that second trigger the if/then/else states that the unit is going to teleport no matter what because a move statement is in both then and else. If hes in regionA he will port to -1000 and if hes not then +1000.
 

Attachments

  • MultiShockwave.w3x
    19.2 KB · Views: 54
Level 29
Joined
Jul 29, 2007
Messages
5,174
First, this has nothing to do with your trigger, don't even remember what your trigger was lol.
Now, I wanted them to go 1 after another really fast, and I especialy want the caster to cast it, not a dummy unit.
And why is my trigger ordering all at one time ? shouldn't loop integar 1-5 make the action run 5 times ? :confused:
 
Level 3
Joined
Nov 11, 2007
Messages
39
Ah, perfection....

Well.....i used dummy units, but it looks damn good. Just cast blink.

Edit: and yea can shave some time off that wait, i just had it down to .05 and it still looks ok to me. Won't go much faster though.
 

Attachments

  • MultiShockwave1.w3x
    19.5 KB · Views: 65
Level 29
Joined
Jul 29, 2007
Messages
5,174
Works great, still sad can't make it the real way because warcraft is so limited :xxd:

Oh by the way, my region moved with my trigger.
It didn't make any problem... are you sure must use variables ? lol... oh well using variables is anyway best solution for most of the stuff in WE ^^
 
Level 3
Joined
Nov 11, 2007
Messages
39
Yea, it worked for this instance, but my unit entering region spell for my WoW style res trigger wouldnt work correctly. Good luck!

I think that you could make that MUI easily with some local variables too, but dont ask me about that!! Using triggering unit wont make it MUI because if someone else casts it it will screw up triggering unit too. Also wait commands, like i used dont get along with event responces.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I know, didn't make it for multiplayer because that wasn't my problem and didn't want to make here a big code for no reason.

And whats local variables ? lol... I know pretty much how to make most of the things but I don't know their names :/
Also whats MUI ? ^^
 
Level 3
Joined
Nov 11, 2007
Messages
39
MUI stands for "multi unit instanceable"? i think?

What it means is that you can have multiple instances of the same trigger running at the same time. You see if anouther unit casts that spell while the first is 1/2 done it will reset the GLOBAL variables i have defined and ruin the cast of the first one. This really only occurs due to wait commands, which is why i try to avoid them if i can.

LOCAL variables are contained within that instance of the trigger so if anouther unit casts it creates its own set of local variables and does not interfere with the current casts variables. This means that the spell is MUI. However local variables require some jass that i dont know how to use yet :p.
 
Level 11
Joined
Aug 25, 2006
Messages
971
If you get WEU one of the best things it helps GUI users with is removing leaks. So if you must use GUI at least use WEU, however try and stay away from functions/actions that start with 'Advanced -' because many of them leak.
 
Status
Not open for further replies.
Top