DIFF

class WorldSource

World Managed

All members, including inherited

Constants 1

const int DM_GAME_WORLD_SIMUL_ACCELERATIONDIAG_DEVELOPER

Methods 49

proto void CheckSoundObstruction(EntityAI source, bool inSource, out float obstruction, out float occlusion)
proto native void GetPlayerList(out array<Man> players)
proto native void SetTimeMultiplier(float timeMultiplier)

Sets the world time acceleration, overriding config. Mostly used for debug purposes.

timeMultiplier
0-64 acceleration value, -1 to reset back
proto native void SetDate(int year, int month, int day, int hour, int minute)

Sets actual ingame world time

year
month
in range <1, 12>
day
in range <1, 31>
hour
in range <0, 23>
minute
in range <0, 59>
int year = 2016;
int month = 5;
int day = 4;
int hour = 14;
int minute = 57;
g_Game.GetWorld().SetDate(year, month, day, hour, minute);
proto native float GetLatitude()
proto native float GetLongitude()
proto native float GetMoonIntensity()
proto native float GetSunOrMoon()
proto native bool IsNight()
proto native float GetEyeAccom()
proto native void SetEyeAccom(float eyeAccom)
proto native void StartFpsBenchmark(int sectorsCount, float preloadDistance, float fpsLimitRed, float fpsLimitGreen, float fpsLimitBlue, float minX, float minY, float maxX, float maxY)
proto native void StartFpsBenchmarkWithMask(float preloadDistance, float fpsLimitRed, float fpsLimitGreen, float fpsLimitBlue)
proto native void StartFpsBenchmarkViews(string xmlFileName, float preloadDistance)
proto native void SetBuldozerWaterEnabled(bool enable)
proto native void SetPreferredViewDistance(float distance)

Sets preferred view distance, which persists between game sessions

distance
proto native void SetViewDistance(float distance)
proto native void SetObjectViewDistance(float distance)
proto native void SetExplicitVolumeFactor_EnvSounds2D(float factor, float fadeTime)
proto native void AddEnvShootingSource(vector position, float shootingValDecrease)

Affects env sound controller value 'Shooting'

sound
position
relative
value (0..1) - how much should be value decreased
proto void GetGridCoords(vector pos, float gridSize, out int gridX, out int gridZ)

Translates world coordinates to a grid coordinates(map grid)

pos
size
of grid in meters
x
grid position result [out]
z
grid position result [out]
int x,z;
g_Game.GetWorld().GetGridCoords(g_Game.GetPlayer().GetPosition(), 100, x, z);
proto native void LoadNewLightingCfg(string path)

load light config

proto native void LoadUserLightingCfg(string path, string name)

load user light config (just first item is used)

proto native AIWorld GetAIWorld()

returns reference to AIWorld

proto native void UpdatePathgraphDoorByAnimationSourceName(notnull Object object, string animSourceName)

For entities that aren't a house, any animation source that contains "door" is treated as a door by the pathgraph. Using the phase value where 0=CLOSED, 1=OPENED, we can update the state of the door without regenerating the tile

proto native void MarkObjectForPathgraphUpdate(Object object)
proto native void ProcessMarkedObjectsForPathgraphUpdate()
proto native Material GetMaterial(string materialName)
Material matColors = g_Game.GetWorld().GetMaterial("postprocess/glow");
SetMaterialParam(matColors, "Saturation", 0.8);
float color[4];
color[0] = 0.5;
color[1] = 0.8;
color[2] = 0.7;
color[3] = 0.6;
SetMaterialParam(matColors, "OverlayColor", color);
proto native void SetCameraPostProcessEffect(int cam, int ppEffect, string effectName, string materialName)

set new PP effect and its material

camera
number of camera
effectIndex
index of effect
effectName
name of effect
matName
name of material
void SetAperture(float invDiameter)
References SetEyeAccom()
proto native bool Is3rdPersonDisabled()

checks if 3rd person camera is disabled from server

proto native bool IsCrosshairDisabled()

checks if crosshair is disabled from server

proto native bool IsMouseAndKeyboardEnabledOnServer()

checks if mouse and keyboard is enabled from server (only on console)

proto native int GetPingWarningThreshold()

Returns the value set in server config for notifying high ping

proto native int GetPingCriticalThreshold()

Returns the value set in server config for notifying high ping

proto native float GetServerFpsWarningThreshold()

Returns the value set in server config for notifying low server fps

proto native float GetServerFpsCriticalThreshold()

Returns the value set in server config for notifying low server fps

proto native void DisableTransmitVoN(bool disable)

enable/disable transmiting voice over network globally

disable
if true, then VoN is no more usable for transmiting voice
proto native bool DisableReceiveVoN(bool disable)

enable/disable receiving all voice over network globally

disable
if true, then player is not able listen any voice from VoN

Returns: true if mute request was sent successfully to server. If false, then was problem with sent request or missing player idendity.

proto native bool IsDisabledTransmitingVoN()

Returns: true if transmiting voice over network is disabled, so player can not talking

proto native bool IsDisabledReceivingVoN()

Returns: true, if receiving voice over network is disabled, so player can not listen anybody

proto void SetVoiceOn(bool listening, bool toggled = false)

enables/disables player's voice communication

listening
enable or disable microphone
toggled
enable or disable PTT/Voice activation
proto native void FlattenGrassSphere(float x, float z, float radius, float centerLerp01, float timeDown01, float maxHeight01)

create sphere

worldX
world X of touch with ground
worldZ
world X of touch with ground
radius
radius
centerLerp01
lerp of values inside rasterization
timeDown01
relative speed of going down, 1 is usually 0.5secs
maxHeight01
maximum relative height of flattening, 0 = no flatten
proto native void FlattenGrassEllipse(float x, float z, float sideX, float sideZ, float offset, float angleRAD, float centerLerp01, float timeDown01, float maxHeight01)

create ellipse

worldX
world X of touch with ground
worldZ
world X of touch with ground
radiusX
radius in X coord before rotate
radiusZ
radius in Z coord before rotate
offset
offset, 0 = default center, <-1, 1>
angleRAD
rotation
centerLerp01
lerp of values inside rasterization
timeDown01
relative speed of going down, 1 is usually 0.5secs
maxHeight01
maximum relative height of flattening, 0 = no flatten
proto native void FlattenGrassBox(float x, float z, float side, float angleRAD, float centerLerp01, float timeDown01, float maxHeight01)

create box

worldX
world X of touch with ground
worldZ
world X of touch with ground
sideSize
size of side
angleRAD
rotation
centerLerp01
lerp of values inside rasterization
timeDown01
relative speed of going down, 1 is usually 0.5secs
maxHeight01
maximum relative height of flattening, 0 = no flatten
proto native void FlattenGrassRect(float x, float z, float sideX, float sideZ, float offset, float angleRAD, float centerLerp01, float timeDown01, float maxHeight01)

create rectangle

worldX
world X of touch with ground
worldZ
world X of touch with ground
sideXSize
size of side in X
sideZSize
size of side in Z
offset
offset, 0 = default center, <-1, 1>
angleRAD
rotation
centerLerp01
lerp of values inside rasterization
timeDown01
relative speed of going down, 1 is usually 0.5secs
maxHeight01
maximum relative height of flattening, 0 = no flatten