[Solved]Positioning Objects at Runtime

Sun Dec 26, 2021 1:50 pm

Merrily met, everyone! I hope everyone is having a safe holiday season! I'm getting to spend a few extra days through the end of the year relaxing in front of the computer, yay!

So question, basically what am I doing wrong here? I have a pair of objects, as represented in the screenshots as smiley faces, that in the editor are positioned in relation to the location of the thing that should be emitting light. At runtime, both the thing emitting the light and the objects are moved to the top of the elevator shaft, um with the elevator. The problem, as you can see from the screenshot are the differences in relative location at runtime; I'm expecting these objects to be positioned the same relative to the elevator, regardless of location in the elevator shaft.

  • The objects are flagged to use absolute values for their Z coordinates
  • I'm not trying to call GetActorFloorZ as part of my positioning code - this is what I'm assuming is wrong
  • The objects are not part of the blockmap and shouldn't interact with anything.

Spoiler: "Object ZScript"

Spoiler: "Relevant ACS that moves the elevator and objects"

Objects are positioned correctly at the bottom of the elevator shaft, in the editor.

At runtime, the elevator and the objects are moved to the top of the shaft, and somehow the objects lose their relative position to the elevator.

Thank you for any and all help, it is greatly appreciated! :rock:
Last edited by Sarah on Sun Dec 26, 2021 5:57 pm, edited 1 time in total.

Re: Positioning Objects at Runtime

Sun Dec 26, 2021 5:57 pm

After some head scratching, I realized that I needed to see just where the hitboxes were lined up at in the game versus the editor...and after getting Nash's Radius Debug working with my project (actually the other way around), I discovered the following, with my conclusions following that :D

I have concluded that the differences in sprite location come down to inaccuracies of Doom Builder. Those sprites are placeholders, you should never, ever, see them when playing properly. As can be seen in the screenshot, the hitboxes are placed correctly; the upper light should be above the railing, the lower light should be above the "seat" of the...idk "cyber bench???" So, in short, neither my ACS nor my ZScript is wrong and there is actually no problem here! Don't mind me, I'm the queen of paranoid :lol:

Now I'm going to have to expand Real Elevators to deal with objects too... :? Anyway, Enjay, thank you!

*Inaccuracies of Doom Builder: Look at the editor screenshot, then this one. The hitboxes are different, who is correct? Nash. The code specifies a height and radius of 1 for these object's hitboxes, yet Doom Builder shows it to be a big, flat square. Also, note the location of the sprites themselves in relation to the hitbox. Doom Builder makes it look like I've centered the sprites, but I have done no such thing; as I stated these sprites are placeholders so offsetting them is useless, therefore the engine is showing them correctly, down to the lower right of the hitbox.