GUI trigger problem

Nudl9

New Member
Reaction score
13
I believe my brain is sleeping, because im not able to find the problem.
In the second trigger the dmg and knockback only works for 1 unit (this is the problem) and the dmg seems a bit random.

The spell is a grenade launcher
Trigger 1 (Fire Trigger)
Code:
Fire Grenade Launcher
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Fire Grenade Launcher 
    Actions
        Set TempPoint1 = (Position of (Triggering unit))
        Set TempPoint2 = (Target point of ability being cast)
        Set TempPoint3 = (TempPoint1 offset by 50.00 towards (Angle from TempPoint1 to TempPoint2) degrees)
        --------   --------
        Sound - Play BoatAttack1 <gen> at 100.00% volume, located at TempPoint3 with Z offset 0.00
        --------   --------
        Unit - Create 1 Grenade Launcher Projectile for (Owner of (Triggering unit)) at TempPoint3 facing (Angle from TempPoint1 to TempPoint2) degrees
        Unit - Set the custom value of (Last created unit) to 40
        Unit Group - Add (Last created unit) to BulletGroup
        Animation - Change (Last created unit)'s animation speed to 300.00% of its original speed
        Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
        --------   --------
        Unit - Create 1 Shooting Light for (Owner of (Triggering unit)) at TempPoint3 facing 0.00 degrees
        Unit - Add a 0.09 second Generic expiration timer to (Last created unit)
        --------   --------
        Custom script:   call RemoveLocation(udg_TempPoint1)
        Custom script:   call RemoveLocation(udg_TempPoint2)
        Custom script:   call RemoveLocation(udg_TempPoint3)
        Set Real1 = 0.00
        Trigger - Turn on BulletGroup <gen>

The grenade stops when hitting a cliff or the ground and detonate 0.35 seconds after and killing the grenade. If hitting a unit the detonation is intant.
Trigger 2 (Nade Unit dies)
Code:
Nade Dies
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Grenade Launcher Projectile
    Actions
        Animation - Change (Triggering unit)'s animation speed to 0.01% of its original speed
        Set TempPoint1 = (Position of (Triggering unit))
        --------   --------
        Unit - Create 1 Shooting Light for (Owner of (Triggering unit)) at TempPoint1 facing 0.00 degrees
        Unit - Add a 0.09 second Generic expiration timer to (Last created unit)
        --------   --------
        Special Effect - Create a special effect at TempPoint1 using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
        Special Effect - Destroy (Last created special effect)
        --------   --------
        Set TempGroup = (Units within 180.00 of TempPoint1 matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Rifleman)))
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                Set TempPoint2 = (Position of (Picked unit))
                Set Real1 = (180.00 - (Distance between TempPoint1 and TempPoint2))
                Custom script:   call RemoveLocation(udg_TempPoint2)
                Set Real2 = (Real1 / 2.50)
                --------   --------
                Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Real2 + 15.00) damage of attack type Chaos and damage type Normal
                --------   --------
                --------   --------
                --------   --------
                --------   --------
                Set KBA_Caster = (Triggering unit)
                Set KBA_TargetUnit = (Picked unit)
                Set KBA_StartingPosition = TempPoint1
                Set KBA_Level = 1
                Set KBA_Speed = 20.00
                Set KBA_DistancePerLevel = (Real2 + 30.00)
                Set KBA_DestroyTrees = False
                Trigger - Run Start Knockback <gen> (checking conditions)
                --------   --------
                --------   --------
                --------   --------
        Set Real1 = 0.00
        Set Real2 = 0.00
        Custom script:   call RemoveLocation(udg_TempPoint1)
        Custom script:   call DestroyGroup(udg_TempGroup)
The trigger might be messy since i've tried multiple ways to look after whats wrong.

Additional info about the grenade:
Abilities: Locust and Invulnerability, Death Time: 0.01, Flying Unit, Combat - Target as: <empty>, no movement speed, no collision size.
 
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