Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
calavera

Can I edit modeldef properties during runtime? Other solutions welcome..

Recommended Posts

I'm tying to make a 3d ball in GZDoom which will roll based on its x and y velocities. Right now I have it set so that pitch is connected to Y velocity and Roll is connected to X, while the angle is fixed.

My problem is that when the pitch is rotating it is (obviously) taking the roll-axis with it, so whenever the pitch is pointing up or down, adding to roll will cause the ball to spin and not.. well.. "roll". Does this make sense?

Long story short, I could fix the problem if it was possible to change my Actor or Model's roll-offset during gameplay using ACS. Is this possible?

Is there a better solution perhaps? I can post a code example when i get home if that would help.

Share this post


Link to post

You can't change modeldef properties dynamically, no. I think you'll have to do it the hard way and do some math stuff to adapt roll and angle depending on current pitch.

Share this post


Link to post
Ijon Tichy said:

I'm confused, wouldn't pointing the ball in a direction using yaw and rolling it with pitch work


Yes it does and that's what I've settled on for now thanks to Gez's advice to abandon my old method.

Unfortunately it doesn't have quite the behavior I want, namely, when the player sharply changes direction (left to right strafe or forward to back, but not together) then the ball quickly snaps to the new direction in an obvious way. Ideally I would want the ball to be able to roll backwards but instead it instantly changes to face the opposite direction. It's not what I want but it'll do :P

I did have another newb question if I can avoid starting a new thread:

I'm trying to fire off a script when the ball collides with an enemy. Googling has not turned up any sort of obvious collision events, so what's a good way to get this update?

I was thinking worst-case I can use acs to scan for and register nearby monsters and then do distance checks against the radius, but if there is already a defined way to check collision, or perhaps if I could just piggy-back off an event or state that already always happens with collision, it would be much preferred.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×