Offset is being... odd.

Monsterous

In the Shadows, Lurking.
Reaction score
99
What i want is a unit to keep moving past the target point.
Now, the easiest way i can think of is using an Offset, which i've done. However, the moving unit always moves to the side of the point. However, if i remove the offset, the moving unit goes exactly to the point.
Its strange, because the offset is directed towards that point, so surely the unit would go past the point, as the offset is directed on the unit to the point?

Code:
Unit - Order (Last created unit) to ( Move targeting (ShipPoint offset by 50.0 towards (Point((X of ShipPoint), (Y of ShipPoint))))) (Replace Existing Orders)
I've tried the angle between the two points, and other methods. The unit simply just goes to the offset, disregarding the position of the ship, the angle between two points, or the degree it is moving.

Basically, can anyone give me another way as to how to make a unit target a point, and go past it in the direction its going? Offsets arent working here for unknown reasons to me. Or if anyone can tell me why my action is wrong.
 

Frozenwind

System maker
Reaction score
99
I'm sorry to disapoint you, but the offset behaves as I expect it to behave ;)


What goes wrong?
Basically, what you do is the following:

You order the unit to move to the point (allow me to call it X), with an offset of 50.0 towards the very same point X. However, how can a unit move to point X with an offset of 50.0 towards point X? To translate it:
Code:
Move unit to point X
Offset 50.0
Angle from point X to point X (will most-likely return 0 = east)
An angle between one point doesn't exist. An angle will always be determined by two different points, as it requires two dimensions (or more of course).
I hope the thing between code-tags will explain why it doesn't work.

(Small edit: Actually, it requires any amount of dimensions (in 1 dimension you simply only have 2 angles: left or right (0° and 1°? xD)), but it does require 2 or 3 points. 3 points would be a "math angle", with 2 lines drawn (AB and BC) giving the angle between those 2 lines. Whereas 2 points would be the angle from A to B - which is used in programming - which is now. Technically, this is the same as with 3 points, but one point is imaginary on the x-axis, having the same Y-coördinate as point A)


How to fix it?
I assume you want the ship to move straight over the point? Then I recommend you do this:
[not at home, so I typed it]
Code:
Unit - Order (Last created unit) to ( Move targeting (TargetPoint offset by 50.0 towards (Angle from (Position of (Last Created unit)) to (TargetPoint)))) (Replace Existing Orders)


The (Point(X,Y)) function
One more thing, rather off-topic:
Code:
Unit - Order (Last created unit) to ( Move targeting (ShipPoint offset by 50.0 towards ([COLOR="Green"]Point((X of ShipPoint), (Y of ShipPoint))[/COLOR]))) (Replace Existing Orders)
The green part equals the following:
Code:
(ShipPoint)
 

Monsterous

In the Shadows, Lurking.
Reaction score
99
Very informative.
However, if what you say is true, why wouldnt this work?
Code:
Unit - Order (Last created unit) to ( Move targeting ((Position of Your Ship) offset by 30.0 towards (Angle from (Position of (Last created unit)) to (Position of Your Ship)) degrees)) (Replace Existing Orders)

I tried this, this contains 2 different points, yet the unit goes to the offset, not in a line towards the ship and going past it.
Unless im reading it wrong, the unit should go to an offset of 30 at an angle of the direction of the unit to the ship, which would be its normal movement line, thus it should just move towards the point, and go on its offset.
 

Frozenwind

System maker
Reaction score
99
Few questions:
- Is the "last created unit" on top of the ship (cos then the 2 different points are the same)? --> this will break his "normal movement line" and force him to go to "0°" = east.
- When is the function called? Since if you call it before it passes the ship (makes him move over) and after he passes the ship (makes him move over again - which is backwards), he'll be stacked on top of the ship.
 

Monsterous

In the Shadows, Lurking.
Reaction score
99
Its a seperate unit firing at the ship, so the unit will move towards the ship.
The function is called instantly as the unit is made.
 

Frozenwind

System maker
Reaction score
99
Then it should work, unless:

- Your last created unit isn't created yet (impossible as there always is a last created unit - unless it's your first call - besides that, it responds)
- Is "Your Ship" declared?

If not.. Mind posting your trigger?
 

Monsterous

In the Shadows, Lurking.
Reaction score
99
Amazingly, it now works. I had to recreate it as i had deleted it previously, tested it, and amazingly, it now works even though i did the same thing as i always had.

I thank you for help, and holding my hand trying to find a way to fix my problem.
I've +rep you, and i'd +rep again for your tremendous amount of help, but unfortunately i cant yet :(
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top