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

Spell Rock Trap

Status
Not open for further replies.
Level 10
Joined
Apr 13, 2005
Messages
630
I got this problem with this spell. Its based off Roots and it cast on an enemy unit then the triggers kicks in. its MUI and suppose to create a dummy then cast it on all the enemys within 1000 range. The problem is One the hero keeps casting the spell once the cooldown ends and next the trigger wont create the dummy that will cast the spells

  • Rock Trap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rock Trap
    • Actions
      • Set RocktrapUnits = (Casting unit)
      • Set Positionofcaster = (Position of RocktrapUnits)
      • Set RockTrapPoint = (Units within 1000.00 of Positionofcaster matching (((Matching unit) belongs to an enemy of (Owner of RocktrapUnits)) Equal to True))
      • Floating Text - Create floating text that reads Rock Trap above RocktrapUnits with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
      • Unit Group - Pick every unit in RockTrapPoint and do (Actions)
        • Loop - Actions
          • Set RockEnemy = (Picked unit)
          • Unit - Create 1 Dummy (Rock Trap) for (Owner of RocktrapUnits) at (Position of RocktrapUnits) facing Default building facing degrees
          • Set RockDummy = (Last created unit)
          • Unit - Order RockDummy to Night Elf Tree Of Life - Entangle RockEnemy
          • Unit - Add a 2.00 second Generic expiration timer to RockDummy
      • Custom script: call DestroyGroup(udg_RockTrapPoint)
      • Custom script: call RemoveLocation(udg_Positionofcaster)
      • Set RockEnemy = No unit
      • Set RocktrapUnits = No unit
 
Last edited:
Level 24
Joined
Jun 16, 2008
Messages
1,939
first in the set rocktrappoint use matching unit instead of triggering unit

what is the false equal to true part?
better null the rocktrapdummyinside the loop

i think u dont need the do nothing part

and notice, it is not rly mui, only the short interval of wait 0.1 seconds doesnt rly interfer the game, but dont use waits in functions, if u do, use ingame waits
 
Level 10
Joined
Apr 13, 2005
Messages
630
first in the set rocktrappoint use matching unit instead of triggering unit

what is the false equal to true part?
better null the rocktrapdummyinside the loop

i think u dont need the do nothing part

and notice, it is not rly mui, only the short interval of wait 0.1 seconds doesnt rly interfer the game, but dont use waits in functions, if u do, use ingame waits

Wut are you talking about rocktrappoint shoudl be matching instead of triggering its unitgroup variable?

*edit* opps that was a typo i meant to fix lol

and thanks for the .01

any ideas tho on why the Casting unit keeps casting the spell though?

*new Trigger look*

  • Rock Trap
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Rock Trap
    • Actions
      • Set RocktrapUnits = (Casting unit)
      • Set RockTrapPoint = (Units within 1000.00 of (Position of RocktrapUnits) matching (((Matching unit) belongs to an enemy of (Owner of RocktrapUnits)) Equal to True))
      • Floating Text - Create floating text that reads Rock Trap above RocktrapUnits with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Wait 0.10 game-time seconds
      • Floating Text - Destroy (Last created floating text)
      • Unit Group - Pick every unit in RockTrapPoint and do (Actions)
        • Loop - Actions
          • Set RockEnemy = (Picked unit)
          • Unit - Create 1 Dummy (Rock Trap) for (Owner of RocktrapUnits) at (Position of RocktrapUnits) facing Default building facing degrees
          • Set RockDummy = (Last created unit)
          • Unit - Order RockDummy to Night Elf Tree Of Life - Entangle RockEnemy
          • Unit - Add a 2.00 second Generic expiration timer to RockDummy
          • Wait 2.00 game-time seconds
          • Set RockDummy = No unit
      • Custom script: call DestroyGroup(udg_RockTrapPoint)
      • Set RockEnemy = No unit
      • Set RocktrapUnits = No unit
 
Level 7
Joined
Jul 20, 2008
Messages
377
  • Unit - A unit Begins casting an ability
Change that to Unit Finishes Casting an Ability. When you have it set for an unit beginning to cast the ability, you run into the risk of interrupting that unit's casting and forcing it to try again. I think that's what happened in your situation.
 
Level 12
Joined
Aug 22, 2008
Messages
911
Lol, Tree of Life's entangle can be used on only one target per unit.
And if you want to use the hero ability entangle the use:
Night Elf - Keeper of the Grove - Entangle
Also, your variable RockEnemy needs to be an array, it can't have the value of more than 1 unit at a time.
And OMG, your condition is (False equal to True). Do you see that it will never work?
Also, no unit can cast multiple spells at the same time or cast the same spell at different targets at the same time.
Finally, you should match the spell to the dummy unit by setting the mana cost and cooldown to 0.
 
Level 10
Joined
Apr 13, 2005
Messages
630
Lol, Tree of Life's entangle can be used on only one target per unit.
And if you want to use the hero ability entangle the use:
Night Elf - Keeper of the Grove - Entangle
Also, your variable RockEnemy needs to be an array, it can't have the value of more than 1 unit at a time.
And OMG, your condition is (False equal to True). Do you see that it will never work?
Also, no unit can cast multiple spells at the same time or cast the same spell at different targets at the same time.
Finally, you should match the spell to the dummy unit by setting the mana cost and cooldown to 0.


You didnt see the other trigger i posted as an update cuz half those things were included.

you dont add the root spell to ur dummy

Its already been added to the unit so why readd?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Be nice people.
Taking it that the dummy unit already knows the ability (via the object editor).

Unit - A unit Begins casting an ability
This is buggy and can result in errors like able to cast without mana cost.
Use the "starts effect" or something simlar as your generic unit event.

Set RockTrapPoint = (Units within 1000.00 of (Position of RocktrapUnits) matching (((Matching unit) belongs to an enemy of (Owner of RocktrapUnits)) Equal to True))
This line leaks a location as you never remove the location "(Position of RocktrapUnits)".

Unit - Create 1 Dummy (Rock Trap) for (Owner of RocktrapUnits) at (Position of RocktrapUnits) facing Default building facing degrees
This line leaks a location for each unit as you never remove the location "(Position of RocktrapUnits)".

Wait 2.00 game-time seconds inside an enum (for group loop) results in the thread being abborted and so all code below that point not being run. This is probably a large cause for it to not work so you have no option but to remove it.

Set RockDummy = No unit
This line is pointless inside a group loop as it will be imediatly overwritten by the unit after it in the group. If you must use it, use it after the loop finishes.

Floating Text - Create floating text that reads Rock Trap above RocktrapUnits with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Wait 0.10 game-time seconds
Floating Text - Destroy (Last created floating text)
This is pointless and removes the MUI of the spell. Rather create the text tag, make it not permant and set its life to 1-2 seconds and get it to fade. Doing this will avoid buggy and nasty TriggerSleepAction and also make it look better ingame as well as be more efficent.
 
Level 10
Joined
Apr 13, 2005
Messages
630
nope ill post the trigger in the sec the new updated one on bottom and top

  • Rock Trap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rock Trap
    • Actions
      • Set RocktrapUnits = (Casting unit)
      • Set Positionofcaster = (Position of RocktrapUnits)
      • Set RockTrapPoint = (Units within 1000.00 of Positionofcaster matching (((Matching unit) belongs to an enemy of (Owner of RocktrapUnits)) Equal to True))
      • Floating Text - Create floating text that reads Rock Trap above RocktrapUnits with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
      • Unit Group - Pick every unit in RockTrapPoint and do (Actions)
        • Loop - Actions
          • Set RockEnemy = (Picked unit)
          • Unit - Create 1 Dummy (Rock Trap) for (Owner of RocktrapUnits) at (Position of RocktrapUnits) facing Default building facing degrees
          • Set RockDummy = (Last created unit)
          • Unit - Order RockDummy to Night Elf Tree Of Life - Entangle RockEnemy
          • Unit - Add a 2.00 second Generic expiration timer to RockDummy
      • Custom script: call DestroyGroup(udg_RockTrapPoint)
      • Custom script: call RemoveLocation(udg_Positionofcaster)
      • Set RockEnemy = No unit
      • Set RocktrapUnits = No unit
 
Level 24
Joined
Jun 16, 2008
Messages
1,939
lol, i think u are ceating one dummy for each enemy in the area? that means the cooldown doesnt matter because the dummy is supposed to cast only once and then to be removed from the game, eh?

so, whats ur problem, 'the caster keeps on casting the ability'

what that supposed to mean? maybe u made it a channeling ability? look at the duration u've set for it....
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
It does not matter, all he has to do to fix it is to change the action inside the loop to
Unit - Order RockDummy to Night Elf Keeper Of The Grove - Entangling Roots RockEnemy

Currently he is ordering a tree of ancients to root, which obviously will not work as that is not what he is after.
 
Level 10
Joined
Apr 13, 2005
Messages
630
Ok well i did wut you said but still the guy seems to non stop cast. I changed the event to finishes the effect n keep it at the starts and both time it does seem to keep casting. The ability seems to just run the first time and as soon as the ability effect is done the hero recasts

*edit* OK well i got the spell to work but that bug still is their. Also I'm a noob at making Floating text lol and it wont remove it or set the expire time i did this as a trigger. Look under this for the trigger for Floating text.

  • Floating Text - Create floating text that reads Rock Trap above RocktrapUnits with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
  • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
  • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
 
Last edited:
Level 10
Joined
Apr 13, 2005
Messages
630
Super did you get my pm I sent you with the map? if so did u test it out and see the bug I'm talking about?

*edit Ok i fixed the bug with the non stop casting stuff. it was because of this
"Techtree - Check Dependencies (it was false)True"

I still have a Floating Text problem though
 
Last edited:
Level 10
Joined
Jun 1, 2008
Messages
485
After you destroy a global variable group, you must recreate it.
Try use this action:
  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Execution count of (This trigger)) Not equal to (!=) 1
    • Then - Actions
      • Set <your group> = (Create Unit Group)
      • Set <your group> = (CreateGroup())
      • Custom script: set udg_<you_group>=CreateGroup()
    • Else - Actions
use one of that "create group" function. the first and second one is added by JNGP.
 
Level 10
Joined
Apr 13, 2005
Messages
630
i figured both of those already. I found out wut the problem was. On the check tech stuff i check off false. It had to be check as true. But there still is a problem. It works perfect the first wave but if the boss hits a unit that wasnt targeted by the spell he will autocast it
 
Status
Not open for further replies.
Top