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

WC3 Crashing whenever I use this simple trigger..

Status
Not open for further replies.
Level 3
Joined
Feb 24, 2009
Messages
42
For some reason, whenever I use this on units (Not on empty ground) WC3 crashes after half a second or so. Any help?

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Tar Cannon
  • Actions
    • Unit Group - Pick every unit in (Units within 100.00 x (Real((Level of Tar Cannon for (Triggering unit))))) of (Target point of ability being cast) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit - Create 1 Tar for (Owner of (Triggering unit)) at (Position of (Picked unit)) facing 0.00 degrees
        • Unit - Add Tar to (Last created unit)
        • Unit - Set level of Tar for (Last created unit) to (Integer((Real((Level of Tar Cannon for (Triggering Unit))))))
        • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
        • Unit - Add a 1.50 second generic expiration timer to last created unit.
I've found if I remove the
  • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
part it does not disconnect me, but without that it does nothing. Hope that helps.
 
Level 3
Joined
Feb 24, 2009
Messages
42
Positive they have it. The trigger gives it to them before casting. I'm a huge nub to triggering, how exactly do I fill in a memory leak? Not sure how to use custom scripts.

I tried
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Tar Cannon
  • Actions
    • Unit Group - Pick every unit in (Units within 100.00 x (Real((Level of Tar Cannon for (Triggering unit))))) of (Target point of ability being cast) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
      • Loop - Actions
        • Set LocTar = (Position of (Picked Unit))
        • Unit - Create 1 Tar for (Owner of (Triggering unit)) at LocTar facing 0.00 degrees
        • Custom script: call RemoveLocation(udg_LocTar)
        • Unit - Add Tar to (Last created unit)
        • Unit - Set level of Tar for (Last created unit) to (Integer((Real((Level of Tar Cannon for (Triggering Unit))))))
        • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
        • Unit - Add a 1.50 second generic expiration timer to last created unit.
But it still leaks ;/
 
Level 3
Joined
Feb 24, 2009
Messages
42
Okay, I'm currently looking at
  • Tar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tar Cannon
    • Actions
      • Set LocTarArea = (Target point of ability being cast)
      • Unit Group - Pick every unit in (Units within (100.00 x (Real((Level of Tar Cannon for (Triggering unit))))) of LocTarArea matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set LocTar = (Position of (Picked unit))
          • Unit - Create 1 Tar for (Owner of (Triggering unit)) at LocTar facing 0.00 degrees
          • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_LocTar)
          • Custom script: call RemoveLocation(udg_LocTarArea)
          • Unit - Add Tar to (Last created unit)
          • Unit - Set level of Tar for (Last created unit) to (Integer((Real((Level of Tar Cannon for (Triggering unit))))))
          • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
Leak Checker says
Code:
(Line: 8) (Word: 7) Unit Group Leak
Unit Group - Pick every unit in (Units within (100.00 x (Real((Level of Tar Cannon  for (Triggering unit))))) of LocTarArea matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
Unit Group - Pick every unit in [COLOR="Red"][B]^Leak[/B][/COLOR]


Fixed all the leaks but that one. How exactly do I patch up a unit group leak?
 
Level 18
Joined
Mar 13, 2009
Messages
1,411
First set a unit group variable = (Units within (100.00 x (Real((Level of Tar Cannon for (Triggering unit))))) of LocTarArea matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))

Then pick all units in (variable) and do the actions

Behind that list of actions (not inside it!!!) make a custom script that clears the group.

what is this strange line with "add tar to (last created unit)"?
normally you don't need something like that because "create unit" already sets the unit to the last created one.

and try using casting unit not triggering unit
I have been told that using triggering unit is faster as casting unit.

The Tar to last created unit isn't needed indeed.
 
Level 3
Joined
Feb 24, 2009
Messages
42
Still crashes ;/

According to LeakCheck there are no leaks.

  • Tar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tar Cannon
    • Actions
      • Set LocTarArea = (Target point of ability being cast)
      • Set GroupVar = (Units within (100.00 x (Real((Level of Tar Cannon for (Triggering unit))))) of LocTarArea matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
      • Unit Group - Pick every unit in GroupVar and do (Actions)
        • Loop - Actions
          • Set LocTar = (Position of (Picked unit))
          • Unit - Create 1 Tar for (Owner of (Triggering unit)) at LocTar facing 0.00 degrees
          • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_LocTar)
          • Custom script: call RemoveLocation(udg_LocTarArea)
          • Unit - Set level of Tar for (Last created unit) to (Integer((Real((Level of Tar Cannon for (Triggering unit))))))
          • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
          • Custom script: call DestroyGroup(udg_GroupVar)
Wtf is wrong?
 
Level 3
Joined
Feb 24, 2009
Messages
42
So what should I change the order strings to?

Its currently
Code:
Text - Order String - Activate   slowon
Text - Order String - Deactive  slowoff
Text - Order String - Turn Off    None
Text - Order String - Use/Turn Off Slow
 
Level 5
Joined
Apr 21, 2006
Messages
82
Thunder Clap

i'd say you should use Thunder Clap as slow ability since it's aoe it would be much more simple to do that way. If the base ability's AoE gets larger each level all you need to do is put lvls into Thunder Clap as well and put the same AoE in it which is in the base ability. Then just set the Dummy's Thunder Clap ability to same lvl as the base ability which is casted. You won't need Unit group then at all, just create dummy to the casted point, set the level of Thunder Clap and then cast it and last remove dummy and the leaks.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Tar Cannon
  • Actions
    • Set LocTarArea = (Target point of ability being cast)
    • Unit - Create 1 Tar for (Owner of (Casting Unit)) at LocTarArea facing 0.00 degrees
    • Set Dummy = (Last created unit)
    • -------- If the unit cannot have the ability already we'll just add it then. --------
    • Unit - Add TarThunderClap to Dummy
    • Unit - Set level of TarThunderClap for Dummy to (Level of (Ability being cast))
    • Unit - Order Dummy to Human Mountain King - Thunder Clap
    • Unit - Remove Dummy from the game
    • Custom script: call RemoveLocation(udg_LocTarArea)
EDIT: sry for long answer i was playing Gran Turismo 4 =p
 
Level 3
Joined
Feb 24, 2009
Messages
42
Gahh!

So when I put the remove unit from game function, it didn't have enough time to thunder clap, so I put on an expiration timer. It still crashes though!

  • Tar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tar Cannon
    • Actions
      • Set LocTarArea = (Target point of ability being cast)
      • Unit - Create 1 Tar Placer for (Owner of (Casting unit)) at LocTarArea facing 0.00 degrees
      • Set TarDummy = (Last created unit)
      • Unit - Add a 1.50 second Generic expiration timer to TarDummy
      • Unit - Add Tar Placer to TarDummy
      • Unit - Set level of Tar Placer for TarDummy to (Level of Tar Cannon for (Casting unit))
      • Unit - Order TarDummy to Human Mountain King - Thunder Clap
      • Custom script: call RemoveLocation(udg_LocTarArea)
 
Level 6
Joined
Mar 20, 2008
Messages
208
Nevermind, didn't see revised version.

Give the unit the ability in the world editor and get rid of the code that adds the ability to it. Don't know if that will help it not crash or anything but it will kncok off a line of code and help you figure it out.
 
Status
Not open for further replies.
Top