Trigger Help Plz

Sajin

User title under construction.
Reaction score
56
People of Thehelper I have a problem with a skill for my soon coming map. The skill is:
The soilder shoots a bullet and once the bullet comes in contact with the spefic enemy that it was shot it, that unit gets sent backwards.

Specifications: The bullet travels through a slide trigger (the bullet is a dummy unit)
The Skill is done in GUI and i would like to keep it that way
And i know the skills leaks and for me its fine atm but for whoever corrects me wants to throw the custom script in im fine with it =)

Problems: Currently the dummy unit isan't appearing when the skill is cast
and the Knockback is fairly jumpy, and finnaly the enemy unit becomes stunned for a long period of time when i dont want it too. Currently here are my triggers

Code:
Variables

KnockbackTable = Hashtable
PeneCaster = Unit Array
PeneTarget = Unit Array
peneCastLoc = Point Array
Bullet = Unit Array
KnockbackAngle = Real
KnockbackDistance = Real
RemainingTime = Real
BulletLoc = Point Array
KnockbackUnits = Unit Group
TempPoint = Point Array

Code:
HashTables
    Events
        Map initialization
    Conditions
    Actions
        Hashtable - Create a hashtable
        Set knockbackTable = (Last created hashtable)


Code:
KnockbackTarget
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Penetrating Shot 
    Actions
        Set PeneCaster[(Player number of (Owner of (Casting unit)))] = (Casting unit)
        Set PeneTarget[(Player number of (Owner of (Target unit of ability being cast)))] = (Target unit of ability being cast)
        Set peneCastLoc[(Player number of (Owner of (Casting unit)))] = (Position of (Casting unit))
        Unit - Create 1 Bullet for (Owner of (Casting unit)) at peneCastLoc[(Player number of (Owner of (Casting unit)))] facing (Position of (Target unit of ability being cast))
        Set Bullet[(Player number of (Owner of (Casting unit)))] = (Last created unit)
        Unit - Add a 4.00 second Generic expiration timer to Bullet[(Player number of (Owner of (Casting unit)))]
        Unit Group - Add Bullet[(Player number of (Owner of (Casting unit)))] to PeneBullets
        Set KnockbackAngle = (Angle from (Position of Bullet[(Player number of (Owner of (Casting unit)))]) to (Position of (Target unit of ability being cast)))
        Set KnockbackDistance = (300.00 x 0.04)
        Set RemainingTime = 0.40
        Hashtable - Save KnockbackDistance as (Key distance) of (Key (Target unit of ability being cast)) in knockbackTable
        Hashtable - Save KnockbackAngle as (Key angle) of (Key (Target unit of ability being cast)) in knockbackTable
        Hashtable - Save RemainingTime as (Key time) of (Key (Target unit of ability being cast)) in knockbackTable


Code:
Knockback Bullet Move
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in PeneBullets and do (Actions)
            Loop - Actions
                Set BulletLoc[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
                Unit - Move (Picked unit) instantly to ((Position of PeneTarget[(Player number of Player 12 (Brown))]) offset by 11.00 towards (Facing of (Picked unit)) degrees)
                Unit Group - Pick every unit in (Units within 100.00 of BulletLoc[(Player number of (Owner of (Picked unit)))]) and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Picked unit) Equal to PeneTarget[(Player number of (Owner of (Picked unit)))]
                            Then - Actions
                                Unit Group - Add (Picked unit) to KnockbackUnits
                                Unit - Pause (Picked unit)
                            Else - Actions
                                Do nothing
Code:
KnockbackUnits
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in KnockbackUnits and do (Actions)
            Loop - Actions
                Set KnockbackDistance = (Load (Key distance) of (Key (Picked unit)) from knockbackTable)
                Set KnockbackAngle = (Load (Key angle) of (Key (Picked unit)) from knockbackTable)
                Set RemainingTime = (Load (Key time) of (Key (Picked unit)) from knockbackTable)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        RemainingTime Greater than 0.00
                    Then - Actions
                        Unit - Remove Bullet[(Player number of (Owner of (Triggering unit)))] from the game
                        Set TempPoint[(Player number of (Owner of (Picked unit)))] = ((Position of (Picked unit)) offset by KnockbackDistance towards KnockbackAngle degrees)
                        Unit - Move (Picked unit) instantly to TempPoint[(Player number of (Owner of (Picked unit)))]
                        Hashtable - Save (RemainingTime - 0.04) as (Key time) of (Key (Picked unit)) in knockbackTable
                    Else - Actions
                        Hashtable - Clear all child hashtables of child (Key (Picked unit)) in knockbackTable
                        Unit - Unpause (Picked unit)
                        Unit Group - Remove (Picked unit) from KnockbackUnits

Can anyone please help me
 

Nighthawk

New Member
Reaction score
9
Allo Mate

From what I understand:

1. The bullet isn't appearing b/c the Bullet Move trigger simply moves it 11 yards away from the target each time. What you want to do is to set a base speed for the bullet, and then move the picked unit to the position of the picked unit offset by X (speed) towards angle from picked unit to target. You want it to be from the angle of the bullet to the target and not from the caster to the target so it will have a sort of "follow" effect incase the target moves.

Every .04 seconds of game time, so 25 times a second. I don't know what the range of this is, but I would say make it go like 800 yards a second. 800 /25 = 32. So move it 32 yards each time.

For example:
Trigger:
  • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 32.00 towards (Angle from (Position of (Picked unit)) to (Position of Deathgrip_Target)) degrees), facing (Angle from (Position of (Picked unit)) to (Position of Deathgrip_Target)) degrees



I'll keep looking through the rest, fun question :cool:


I don't see any problems in the triggers with you pausing/unpausing the unit, so the stun might be a problem with the spell your basing it off of. If the base spell is a stun spell and you set the duration to 0 then it will last indefinitely.


The knockback is a little screwy. I use alot of knockback/grab spells in my map, I can throw together a sample trigger for you to use in place of your KnockbackUnits trigger later on tonight if no ones helped you yet.
 

Sajin

User title under construction.
Reaction score
56
I figured out the stun problem and it actually was the pausing / unpausing. sometime the pausing sometimes screws up when you use "Picked Unit" but thank you for the first solution il test it out now =)
 

kingkwong92

Well-Known Member
Reaction score
25
From what I have read, you have the knock backed unit moving 300 in 1 second. I think that if you don't decrease the 0.04 seconds, it will look jumpy.
No offence or anything but your code is really hard to read.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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