Ability won't trigger more than once?

nabbig2

New Member
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...
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
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...
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
 

nabbig2

New Member
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
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

General chit-chat
Help Users
  • No one is chatting at the moment.
  • jonas jonas:
    I took the whole december off and had lots of plans... Train, practice my Chinese, develop my own projects... In the end I ended up just playing borderlands 3:cool:
  • C Cherry.Grove:
    So what's the whole reforged situation? Do we have to run the classic version bootleg now?
  • C Cherry.Grove:
    My boyfriend is super into Bethesda modding so I'm probably going to join him in that for a bit, then move on to making mobile/browser games.
  • C Cherry.Grove:
    I mostly just want to look at my old projects because I know I posted uploads on here somewhere.
  • C Cherry.Grove:
    My one game was basically Among Us but you sabotaged an entire medieval city simulated drastically inefficiently with dynamic NPCs :S
  • C Cherry.Grove:
    of course I never finished it x D
  • jonas jonas:
    xD
  • jonas jonas:
    I think you can still run the original game, just there's a chance your map won't work with the newer patches
  • jonas jonas:
    what development framework have you been looking at for mobile development?
  • jonas jonas:
    I'm currently creating (as a hobby) a space invaders like game for mobile using Xamarin, after starting a few larger projects that I also may not have finished :rolleyes::p
  • The Helper The Helper:
    Awesome! you should look at the Atari VCS platform it does not have a huge user base but the one it has is super active at around 11k and they have no games in there store
  • The Helper The Helper:
    basically it is linux
  • The Helper The Helper:
    OMG it is BanLord as Blackveiled on the forum
  • The Helper The Helper:
    what is up buddy
  • jonas jonas:
    thanks for the tip, that sounds cool. Never heard about the VCS before but seems like it should be a good match
  • tom_mai78101 tom_mai78101:
    The winter vacation left a toll on me. I missed staying up late and sleeping in late.
  • C Cherry.Grove:
    i haven't looked into it yet
  • C Cherry.Grove:
    If I could use something Python compatible it would save me some learning
  • C Cherry.Grove:
    But Unity might be easiest
  • C Cherry.Grove:
    looking at old posts here makes me happy. Makes me be all like "wow I was pretty smart in 2009"
  • C Cherry.Grove:
    mostly failing at life through adulthood really demotivated me for a while
  • C Cherry.Grove:
    ....what I don't get is why the fuck they would force us to permanently convert to a version of the game everyone fucking hated : \
  • C Cherry.Grove:
    Raid Shadow Legends texture pack smh
  • jonas jonas:
    Most people fail at life throughout their adulthood. Sometimes we get to learn from it. Usually it just feels like crap.

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome
    Top