How do XY offsets work in codepointers?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Deathsong12
Posts: 1083
Joined: Sat May 07, 2005 1:29 pm
Location: On the hunt

How do XY offsets work in codepointers?

Post by Deathsong12 »

As far as I'm aware, X and Y offsets are different numbers, yet in code pointers like A_CustomMissile, both are rperesented by one number. Furthurmore, what units are these offsets in? If anyone could shed light on this topic, It would really be helpful.
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

An XY offset is an offset on the horizontal plane: This is because 3D co-ordinates are used and the players horizontal plane covers X and Y coordinates (Forward/Backwards and Left/Right).
User avatar
Deathsong12
Posts: 1083
Joined: Sat May 07, 2005 1:29 pm
Location: On the hunt

Post by Deathsong12 »

Yah, I understand the theory behind it. I'm taking about effects like the Cyberdemon firing missiles from his arm, off center. Most likely, as far as my experements have demonstrated, the number that is XY offset is just X offset. If you want to use a Y offset, you can just alter the missile's spawnheight.
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Spawn height??? Set the missile height in the actor firing the missle to the appropreate value.
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

Spawnheight is a Z offset. The horizontal plane (I.E left or right) is covered by 2 co-ordinates, X or Y. X is one direction, Y is another. The offset is "XY" when the direction used is met on neither axis (So it's offset by some X and Y units).
User avatar
Deathsong12
Posts: 1083
Joined: Sat May 07, 2005 1:29 pm
Location: On the hunt

Post by Deathsong12 »

Okay, I thought that the XY plane was the surface of the actor's bounding box, sorry. So I just use negative values th move it one way, positive the other?
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

positive == right, negative == left.
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

I always just thought of it as the Z offset. And if a monster is using it, accomplish it with the MissileHeight of the monster if it is set as the monster MissileType. Only if it is the primary attack though.
Locked

Return to “Editing (Archive)”