Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Planky

ACS - Problem with SetGravity

Recommended Posts

I was going to post this on the GZDoom forums, but I've managed to forget my password and what email account I used to register and promptly got blocked for 30 minutes...

Anyhow, I was tinkering with ACS and the SetGravity command. I wanted to change the gravity to 400 when opened:

#include "zcommon.acs"
script 1 OPEN {

setgravity(400);
} 
When I run the map and hit the jump key, the player rises to the ceiling (regardless of height) and just stays there. Happens with ZDoom and gzDoom.

Manually setting the gravity via sv_gravity works fine.

Is this a bug or me just being incredibly stupid?

Edit: Ergh, this should be in Editing. Not my day :(

Share this post


Link to post

Your code should look like this:

#include "zcommon.acs"
script 1 OPEN {

setgravity(400.0);
}
ACS handles some vaules in this manner.

Share this post


Link to post

Perhaps you are thinking of Sector_SetGravity. SetGravity uses a fixed amount - 800 being normal.



Interestingly, the Zdoom wiki lists an example using the same syntax as in Planky's original post.

It may be of interest that you can also set the gravity value via mapinfo.

Share this post


Link to post

Look at the history of the page - I added that example, before I realized something was wrong :D

Why does sv_gravity accept values without the .0? Seems a bit inconsistent...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×