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

[Trigger] Trigger interrupted???

Status
Not open for further replies.
Level 3
Joined
Jun 11, 2007
Messages
43
In the course of my spell-making with triggers and such, I came across an odd problem.

  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) equal to Blade Fury
  • Actions
    • Unit - Create 1 dummy caster for (Owner of (Casting Unit)) at (Position of (Casting Unit)) facing Default building facing degrees
    • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last created unit) to Night Elf Warden - Fan of Knives
    • Wait 1.00 seconds
    • Unit - Create 1 dummy caster for (Owner of (Casting Unit)) at (Position of (Casting Unit)) facing Default building facing degrees
    • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last created unit) to Night Elf Warden - Fan of Knives
    • Wait 1.00 seconds
    • Unit - Create 1 dummy caster for (Owner of (Casting Unit)) at (Position of (Casting Unit)) facing Default building facing degrees
    • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last created unit) to Night Elf Warden - Fan of Knives
    • Wait 1.00 seconds
    • Unit - Create 1 dummy caster for (Owner of (Casting Unit)) at (Position of (Casting Unit)) facing Default building facing degrees
    • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last created unit) to Night Elf Warden - Fan of Knives
    • Wait 1.00 seconds
    • Unit - Create 1 dummy caster for (Owner of (Casting Unit)) at (Position of (Casting Unit)) facing Default building facing degrees
    • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last created unit) to Night Elf Warden - Fan of Knives
    • Wait 1.00 seconds
The intended effect was to get a Blademaster under the effect of the Bladestorm ability to have a dummy unit spawn at his position periodically, fire off a fan-of-knives based move, and then dissappear. That way it would be like he's throwing something periodically as he spins.

The first unit spawned and fired off the spell, but no other units spawned in afterwards in spite of what the trigger said. After some testing, I found out that removing the command to use Fan of Knives allowed the trigger to run its course. However, that defeats the entire purpose of the spell.

Is there something about the Fan of Knives spell that is messing this up? It's not giving any reason for that to happen. Could I be missing something? There is another way I can do this spell, but then I'd have to use variables, which keeps it from being multi-instanceable. Although that may not be too bad of a thing, I'd like to see if I can avoid that. That, and the spell just doesn't look like how I wanted it to look when I use that second technique.

Can anyone find out what I'm doing wrong here?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
That is indeed most likely the problem.

And you should check the "Thingsd That Leak" thread, your trigger leaks 5 points.
You should also make the trigger to activate only when ability EFFECTS start because a player can start a spell and very fast stop it, and he would still activate the trigger.
 
Level 3
Joined
Jun 11, 2007
Messages
43
I'll go look for that thread. I don't mean to sound utterly noobish, but I'm not entirely sure what "leaks" are. I'm assuming you guys mean memory leaks. If memory leaking is the problem, then thats what I need to do.

But as for Fan of Knives not being long enough to cast, that's not true at all. The first dummy casts the spell without a hitch. But the order subsequently keeps all other units from spawning.

EDIT: I found the thread, and upon my first look I see a lot of these leak problems are being solved by the usage of variables. The only problem is that if I use variables I won't be able to make the spell multi-instanceable. Unless there's some way I can do that with some method I've yet to learn. Then again, maybe I'm just not looking at the specific cause of the leak. I'll see what the variables do to it.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Unfortionly, MUI is the only (thats the only one I found) Ultra-Mega-Super-Big diffrence beetwin GUI and JASS.

If you would let your triggers leak it would be really easy to make it MUI, and to make your map lag more and more untill it crashes in case you have a nice amount of leaks.

For point locations (this will probably account to about 95% of your leaks lol) you will need to try to use either arrays, or the idea humpadumpa thought of, by using in the array a integer that sets itself for +1 every time you use it.
Wish we could use those Local variables those damn JASSers have lol :p

And just as a little help, if you need a jass code (for example what the hell is the code for "call RemoveLocation(udg_Point[Owner of [triggering unit]])", just make any action that will use that and change it into Custom Text (JASS).


Oh and one last thing.
You would probably like to use loops for your trigger.
Find the "Integer[A/B]" loops (its about the 10th action) and set it to 1-5, then do your 4 actions (create, life time, order, wait) and it will run 5 times.
Take care to put your leak removing scripts there too.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Actions:
    • For each Integer[A] from 1-5 do actions:
      • Actions:
        • Set Point = (position of (triggering unit))
        • Create 1 dummy at Point for (owner of (triggering unit))
        • Add a 2 seconds bla bla bla
        • Order unit to bla bla bla
        • Custom script: call RemoveLocation(udg_Point)
        • Wait xx

If you don't do a wait action it will do 5 fans at the same time.

And this is still not MUI.


[offtopic] lol so cool, wrote that trigger without even looking at the WE and it seems pretty real :p
 
Level 6
Joined
Nov 28, 2007
Messages
203
humm.. this might work:
  • Actions:
    • For each Integer[A] from 1-5 do actions:
      • Actions:
        • Set Point[((Point_Int) + 1)] = (Position of (Triggering unit))
        • Set Point_Int = ((Point_Int) + 1)
        • Unit - Create 1 Dummy Unit at Point for (Owner of (Triggering unit))
        • Unit - Add a 2 seconds Generic expiration timer to (Last created unit)
        • Unit - Order (Last created unit) to Night Elf Warden - Fan of Knives
        • Wait 2 seconds
        • Custom script: call RemoveLocation(udg_Point[Point_Int - 1])
I dunno if the udg_Point[point---] works

[Offtopic] the end of the world spell:
  • End of the world spell
  • Events:
    • Time - Every 1 second(s) of time
  • Actions:
    • For each Integer[A] from 1-150000 do actions:
      • Set Point = (Random position in (Entire map))
      • Unit - Create 50 Evil Units at (Point) for (Player[Integer A])
Btw, i made both of these triggers without W.E. *proud* :wgrin:
 
Status
Not open for further replies.
Top