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 The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      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