SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > SRB2 Discussion > Bug Reports

Reply
 
Thread Tools Search this Thread
Old 10-03-2014   #1
Sky The Destroyer
 
Sky The Destroyer's Avatar
Default P_(Insta)Thrust and setting momz while the player is on the ground issue

Also applies to P_InstaThrust.

Example code of the issue at hand:
Code:
if (player.cmd.buttons & BT_CUSTOM1)
        P_InstaThrust(player.mo, player.mo.angle, 35*FRACUNIT)
        P_SetObjectMomZ(player.mo, 15*FRACUNIT, true)
end
To replicate: merely tap custom button 1 while on the ground, and the player will thrust forward at 35 fracunits as specified, and the player's momz will be set at 15 fracunits, which launches the player up into the air...

...then the player's momx and momy will just simply stop while in the air after a certain distance (which is very short).

Example GIF attached. As you can see in GIF, the player will be thrusted forward for like a fracunit, then just completely stops.

Also possibly related to this issue: Use P_Telekinesis on another player, and no matter what the force of it is, the player will stop still after a certain distance if the player is on the ground. They won't slide.
Attached Thumbnails
Click image for larger version

Name:	srb20003.gif
Views:	138
Size:	6.60 MB
ID:	5696  
__________________
<SkyTheDestroyer> Why does the Master Server delist my server once it hits 32/32?
<SpiritCrusher> Your server has attained GOD STATUS
<SpiritCrusher> The MS can't display it anymore
Sky The Destroyer is offline   Reply With Quote
Old 10-03-2014   #2
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

Cannot reproduce with my own test of the situation, it must be something else in your script:

Gif of my test script in action:


Link to the test script itself: Luatest-thrustplayer.lua
__________________
My page stuffed full of MIDI goodness!
The Hitchhiker's Guide to the Robo-Hoodiverse
Timeline of Sonic Robo Blast History!

That's an uppercase i, not a lowercase L, for the record. Also, it's pronounced "Yes-tin".
Monster Iestyn is offline   Reply With Quote
Old 10-03-2014   #3
Sky The Destroyer
 
Sky The Destroyer's Avatar
Default

My test script only runs that code, but uses MobjThinker instead...

Aha, I see what's happening.

I switched my script over to ThinkFrame and it functions correctly...so this looks like some issue with MobjThinker rather than a physics issue.
__________________
<SkyTheDestroyer> Why does the Master Server delist my server once it hits 32/32?
<SpiritCrusher> Your server has attained GOD STATUS
<SpiritCrusher> The MS can't display it anymore

Last edited by Sky The Destroyer; 10-03-2014 at 01:24 PM.
Sky The Destroyer is offline   Reply With Quote
Old 10-03-2014   #4
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

If you're returning true in MobjThinker, you're not running the standard physics code for momentum-handling. That could be what's going on.

...though in the player's case, returning true for MobjThinker acts just like return false/nil anyway. So I'm not entirely sure really.
__________________
My page stuffed full of MIDI goodness!
The Hitchhiker's Guide to the Robo-Hoodiverse
Timeline of Sonic Robo Blast History!

That's an uppercase i, not a lowercase L, for the record. Also, it's pronounced "Yes-tin".
Monster Iestyn is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:35 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.