Aiming time

mushroom911

I think I should change my avatar
Reaction score
43
Hi again, me and my friends working on a warfare map (which i posted a few days ago here as beta) have yet again bumped into another obsticle that we cant seem to be able to cross :p (that or were just plain dumb)
anyways the problem is this: snipers are overpowered because they (like every other unit) can shoot instantly, after aquiring a unit. we dont want that since when testing we noticed that if you have 5 snipers camping they cant be killed

so........... is there any way to make units wait BEFORE attacking? we cant seem to find any events " unit is about to attack" or anything so any help would be appriciated (spelling errors :S) :D

-ty in advance:D

.... come to think of it atm this kinda works like aimbot...
 
S

Slate.Master

Guest
You can use the event A unit is attacked, it will trigger before the attack happens, so I think it will work just fine.
 

mushroom911

I think I should change my avatar
Reaction score
43
ye..

i somewhat got the same idea, but since attacks are trigger based it somewhat comes out as "he starts shooting, he shoots, he waits, then 0-10s later the bullet hits.


-Edit nvm we figured it out, we just had to modify the shooting trigger alot.... ALOT xD

-edit again... ok doesnt work
 

mushroom911

I think I should change my avatar
Reaction score
43
...

Change attack type to missile (line) and give it ~ 700 missile speed and find good model for bullet, should do the trick.

im using a trigger to dmg... an adding a missile rly doesnt work :p im more or less trying to get it to work again now.. cus for some reason it doesnt work anymore...
Code:
Sniper
    Events
        Unit - A unit Is attacked
    Conditions
        (Mana of (Attacking unit)) Not equal to 0.00
        ((Attacking unit) has an item of type Sniper equipment) Equal to True
    Actions
        Unit - Pause (Attacking unit)
        Wait (Random real number between 2.00 and 7.00) seconds
        Unit - Unpause (Attacking unit)
        Set attackerloc = (Position of (Attacking unit))
        Set Attaim = (Position of (Attacked unit))
        Set Attdistance = (Distance between attackerloc and Attaim)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Attdistance Less than or equal to 325.00
            Then - Actions
                Set Attactualhit = (Attaim offset by ((Random real number between (-0.10 x Attdistance) and (0.10 x Attdistance)), (Random real number between (-0.04 x Attdistance) and (0.04 x Attdistance))))
            Else - Actions
                Set Attactualhit = (Attaim offset by ((Random real number between (-0.02 x Attdistance) and (0.02 x Attdistance)), (Random real number between (-0.03 x Attdistance) and (0.03 x Attdistance))))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Attacked unit) has buff Heavy cover ) Equal to True
                    Then - Actions
                        Unit - Cause (Attacking unit) to damage circular area after 0.00 seconds of radius 0.20 at Attactualhit, dealing (Random real number between 2.00 and 30.00) damage of attack type Pierce and damage type Divine
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Attacked unit) has buff Medium cover ) Equal to True
                            Then - Actions
                                Unit - Cause (Attacking unit) to damage circular area after 0.00 seconds of radius 0.40 at Attactualhit, dealing (Random real number between 2.00 and 50.00) damage of attack type Pierce and damage type Divine
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((Attacked unit) has buff Light cover ) Equal to True
                                    Then - Actions
                                        Unit - Cause (Attacking unit) to damage circular area after 0.00 seconds of radius 0.60 at Attactualhit, dealing (Random real number between 2.00 and 60.00) damage of attack type Pierce and damage type Divine
                                    Else - Actions
                                        Unit - Cause (Attacking unit) to damage circular area after 0.00 seconds of radius 1.00 at Attactualhit, dealing (Random real number between 2.00 and 60.00) damage of attack type Pierce and damage type Divine
        Special Effect - Create a special effect at Attactualhit using Abilities\Weapons\Rifle\RifleImpact.mdl
        Special Effect - Destroy (Last created special effect)
        Sound - Attach 50mg <gen> to (Attacking unit)
        Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 1.00)
        Custom script:   call RemoveLocation(udg_attackerloc)
        Custom script:   call RemoveLocation(udg_Attaim)
anyways this is the code, hope u can see whats wrong
 
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