Need help with custom Ability (WarStomp, but for tower's missile)

LearningCode

New Member
Reaction score
24
Yea..
Basically, I wanted a tower to have a 20% chance to cause units in a 300AoE of the attacked unit to be stunned for 1.0 seconds.

So, tower attacks Creep.
Trigger calculates if it will Proc this time.
It does.
Trigger creates dummy unit at Attacked unit.
Trigger makes dummy cast WarStomp
Creeps are stunned
Trigger removes dummy from game

Easy enough.
But the problem is, that when I introduce the "Trigger calculates if it will proc", Even if I set the percentage to 100%, the trigger does not create the dummy unit at all.

This does not work:
Trigger:
  • Events
    • Unit - A unit owned by Player 12 (Brown) Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Basher
    • Actions
      • Custom script: local interger udg_BashChance
      • Custom script: local unit udg_Bash
      • Set BashChance = (Random integer number between 1 and 10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BashChance Less than 2
        • Then - Actions
          • Unit - Create 1 StunDummy for (Owner of (Attacking unit)) at (Position of (Attacked unit)) facing Default building facing degrees
          • Set Bash = (Last created unit)
          • Unit - Set level of War Stomp (Neutral Creep 1) for Bash to 1
          • Unit - Order Bash to Orc Tauren Chieftain - WarStomp
          • Unit - Remove Bash from the game
        • Else - Actions
      • Custom script: call RemoveUnit(udg_Bash)


This works, but I'd like to know if it is MUI:
Trigger:
  • Events
    • Unit - A unit owned by Player 12 (Brown) Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Basher
    • Actions
      • Custom script: local unit udg_Bash
      • Unit - Create 1 StunDummy for (Owner of (Attacking unit)) at (Position of (Attacked unit)) facing Default building facing degrees
      • Set Bash = (Last created unit)
      • Unit - Set level of War Stomp (Neutral Creep 1) for Bash to 1
      • Unit - Order Bash to Orc Tauren Chieftain - WarStomp
      • Unit - Remove Bash from the game
      • Custom script: call RemoveUnit(udg_Bash)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Just remove all of these lines !

Trigger:
  • Custom script: local interger udg_BashChance
    • Custom script: local unit udg_Bash


Trigger:
  • Custom script: local unit udg_Bash


They are not needed...

Also, remove this line from both triggers at least:
Trigger:
  • Custom script: call RemoveUnit(udg_Bash)


Also, are you sure that the dummy unit has the ability, as you're not adding it to it :S
 

LearningCode

New Member
Reaction score
24
Yea, it has the ability.
I always create a new dummy for each custom spell cos' I'm lazy to keep using the same dummy and use "Add ability" xD
A quirk, I guess.

And I fixed it after I posted my problem ._.
It works now but I want to know how to optimize it, like, remove all useless stuffs.

And is this MUI? =x
I realized that if I use "Custom script: call RemoveUnit(udg_Bash)", I don't have to use "Unit - Remove Bash from the game" xD
This is the working trigger:


Trigger:
  • Events
    • Unit - A unit owned by Player 12 (Brown) Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Basher
      • (Random integer number between 1 and 100) Less than or equal to 5
    • Actions
      • Custom script: local unit udg_Bash
      • Unit - Create 1 StunDummy for (Owner of (Attacking unit)) at (Position of (Attacked unit)) facing Default building facing degrees
      • Set Bash = (Last created unit)
      • Unit - Set level of War Stomp (Neutral Creep 1) for Bash to 1
      • Unit - Order Bash to Orc Tauren Chieftain - War Stomp
      • Custom script: call RemoveUnit(udg_Bash)


Don't I need to use local variables?
If not, when I use many towers.. only one tower would be able to bash at a time..
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yea, it has the ability.
I always create a new dummy for each custom spell cos' I'm lazy to keep using the same dummy and use "Add ability" xD
A quirk, I guess.

Hehe ok then, but units take up more memory than just a single action, you know...

And I fixed it after I posted my problem ._.
It works now but I want to know how to optimize it, like, remove all useless stuffs.

It has not useless stuff, except the custom scripts, and it leaks 1 point each...

And is this MUI? =x

Of course it's MUI... There's no wait or anything which would make it non-MUI, so yeah :D

I realized that if I use "Custom script: call RemoveUnit(udg_Bash)", I don't have to use "Unit - Remove Bash from the game" xD

Yeah ;)

Don't I need to use local variables?
If not, when I use many towers.. only one tower would be able to bash at a time..

Nope, remove them :D
 

Moridin

Snow Leopard
Reaction score
144
Locals would only be necessary for MUI if there's a wait where the variables would get overridden. Here, it's pretty much instantaneous.
 

LearningCode

New Member
Reaction score
24
Okay, guys, still learning the ropes of this thing =x

Locals would only be necessary for MUI if there's a wait where the variables would get overridden. Here, it's pretty much instantaneous.
So I only need locals if there is a wait in the trigger?
And I can use globals if there is no wait, right?

Hehe ok then, but units take up more memory than just a single action, you know...
So..
If I create a generic dummy and make the trigger give an ability to the dummy..
Do I have to make the trigger remove the ability from the dummy before destroying it?

It has not useless stuff, except the custom scripts, and it leaks 1 point each...
How do I fix it?

Nope, remove them
Okay, I'll remove them.
 

Ayanami

칼리
Reaction score
288
By using this trigger, won't the war stomp occur before the projectile actually hits the target? Or is there no projectile at all?

Anyway, this is how you remove the point leak.

From this,

Trigger:
  • Actions
    • Unit - Create 1 StunDummy for (Owner of (Attacking unit)) at (Position of (Attacked unit)) facing Default building facing degrees


Change it to this

Trigger:
  • Actions
    • Set TempPoint = (Position of (Attacked unit))
    • Unit - Create 1 StunDummy for (Owner of (Attacking unit)) at TempPoint facing Default building facing degrees
    • <All your other actions>
    • Custom script: call RemoveLocation(udg_TempPoint)
 

LearningCode

New Member
Reaction score
24
By using this trigger, won't the war stomp occur before the projectile actually hits the target?

Oh. yea...
LOL!
I never thought of that, umm..
How do I make it stun as the missile hits if I want to not use a wait command xD

I'll go fix the leak point now, thanks =)
 

Ayanami

칼리
Reaction score
288
Here's the way to do it. Give the tower an ability based on "Envenomed Spears". But firstly, implement this GDD System made by Weep. Set the the damage dealt by the ability to 0 and the duration to whatever you want (doesn't really matter). I'll name the buffs from the "Envenomed Spears" as "Buff Placer (Non-stacking)" and "Buff Placer (Stacking)" in the trigger.

Trigger:
  • Stomp
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • Or - Any (Conditions) are true
        • GDD DamagedUnit has buff Buff Placer (Non-stacking) Equal to True
        • GDD_DamagedUnit has buff Buff Placer (Stacking) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • <Your actions here>
      • Unit - Remove Buff Placer buff (Non-stacking) from GDD_DamagedUnit
      • Unit - Remove Buff Placer buff (Stacking) from GDD_DamagedUnit
      • Trigger - Turn on (This trigger)
 

LearningCode

New Member
Reaction score
24
I should have joined this website a long time ago, would have learnt a lot by now =/
Implementing it now, then checking it out.

Thanks for all the help!
I'll post again if I have problems.
 

LearningCode

New Member
Reaction score
24
Erm..
Okay, I'm lost again.

Installation of GUI-friendly damage detection: Check
Applying trigger you gave me: err..

I made sure the ability based off envenom spears gave the Poison buff (Both of them)
I gave the ability to my tower
The ability has a cast range Equal to my tower range
I even made the duration 999 and made it do 0.01 damage per second

No luck, it won't stun
The trigger I'll post was with the chance to stun set at 100%
And I only built ONE tower, so it shouldn't be clashing with anything else

Trigger:
  • Events
    • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • ((GDD_DamagedUnit has buff Poison (Non-Stacking)) Equal to True) or ((GDD_DamagedUnit has budd Poison (Stacking)) Equal to True)
    • Actions
      • Trigger - Turn off (This trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 100)
        • Then - Actions
          • Set TempPointStun = (Position of (Attacked unit))
          • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at TempPointStun facing Default building facing degrees
          • Unit - Add War Stomp (Neutral Hostile 1) to (Last Created Unit)
          • Unit - Set level of War Stomp (Neutral Hostile 1) for (Last created unit) to 1
          • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
          • Unit - Remove (Last created unit) from the game
          • Custom script: call RemoveLocation(udg_Temp_PointStun)
        • Else - Actions
      • Unit - Remove Poison (Non-stacking) buff from GDD_DamagedUnit
      • Unit - Remove Poison (Stacking) buff from GDD_DamagedUnit
      • Trigger - Turn on (This trigger)


I tried adding "Custom script: local location udg_TempPointStun" above "Trigger - Turn off (This trigger)" but it didn't work either.

Any help?
 

Ayanami

칼리
Reaction score
288
Ah, here's the mistake. In this trigger, we're talking about damage detection. So attacked unit and attacking unit is not recognized. In this case:

Attacking unit = GDD_DamageSource
Attacked unit = GDD_DamagedUnit
 

LearningCode

New Member
Reaction score
24
I just tried that, it didn't work either =/

I copied over the GDD trigger category from the link you gave me that has the 'GDD Variable Creator' and 'GUI Friendly Damage Detection' triggers.
I also have the correct Real, Unit, Unit-group, Trigger array, Integer array and Unit array variables..

=/

Lost.
 

Ayanami

칼리
Reaction score
288
For your Envenomed Spears ability, did you ensure that "Techtree - Requirements" are set to null?
 

LearningCode

New Member
Reaction score
24
Sure.

Trigger:
  • Events
    • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • ((GDD_DamagedUnit has buff Poison (Non-Stacking)) Equal to True) or ((GDD_Damaged Unit has buff Poison (Stacking)) Equal to True)
    • Actions
      • Trigger - Turn off (This trigger)
      • If (All Conditions are True) then do (Then actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 100
        • Then - Actions
          • Set Temp_PointStun = (Position of GDD_DamagedUnit)
          • Unit - Create 1 Dummy for (Owner of GDD_DamageSource) at Temp_PointStun facing Default building facing degrees
          • Unit - Add War Stomp (Neutral Hostile 1) to (Last created unit)
          • Unit - Set level of War Stomp (Neutral Hostile 1) for (Last created unit) to 1
          • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
          • Unit - Remove (Last created unit) from the game
          • Custom script: call RemoveLocation(udg_TempPointStun)
        • Else - Actions
      • Unit - Remove Poison (Non-Stacking) buff from GDD_DamagedUnit
      • Unit - Remove Poison (Stacking) buff from GDD_DamagedUnit
      • Trigger - Turn on (This trigger)
 

LearningCode

New Member
Reaction score
24
The Ability I based off envenom is Custom.
I just changed the description, tooltip, duration ,etc.

But the buff, I did not touch, it's still the default buff that envenom spears has.
The Targets, I changed at least 4 times.
I tried:
Enemy - Failed
Enemy, Air, Ground, Organic - Failed
Organic, Mechanical - Failed
Enemy, Organic, Mechanical - Failed

Can't remember what else I tried, lol.


[Edit]

I got it to work, But without the envenom spears thing.

I put this as the Condition:
(Unit-type of GDD-DamageSource) Equal to Basher

And it magically worked, lol.
Removed the "Turn off" And "Turn on" Actions
And the actions regarding the buff
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top