Units shooting in a straight line

Korika2

New Member
Reaction score
0
I have a quick question for a project I am working on. Is it possible to make it so a unit can only shoot in one direction?

I have added a picture to make it more clear with what I am trying to do.

Directions.png
 

canons200

New Member
Reaction score
50
hmm, i think you can't because all unit attack 360 degree. unless you narrow your terrain so only 1 unit can walk in at 1 time.
 

TheCrystal

New Member
Reaction score
36
If you wanted to make a system for it you could.
Find X unit's degree from Y unit.

But without extensive triggering, not really.
 

HydraRancher

Truth begins in lies
Reaction score
197
If you wanted to make a system for it you could.
Find X unit's degree from Y unit.

But without extensive triggering, not really.

That wouldnt help, Since warcraft counts like:

357 Degrees, 358 Degrees, 359 Degrees, 360 Degrees, 1 Degree, 2 Degrees...

It will be very hard to calculate wether its a straight line (Since you cant just check if its 90.00 Degrees, because, what unit faces another at EXACTLY 90.00?).
 

Korika2

New Member
Reaction score
0
Well, the idea I have uses lanes, would it be possible to make it so they only attack units in the lane that they occupy?
 

TheCrystal

New Member
Reaction score
36
You could just make it so that a dummy unit fires a shockwave kind of thing in the facing o 0 90 180 n' 270 whenever it sees a unit and from whichever way is closer (enemy unit at 44 degree with tower as base, tower dummy shoots at 0)
This is just brainstorming though.
 

HydraRancher

Truth begins in lies
Reaction score
197
You could just make it so that a dummy unit fires a shockwave kind of thing in the facing o 0 90 180 n' 270 whenever it sees a unit and from whichever way is closer (enemy unit at 44 degree with tower as base, tower dummy shoots at 0)
This is just brainstorming though.

Still hard to do, back to what I said, blizzard doesnt think "359 + 15 (374)" as 14 degrees.
 

HydraRancher

Truth begins in lies
Reaction score
197
Actually, they do. I've used degrees at +500 and still got it to work as it's supposed to.

Really?
Oh ok fair enough.
Trigger:
  • Trigger
    • Events
      • Unit - A unit is Attacked
    • Conditions
      • Or - Any Conditions are true
        • Any - Conditions
          • Unit - Type of (Attacking Unit) is equal to Cannon Tower
    • Actions
      • Set Temp_Restriction = (THE ONLY ANGLE WHICH THE UNIT CAN SHOOT)
      • Set Temp_Point = (Position of (Triggering Unit))
      • Set Temp_Point_2 = (Position of (Attacking Unit))
      • Set Temp_Real = Angle between Temp_Point and Temp_Point_2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp Real Is Greater than (>) Temp_Restriction - 15.00
          • Temp Real Is Less than (<) Temp_Restriction + 15.00
        • Then - Actions
          • -----Nothing I guess-----
        • Else - Actions
          • Unit - Order (Attacking Unit) to stop
      • Custom Script: call RemoveLocation (udg_Temp_Point)
      • Custom Script: call RemoveLocation (udg_Temp_Point_2)



Replace (THE ONLY ANGLE WHICH THE UNIT CAN SHOOT) with obviously, the restricted angle, (90 degrees is east (Assuming North is ^/Up) 180 degrees is South 270 West is 360/0 is North.)
 

TheCrystal

New Member
Reaction score
36
Really?
Oh ok fair enough.
Trigger:
  • Trigger
    • Events
      • Unit - A unit is Attacked
    • Conditions
      • Or - Any Conditions are true
        • Any - Conditions
          • Unit - Type of (Attacking Unit) is equal to Cannon Tower
    • Actions
      • Set Temp_Restriction = (THE ONLY ANGLE WHICH THE UNIT CAN SHOOT)
      • Set Temp_Point = (Position of (Triggering Unit))
      • Set Temp_Point_2 = (Position of (Attacking Unit))
      • Set Temp_Real = Angle between Temp_Point and Temp_Point_2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp Real Is Greater than (>) Temp_Restriction - 15.00
          • Temp Real Is Less than (<) Temp_Restriction + 15.00
        • Then - Actions
          • -----Nothing I guess-----
        • Else - Actions
          • Unit - Order (Attacking Unit) to stop
      • Custom Script: call RemoveLocation (udg_Temp_Point)
      • Custom Script: call RemoveLocation (udg_Temp_Point_2)

That'd lag bad. Real bad.
 

TheCrystal

New Member
Reaction score
36
You're ordering the unit to stop. Whats the unit going to do? Stop. What's it going to do then? Attack the nearest thing, as its meant to in WC3.
Do this with 6 units and some may begin to feel it. Do this with more units and it's going to lag a lot more. I don't know what WC3's Ordering system's refresh rate is though.
 

HydraRancher

Truth begins in lies
Reaction score
197
You're ordering the unit to stop. Whats the unit going to do? Stop. What's it going to do then? Attack the nearest thing, as its meant to in WC3.
Do this with 6 units and some may begin to feel it. Do this with more units and it's going to lag a lot more. I don't know what WC3's Ordering system's refresh rate is though.

And your solution is?...
 

TheCrystal

New Member
Reaction score
36
Not that one. It may be easier just to order the buildings via Pick every enemy within X range of building and have that building attack that unit (building having Worker classification so not to auto-attack, that is if buildings can have that classification and still follow it).
Or have an ability that does the damage for the building if that doesn't work. Or trigger the damage. The first idea I said in this post would be the best though.
 

HydraRancher

Truth begins in lies
Reaction score
197
Not that one. It may be easier just to order the buildings via Pick every enemy within X range of building and have that building attack that unit (building having Worker classification so not to auto-attack, that is if buildings can have that classification and still follow it).
Or have an ability that does the damage for the building if that doesn't work. Or trigger the damage. The first idea I said in this post would be the best though.

Yeah... The later solutions dont work too well either...The last one comphremises animation.



Using Worker classification works fine I guess, but better remind him to add it via trigger (Be more specific! ;)) or else he'll get the idle worker sign.

Oh, and you forgot to mention that he should, before ordering the unit to attack a unit within x range of the building, make sure the angles are correct, (And skip remaining actions!) otherwise there may be issues which lag bad. Real Bad.
 

TheCrystal

New Member
Reaction score
36
"(Be more specific!)" Lol

Let me lazy it out.
Is the Original Poster willing to do this much work or go for the laggierway of HydraRancher's?
 

Korika2

New Member
Reaction score
0
Like I said before, is it possible to make the tower only attack a unit that is in its respective lane? I suppose I wasn't specific enough in my first post.
 

HydraRancher

Truth begins in lies
Reaction score
197
You could create region that covers the entire lane, then check wether the targeted unit is inside there.
 
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