ACS zandronum rounding? I need help

Mon Nov 01, 2021 8:46 am

I am currently in the process of making one of my mods available for multiplayer, this script involves using the round(x) function to snap some x and y coordinates to a grid. Unfortunately, zandronum's implementation of this function always returns 0, or sometimes, a random big number. Help would be greatly appreciated!

https://zdoom.org/wiki/Round - the function in question

Thanks - Qwertyking7

Re: ACS zandronum rounding? I need help

Mon Nov 01, 2021 7:27 pm

Zandronum doesn't implement the function natively like GZDoom does. You need to use the non-native one documented on that page. If that is what you're using, then post the problematic code.

Re: ACS zandronum rounding? I need help

Mon Nov 08, 2021 10:06 am

i used this
round(variable);

however, I found that zandronum automatically bit-shifts decimal numbers back by 16, in order to preserve the number. Using this, I can shift it down and force zandronum to "forget", everything except an integer.

int A = 5.1; //zandronum automatically turns this into a bit shifted number
int B = A >> 16: //This should be 5.0

This works, but poorly. I would like to see the non-native version of the round function if you can link it!