• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Point with offset!?

Status
Not open for further replies.
Level 3
Joined
Aug 15, 2014
Messages
24
I've been playing around with distance to target, and I can't understand this one...
The idea, is a TD with "preset" selectable dummies.

But for some reason, the distance gets all weird, and each player gets different results!?

distance1.png
distance2.png

For Player 1, the above tower is removed.
Player 2 lacks the tower positioned to the right.
Player 3 is missing both up and right.
Player 4 works fine...?!

The "code" is identical in all directions (except for degrees).
The terrain is flat and buildable.
The collision is less than distance.

I've also noticed that if I disable the remove-trigger, the tower is 1 grid further.
So I'm guessing that grid/distance is the problem?

The idea is to get a tower in each direction, with 1 grid-space between them.

Thanks in advance!
 
Last edited:
You should choose degrees the offset should be offset by. Now it's always set to 0 so the first unit you create will be created to the east, then the next one will be created at the same location. This will mess up the locations due to collision sizes etc.

I'm not sure if you meant that the code is 100% identical or not, but if you have the same code for all tower spawns, but changed the degrees then just ignore this.
 
Last edited:
Level 3
Joined
Aug 15, 2014
Messages
24
You should choose degrees the offset should be offset by. Now it's always set to 0 so the first unit you create will be created to the east, then the next one will be created at the same location. This will mess up the locations due to collision sizes etc.

I'm not sure if you meant that the code is 100% identical or not, but if you have the same code for all tower spawns, but changed the degrees then just ignore this.

lol yes, the point is changed from the center with degrees for each tower ;P
 
Level 38
Joined
Feb 27, 2007
Messages
4,951
There's probably a rounding error so it's not being offset by exactly 192. In this case I would actually use "point with offset" rather than "point with polar offset". Offset by +-192 in x or +- 192 in y depending on which tower you are creating.
 
Level 3
Joined
Aug 15, 2014
Messages
24
There's probably a rounding error so it's not being offset by exactly 192. In this case I would actually use "point with offset" rather than "point with polar offset". Offset by +-192 in x or +- 192 in y depending on which tower you are creating.

Yeah apparently polar offset fudged it up, because "offset by x/y" seem to have fixed it.
Now I'm a bit irritated that I didn't think of testing that before asking about it here! xD

Thanks Pyrogasm.
 
Status
Not open for further replies.
Top