Ability won't trigger more than once?

nabbig2

New Member
Reaction score
43
When an ability, Grenade for Dummy is cast, there is another trigger that works and creates a projectile. The problem is that it is only working once, and I want it to work 3 or 4 times so that many missiles are sent.

This is the trigger:

Code:
Grenade Copy
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Grenade 
    Actions
        Set F_Pt_Grenade_TriggerPos = (Position of (Triggering unit))
        Set F_Pt_Grenade_TargetPos = (Target point of ability being cast)
        Unit - Create 1 Dummy grenade 2 for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
        Unit - Add Grenade for dummy to (Last created unit)
        Unit - Set level of Grenade for dummy for (Last created unit) to (Level of Grenade  for (Triggering unit))
        Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire (Target point of ability being cast)

So when the Ability is cast in this trigger, the other trigger works successfully. The problem is that when I try to have the Ability be cast more than once, it doesn't work, for some damn reason. I tried putting a wait and ordering the dummy to cast again (I did use variables), I tried ordering the dummy to cast it more than once, but I have no clue why it works only once, I also tried using Integer A. Thanks a lot, +rep.
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Your trigger there should work fine.

Code:
        Set F_Pt_Grenade_TriggerPos = (Position of (Triggering unit))
        Set F_Pt_Grenade_TargetPos = (Target point of ability being cast)
        Unit - Create 1 Dummy grenade 2 for (Owner of (Triggering unit)) at [COLOR="Red"]F_Pt_Grenade_TriggerPos [/COLOR]facing Default building facing degrees
        Unit - Add Grenade for dummy to (Last created unit)
        Unit - Set level of Grenade for dummy for (Last created unit) to (Level of Grenade  for (Triggering unit))
        Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire [COLOR="Red"]F_Pt_Grenade_TargetPos[/COLOR])
       [COLOR="DeepSkyBlue"]Custom Script: call RemoveLocation(udg_F_Pt_Grenade_TargetPos)
       Custom Script: call RemoveLocation(udg_F_Pt_Grenade_TriggerPos)[/COLOR]
Add the blue lines, change the red lines, together they fix the leaks.
Now, show us the other trigger, cause this trigger works over and over again as long as the trigger is not turned off anywhere...

PS: What is it supposed to do? What works only once? The effect of the Rain of Fire, it damages only once and you want it to repeat? If so, how about changing the number of waves in object editor > abilities > rain of fire...
 

nabbig2

New Member
Reaction score
43
Well here are the other triggers (the spell is taken from Vypur's template)

Code:
Map Init for Grenade
    Events
        Map initialization
    Conditions
    Actions
        Set F_Abi_Grenade = Grenade 
        Set F_Abi_Grenade_Copy = Grenade for dummy
        Set F_UnitType_Bullet_Grenade = Dummy grenade
        -------- Settings --------
        Set F_Real_Set_AOE = 350.00
        Set F_Real_Set_Damage = 200.00
        Set F_Real_Set_DamagePerLevel = 75.00
        Set F_Real_Set_Height = 100.00

Code:
Grenade
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Ability being cast) Equal to F_Abi_Grenade
                (Ability being cast) Equal to Grenade for dummy
    Actions
        Set F_Pt_Grenade_TriggerPos = (Position of (Triggering unit))
        Set F_Pt_Grenade_TargetPos = (Target point of ability being cast)
        Unit - Create 1 F_UnitType_Bullet_Grenade for (Owner of (Triggering unit)) at F_Pt_Grenade_TriggerPos facing (Angle from F_Pt_Grenade_TriggerPos to F_Pt_Grenade_TargetPos) degrees
        Unit - Add F_Abi_Grenade to (Last created unit)
        Unit - Set level of F_Abi_Grenade for (Last created unit) to (Level of F_Abi_Grenade for (Triggering unit))
        Unit - Set life of (Last created unit) to ((Distance between F_Pt_Grenade_TriggerPos and F_Pt_Grenade_TargetPos) / 120.00)
        Unit - Turn collision for (Last created unit) Off
        Unit Group - Add (Last created unit) to F_Unitgp_Grenade_Move
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Grenade Movement <gen> is on) Equal to False
            Then - Actions
                Trigger - Turn on Grenade Movement <gen>
            Else - Actions
        Custom script:   call RemoveLocation (udg_F_Pt_Grenade_TriggerPos)
        Custom script:   call RemoveLocation (udg_F_Pt_Grenade_TargetPos)

Code:
Grenade Movement
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in F_Unitgp_Grenade_Move and do (Actions)
            Loop - Actions
                Set F_Unit_Grenade_PickedUnit = (Picked unit)
                Set F_Pt_Grenade_PickedPos = (Position of (Picked unit))
                Set F_Pt_Grenade_TargetPos = (F_Pt_Grenade_PickedPos offset by (Life of (Picked unit)) towards (Facing of (Picked unit)) degrees)
                Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
                Unit - Move (Picked unit) instantly to F_Pt_Grenade_TargetPos
                Set F_Real_Grenade_FlyHeight = ((Power(60.00, 2.00)) - (Power(((Real((Custom value of (Picked unit)))) - 60.00), 2.00)))
                Animation - Change (Picked unit) flying height to (F_Real_Grenade_FlyHeight / (3600.00 / F_Real_Set_Height)) at 0.00
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Custom value of (Picked unit)) Greater than or equal to 120
                    Then - Actions
                        Set F_Unitgp_Grenade_AOE = (Units within 350.00 of F_Pt_Grenade_PickedPos matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True) and (((Matching unit) is alive) Equal to True))))
                        Unit Group - Pick every unit in F_Unitgp_Grenade_AOE and do (Actions)
                            Loop - Actions
                                Unit - Cause F_Unit_Grenade_PickedUnit to damage (Picked unit), dealing ((Real((Point-value of (Unit-type of F_Unit_Grenade_PickedUnit)))) x 1.00) damage of attack type Spells and damage type Magic
                        Special Effect - Create a special effect at F_Pt_Grenade_PickedPos using Units\NightElf\Wisp\WispExplode.mdl
                        Special Effect - Destroy (Last created special effect)
                        Special Effect - Create a special effect at F_Pt_Grenade_PickedPos using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                        Special Effect - Destroy (Last created special effect)
                        Unit - Remove (Picked unit) from the game
                        Custom script:   call DestroyGroup (udg_F_Unitgp_Grenade_AOE)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain pathing at F_Pt_Grenade_PickedPos of type Walkability is off) Equal to True
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Facing of (Picked unit)) Greater than or equal to 0.00
                                (Facing of (Picked unit)) Less than 180.00
                            Then - Actions
                                Unit - Make (Picked unit) face ((Facing of (Picked unit)) + 10.00) over 0.00 seconds
                            Else - Actions
                                Unit - Make (Picked unit) face ((Facing of (Picked unit)) - 10.00) over 0.00 seconds
                    Else - Actions
                Custom script:   call RemoveLocation (udg_F_Pt_Grenade_TargetPos)
                Custom script:   call RemoveLocation (udg_F_Pt_Grenade_PickedPos)

Well rain of fire is simply the Order ID for the Ability, which is based off of channel. Each time this ability is cast, a dummy unit shaped like an arrow is shot, and I want to have 3 or 4 of these "arrows".

I am also using this trigger to test if the ability is cast:

Code:
Untitled Trigger 001
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Grenade for dummy
    Actions
        Unit - Create 1 Footman for Player 1 (Red) at (Center of duncesplayer1 <gen>) facing Default building facing degrees

See the problem isthat Grenade for Dummy needs to be somehow cast more times, so that those other triggers will run and I can get more arrows. But for some reason, it won't cast, and footmen aren't created more than once each time I use the ability.
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Hmm... care to upload the map instead, or a new map with the spell/units inside it? Your trigger was longer than I hoped for! :p
 

vypur85

Hibernate
Reaction score
803
Oh crab. =.= No wonder I felt familiar with the variable names you used.

So what do you want? Throw multiple grenades? Grenades are thrown simultaneously or intervally? I can try fix it for your own needs.
 

nabbig2

New Member
Reaction score
43
I want multiple grenades to be thrown, in the same line of fire as the first one, is all. Just like shooting a volley of arrows one right after the other, thanks. Also I can list your name under Credits in my map if you want.
 

vypur85

Hibernate
Reaction score
803
Code:
Grenade
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to F_Abi_Grenade
    Actions
        Custom script:   local location udg_F_Pt_Grenade_TargetPos
        Custom script:   local integer i = 0
        Set F_Pt_Grenade_TargetPos = (Target point of ability being cast)
        Custom script:   loop
        Custom script:   exitwhen i == 5
        Custom script:   set i = i + 1
        Set F_Pt_Grenade_TriggerPos = (Position of (Triggering unit))
        Unit - Create 1 F_UnitType_Bullet_Grenade for (Owner of (Triggering unit)) at F_Pt_Grenade_TriggerPos facing (Angle from F_Pt_Grenade_TriggerPos to F_Pt_Grenade_TargetPos) degrees
        Unit - Add F_Abi_Grenade to (Last created unit)
        Unit - Set level of F_Abi_Grenade for (Last created unit) to (Level of F_Abi_Grenade for (Triggering unit))
        Unit - Set life of (Last created unit) to ((Distance between F_Pt_Grenade_TriggerPos and F_Pt_Grenade_TargetPos) / 120.00)
        Unit - Turn collision for (Last created unit) Off
        Unit Group - Add (Last created unit) to F_Unitgp_Grenade_Move
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Grenade Movement <gen> is on) Equal to False
            Then - Actions
                Trigger - Turn on Grenade Movement <gen>
            Else - Actions
        Custom script:   call RemoveLocation (udg_F_Pt_Grenade_TriggerPos)
        Wait 0.10 game-time seconds
        Custom script:   endloop
        Custom script:   call RemoveLocation (udg_F_Pt_Grenade_TargetPos)
        Custom script:   set udg_F_Pt_Grenade_TargetPos = null

Not sure if this would work. But it should create 5 grenades at 0.1 seconds intervals (the interval may be inaccurate, but it doesn't matter). The above is not tested. Hope it doesn't compile error. Other triggers remain the same.
 

Attachments

  • Grenade Multiple.w3x
    20.8 KB · Views: 82
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • 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 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