[Trigger] Problem with Ability Trigger 2

Status
Not open for further replies.
Level 6
Joined
Aug 19, 2007
Messages
109
Heres another ability trigger in my map where ability is meant to:
-Every time COTG(A Hero unit which stays the same throughout the entire game) casts an ability which' order string is "shockwave" (Note:No other ability the hero has, uses that order string)
-Then it creates a unit which has the "Phoenix fire" ability and damages nearby units and:
-Then orders the last created unit to patrol to position of ordered point.
-It gives that same unit an expiration timer.

But heres there problem: It works only once, when I try to cast the ablity again, the unit isnt created- thus the trigger doesnt work and something must be wrong but what??:cry::eekani:
  • Throw Sword
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Ordered unit) Equal to COTG
      • (Issued order) Equal to (Order(shockwave))
    • Actions
      • Set Temp_Point = (Target point of issued order)
      • Set Temp_Point2 = (Position of COTG)
      • Unit - Create 1 Thrown Sword for (Owner of COTG) at Temp_Point2 facing (Facing of COTG) degrees
      • Unit - Order (Last created unit) to Patrol To Temp_Point
      • Unit - Add Sword Cut (For Thrown Sword COTG) to (Last created unit)
      • Unit - Set level of Sword Cut (For Thrown Sword COTG) for (Last created unit) to (Level of Throw Sword (Dummy Shockwave) for COTG)
      • Unit - Add a 4.50 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: call RemoveLocation (udg_Temp_Point2)
Note:The ability sword cut is the phoenix fire one, and throw sword is the dummy ability the Hero COTG has.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Huh? If COTG casts shockwave, it creates a Trown Sword with Sword Cut ability which level is equal to the level of the COTG's Trow Sword ability? I think the issued order should also be Throw Sword. Anyway, That doesn't solve your problem I think. I don't know what could cause the ability to only work once, since your points are created and destroyed in the same trigger.
 
Level 6
Joined
Aug 19, 2007
Messages
109
Lol i tried that Squiggly, ten a new problem arises lol.
  • Throw Sword Test
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Casting unit) Equal to COTG
      • (Ability being cast) Equal to Throw Sword (Dummy Shockwave)
    • Actions
      • Set Temp_Point = (Target point of ability being cast)
      • Set Temp_Point2 = (Position of COTG)
      • Unit - Create 1 Thrown Sword for (Owner of COTG) at Temp_Point2 facing (Facing of COTG) degrees
      • Unit - Order (Last created unit) to Patrol To Temp_Point
      • Unit - Add Sword Cut (For Thrown Sword COTG) to (Last created unit)
      • Unit - Set level of Sword Cut (For Thrown Sword COTG) for (Last created unit) to (Level of Throw Sword (Dummy Shockwave) for COTG)
      • Unit - Add a 4.50 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: call RemoveLocation (udg_Temp_Point2)
The new problem:The "thrown sword" unit attempts to move to center of playable map area instead of casting target point... but then of course dies because of expiration timer.:thumbs_down::eekani::cry: More help plz lol thanks for trying though. I somehow gotta fix that problem then ability would work D:. But that means theres something wrong with "Temp_Point"...But i dun c anything wrong with (Target point of ability being cast) I needs urgent help! lol

Edit:Yo here i tried making EVERYTHING a variable cept unit type:
  • Throw Sword Test
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Casting unit) Equal to COTG
      • (Ability being cast) Equal to Throw Sword (Dummy Shockwave)
    • Actions
      • Set Temp_Point = (Target point of ability being cast)
      • Set Temp_Point2 = (Position of COTG)
      • Unit - Create 1 Thrown Sword for (Owner of COTG) at Temp_Point2 facing (Facing of COTG) degrees
      • Set Special_Unit_COTG = (Last created unit)
      • Unit - Order Special_Unit_COTG to Patrol To Temp_Point
      • Unit - Add Sword Cut (For Thrown Sword COTG) to Special_Unit_COTG
      • Unit - Set level of Sword Cut (For Thrown Sword COTG) for Special_Unit_COTG to (Level of Throw Sword (Dummy Shockwave) for COTG)
      • Unit - Add a 3.50 second Generic expiration timer to Special_Unit_COTG
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: call RemoveLocation (udg_Temp_Point2)
But same thing happens. It HAS to be to do with "Temp_Point" becoz thats where the problem lies in. The Thrown sword flying to center of playable map instead of target place as it shud do D:.
 
Last edited:
Level 6
Joined
Aug 19, 2007
Messages
109
DarkangelAzazel: Even if i use event "a unit finishes casting an ability" you can still use the condition "Position of ability being cast". Its just different tense is all.

Squiggy:
  • Throw Sword Test
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Casting unit) Equal to COTG
      • (Ability being cast) Equal to Throw Sword (Dummy Shockwave)
    • Actions
      • Set Temp_Point = (Position of (Target unit of ability being cast))
      • Set Temp_Point2 = (Position of COTG)
      • Unit - Create 1 Thrown Sword for (Owner of COTG) at Temp_Point2 facing (Facing of COTG) degrees
      • Set Special_Unit_COTG = (Last created unit)
      • Unit - Order Special_Unit_COTG to Patrol To Temp_Point
      • Unit - Add Sword Cut (For Thrown Sword COTG) to Special_Unit_COTG
      • Unit - Set level of Sword Cut (For Thrown Sword COTG) for Special_Unit_COTG to (Level of Throw Sword (Dummy Shockwave) for COTG)
      • Unit - Add a 3.50 second Generic expiration timer to Special_Unit_COTG
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: call RemoveLocation (udg_Temp_Point2)
Tried it, no luck. What happens is the Throw Sword unit just stays still, where it wuz created.(Postition of casting unti).-At least there was a difference lol.. just another dea end D:.:eekani:

Avator:Creating a dummy unit at th position wtf? that defeats the whole point of having variables in the trigger, might aswell order the Thrown Sword to patrol to position of ability being cast straight like that. Having variables is to clean up da EVIL DREADED memory leaks lol.
Also:If i create da dummy unit at said place, a new memory leak is added D: i h8 leaks, especially the electronic kind lol.:cry: Soz but no go :confused:.

I URGENTLY NEED DA ANSWER lol:razz:sum1 get a brainwave and tell me why its wrong.D:
 
Level 6
Joined
Aug 19, 2007
Messages
109
Ah but that's the thing, you see, when i place the dummy unit, it needs a position to be placed at-thus a memory leak unless i use a variable which is what Temp_Point is for.
Edit:I tried it anyway and guess what: No effect, same thing happened... lol no surprises there. Just creates a new memory leak.
  • Throw Sword Test
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Casting unit) Equal to COTG
      • (Ability being cast) Equal to Throw Sword (Dummy Shockwave)
    • Actions
      • Unit - Create 1 Royal Guard (Captain of the Guard) for (Owner of COTG) at (Target point of ability being cast) facing Default building facing degrees
      • -------- Note:The above action is to show me exactly where the dummy was created. --------
      • Unit - Create 1 Dummy for (Owner of COTG) at (Target point of ability being cast) facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Set Temp_Point = (Position of (Last created unit))
      • Set Temp_Point2 = (Position of COTG)
      • Unit - Create 1 Thrown Sword for (Owner of COTG) at Temp_Point2 facing (Facing of COTG) degrees
      • Set Special_Unit_COTG = (Last created unit)
      • Unit - Order Special_Unit_COTG to Patrol To Temp_Point
      • Unit - Add Sword Cut (For Thrown Sword COTG) to Special_Unit_COTG
      • Unit - Set level of Sword Cut (For Thrown Sword COTG) for Special_Unit_COTG to (Level of Throw Sword (Dummy Shockwave) for COTG)
      • Unit - Add a 3.50 second Generic expiration timer to Special_Unit_COTG
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: call RemoveLocation (udg_Temp_Point2)
The royal guard was created at center of playable map area...:cry:
 
Status
Not open for further replies.
Top