The RedM developer’s field guide
Know the native.
Build the world.
Engine functions, framework docs, and game assets.
One reference. From the first lookup to the last line.
knowledge base
Explore / RedM
Native reference
- BUILTINint
CEIL
``` I'm guessing this rounds a float value up to the next whole number, and FLOOR rounds it down ```
0x11E019C8F43ACC8A - BUILTINfloat
COS
Returns the cosine of the given number.
0xD0FFB162F40A139C - BUILTINint
FLOOR
Rounds a float value down to the next whole number
0xF34EE736CF047844 - BUILTINfloat
LOG10
``` NativeDB Introduced: v1604 ```
0xE816E655DE37FE20 - BUILTINfloat
POW
Description not yet documented
0xE3621CC40F31FE2E - BUILTINint
ROUND
Description not yet documented
0xF2DB717A73826179 - BUILTINvoid
SET_THIS_THREAD_PRIORITY
THREAD_PRIO_HIGHEST = 0 THREAD_PRIO_NORMAL = 1 THREAD_PRIO_LOWEST = 2 THREAD_PRIO_MANUAL_UPDATE = 100
0x42B65DEEF2EDF2A1 - BUILTINvoid
SETTIMERA
Sets the value for the timer A in milliseconds
0xC1B1E9A034A63A62 - BUILTINvoid
SETTIMERB
Sets the value for the timer B in milliseconds
0x5AE11BC36633DE4E - BUILTINint
SHIFT_LEFT
Left bit shifts a value. It is advised you use the `<<` operator instead of this native. It does the same and is faster.
0xEDD95A39E5544DE8 - BUILTINint
SHIFT_RIGHT
Right bit shifts a value. It is advised you use the `>>` operator instead of this native. It does the same and is faster.
0x97EF1E5BCE9DC075 - BUILTINfloat
SIN
Returns the sine of the given number.
0x0BADBFA3B172435F - BUILTINfloat
SQRT
Description not yet documented
0x71D93B57D07F9804 - BUILTINint
TIMERA
``` Counts up. Every 1000 is 1 real-time second. Use SETTIMERA(int value) to set the timer (e.g.: SETTIMERA(0)). ```
0x83666F9FB8FEBD4B - BUILTINint
TIMERB
Description not yet documented
0xC9D9444186B5A374 - BUILTINfloat
TIMESTEP
``` Gets the current frame time. ```
0x0000000050597EE2 - BUILTINfloat
TO_FLOAT
Description not yet documented
0xBBDA792448DB5A89 - BUILTINfloat
VDIST
Calculates the distance between two points in 3D space. For performance reasons, consider using direct mathematical calculations for distance, as they can be more efficient than calling this native function. ``` NativeDB Introduced: v323 ```
0x2A488C176D52CCA5 - BUILTINfloat
VDIST2
Calculates distance between vectors but does not perform Sqrt operations. Its way faster than [`VDIST`](#\_0x2A488C176D52CCA5), but it's not faster than direct mathematical calculations. ``` NativeDB Introduced: v323 ```
0xB7A628320EFF8E47 - BUILTINfloat
VMAG
``` Calculates the magnitude of a vector. ```
0x652D2EEEF1D3E62C - BUILTINfloat
VMAG2
``` Calculates the magnitude of a vector but does not perform Sqrt operations. (Its way faster) ```
0xA8CEACB4F35AE058 - BUILTINvoid
WAIT
``` Pauses execution of the current script, please note this behavior is only seen when called from one of the game script files(ysc). In order to wait an asi script use "static void WAIT(DWORD time);" found in main.h ```
0x4EDE34FBADD967A6
A living reference. Documentation coverage varies by native and source.