Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
BaseWeatherManagerEntity Interface Reference
Inheritance diagram for BaseWeatherManagerEntity:
[legend]

Public Member Functions

proto external ref WeatherState GetCurrentWeatherState ()
 
proto external float GetDayDuration ()
 Retrieves in-game day duration as realtime seconds.
 
proto external bool SetDayDuration (float realtimeSeconds)
 Sets in-game day duration as realtime seconds.
 
proto external bool SetIsDayAutoAdvanced (bool autoAdvanced)
 Enables or disabled automatic daytime advancement.
 
proto external bool GetIsDayAutoAdvanced ()
 Retrieves whether automatic time advancement is enabled or not.
 
proto external bool SetCurrentLongitude (float longitude)
 Sets longitude as <-180, +180>.
 
proto external float GetCurrentLongitude ()
 Returns current longitude.
 
proto external float GetCurrentLatitude ()
 Returns current latitude.
 
proto external bool SetCurrentLatitude (float latitude)
 Sets latitude as <-90, +90>.
 
proto external float GetTimeZoneOffset ()
 Returns time zone offset (in hours)
 
proto external bool SetTimeZoneOffset (float utcTimeZone)
 Sets time zone offset (in hours) in range <-12.0, +14.0>
 
proto external float GetDSTOffset ()
 Gets DST offset (in hours)
 
proto external bool SetDSTOffset (float dstOffsetHours)
 Sets DST Offset (in hours).
 
proto external bool IsDSTEnabled ()
 Retrieves whether DST (daylight savings time) is enabled.
 
proto external bool SetDSTEnabled (bool enabled)
 Sets whether DST (daylight savings time) is enabled or disabled.
 
proto external bool SetWindSpeedOverride (bool doOverride, float windSpeed=0)
 Sets in-game wind speed in meters per second.
 
proto external float GetWindSpeed ()
 Retrieves in-game wind speed in meters per second.
 
proto external bool SetWindDirectionOverride (bool doOverride, float windDirection=0)
 Sets in-game wind direction angle in degrees.
 
proto external float GetWindDirection ()
 Retrieves in-game wind direction angle in degrees.
 
proto external bool IsWindSpeedOverridden ()
 
proto external bool IsWindDirectionOverridden ()
 
proto external bool SetRainIntensityOverride (bool doOverride, float rainIntensity=0)
 Sets current rain intensity override (in range <0.0, 1.0>) Can only be set by the authority (server, singleplayer...)
 
proto external float GetRainIntensity ()
 
proto external bool IsRainIntensityOverridden ()
 
proto external bool SetFogAmountOverride (bool doOverride, float fog=0)
 Sets current fog override (in range <0.0, 1.0>) Can only be set by the authority (server, singleplayer...)
 
proto external bool SetFogHeightDensityOverride (bool doOverride, float heightDensity=0)
 
proto external float GetFogAmount ()
 
proto external bool IsFogAmountOverridden ()
 
proto external float GetFogHeightDensity ()
 
proto external bool IsFogHeightDensityOverridden ()
 
proto external bool SetCurrentWetness (float wetness)
 
proto external float GetCurrentWetness ()
 
proto external bool SetCurrentWaterAccumulation (float waterAccumulationCracks, float waterAccumulationPuddles)
 
proto external float GetCurrentWaterAccumulationCracks ()
 
proto external float GetCurrentWaterAccumulationPuddles ()
 
proto external void AddLightning (WeatherLightning lightning)
 
proto ref BaseWeatherStateTransitionManager GetTransitionManager ()
 Get weather state transition manager.
 
proto float GetMoonPhaseForDate (int year, int month, int day, float timeOfTheDay24, float timezone, float dstOffset)
 Gets moon phase for supplied date, geo location is not needed but timezone yes in order to calculate UTC correctly.
 
proto void GetCurrentSunMoonDirAndPhase (out vector outSunDir, out vector outMoonDir, out float outMoonPhase01)
 Retrieve current sun direction, moon direction and moon phase.
 
proto bool GetSunriseHour (out float hour24)
 Gets sunrise hour in 24 hour format e.g.
 
proto bool GetSunsetHour (out float hour24)
 Gets sunset hour in 24 hour format e.g.
 
proto bool GetSunriseHourForDate (int year, int month, int day, float latitude, float longitude, float timezone, float dstOffset, out float hour24)
 Gets sunrise hour in 24 hour format e.g.
 
proto bool GetSunsetHourForDate (int year, int month, int day, float latitude, float longitude, float timezone, float dstOffset, out float hour24)
 Gets sunset hour in 24 hour format e.g.
 
proto external float GetTimeOfTheDay ()
 Retrieves the current time of the day.
 
proto external bool SetTimeOfTheDay (float hours24, bool immediateChange=false)
 Sets the current time of the day.
 
proto external bool SetHoursMinutesSeconds (int hours, int minutes, int seconds, bool immediateChange=false)
 Sets the current time of the day.
 
proto external int GetYear ()
 Returns current in-game year.
 
proto external int GetMonth ()
 Returns current in-game month of the year (Range 1-12)
 
proto external int GetDay ()
 Returns current in-game day of the month (Range 1-31)
 
proto external int GetDayInYear ()
 Returns the in-game day.
 
proto external bool SetDate (int year, int month, int day, bool immediateChange=false)
 Sets the current in-game date (year/month/day).
 
proto void GetDate (out int year, out int month, out int day)
 Retrieves the current date (year/month/day).
 
proto void GetHoursMinutesSeconds (out int hours, out int minutes, out int seconds)
 Retrieves the current time of the day.
 
proto external int GetWeekDay ()
 Returns current in-game week day in range [0-6], starts at Monday=0.
 
proto external int GetWeekDayForDate (int year, int month, int day)
 Returns week day in range [0-6], starts at Monday=0, for the supplied date.
 
proto external float GetEngineTime ()
 Retrieves the current engine time (synchronized between clients), this value is not affected by time multiplier nor automatic time advancement attributes.
 
proto external void GetWeatherStatesList (out notnull array< ref WeatherState > outStates)
 Gets all Weather States.
 
proto external float GetMoonPhase (float timeOfTheDay24)
 Gets moon phase for supplied time of the day.
 
proto external bool CheckValidDate (int year, int month, int day)
 Checks if date is valid (checks for leap years and correct day of the month)
 
proto external void UpdateWeather (float timeSlice)
 
- Public Member Functions inherited from GenericEntity
proto external void Activate ()
 Activate entity events.
 
proto external void Deactivate ()
 Deactivate entity events.
 
proto external void Show (bool show)
 
proto void Rpc (func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
 Attempts to run a remote procedure call (RPC) of this instance with parameters specified in method RplRpc attribute.
 
proto external WorldEditorAPI _WB_GetEditorAPI ()
 This returns world editor API, which is safe to use from editor events bellow.
 
proto external void OnTransformReset (bool isCorrection=false, vector newVelocity=vector.Zero)
 Notifies the entity that its transformation has been discontinuously changed.
 
IEntity _WB_GetEditableOwner ()
 Editor needs to know if there is any entity which manages this one and is editable.
 
void _WB_MakeVisible (IEntitySource src, bool visible)
 Editor needs to have entity visible or not. Do not call editor API here!
 
void _WB_SetTransform (inout vector mat[4], IEntitySource src)
 Editor changed transformation matrix source. This is the place to apply it on entity. Do not call editor API here!
 
void _WB_OnInit (inout vector mat[4], IEntitySource src)
 Called always after entity creation. It's purpose is to prepare entity for editing. Do not edit anything through editor API here because it's too early for undoable actions! Use plain BaseContainer API for changes through src parameter if needed!
 
bool _WB_CanDelete (IEntitySource src)
 Editor needs to know if this entity can to be deleted. Do not call editor API here!
 
bool _WB_CanRename (IEntitySource src)
 Editor needs to know if this entity can to be renamed. Do not call editor API here!
 
bool _WB_CanCopy (IEntitySource src)
 Editor needs to know if this entity can be copied. Do not call editor API here!
 
bool _WB_CanSelect (IEntitySource src)
 Editor needs to know whether this entity can be selected in scene window or not.
 
int _WB_GetAnchorCount (IEntitySource src)
 Returns how many anchor points does this entity have at this time.
 
void _WB_GetAnchor (inout vector position, IEntitySource src, int index)
 Fills position of anchor at index index to anchorPosition
 
void _WB_OnAnchorSnapped (IEntitySource thisSrc, int thisAnchor, IEntitySource otherSrc, int otherAnchor, bool isReceiver)
 Called when two entities are snapped together.
 
bool _WB_CanAnchorSnap (IEntitySource thisSrc, int thisAnchor, IEntitySource otherSrc, int otherAnchor, bool isReceiver)
 
void _WB_GetBoundBox (inout vector min, inout vector max, IEntitySource src)
 Editor needs to know a bound box of entity (For ray-casting, visualizers etc.). You can return any custom size you need. Do not call editor API here!
 
bool _WB_ShouldShowBoundBox (IEntitySource src)
 Returns true if bound box should be visible when entity is hovered/selected in WB.
 
void _WB_SetExtraVisualiser (EntityVisualizerType type, IEntitySource src)
 If entity needs to have a special visualizer instead of default one, here is the place where you can implement it. Do not call editor API here!
 
array< ref WB_UIMenuItem_WB_GetContextMenuItems ()
 An opportunity to append items into editor's "Entity" context menu. Do not call editor API here!
 
bool _WB_OnPhysSimulPlacementBegin (IEntitySource src)
 Does this entity support editing transformation using physics simulation? Do not call editor API here!
 
bool _WB_EnablePhysics (IEntitySource src, bool physics)
 Prepare to edit transformation using physics simulation. Return previous status. Do not call editor API here!
 
array< ref ParamEnum_WB_GetUserEnums (string varName, IEntitySource src)
 Possibility to get variable value choices dynamically. Do not call editor API here!
 
bool _WB_OnKeyChanged (BaseContainer src, string key, BaseContainerList ownerContainers, IEntity parent)
 Any property value has been changed. You can use editor API here and do some additional edit actions which will be part of the same "key changed" action.
 
void _WB_AfterWorldUpdate (float timeSlice)
 Called after updating world in Workbench. The entity must be visible in frustum, selected or named. You can use editor API here and do some edit actions if needed.
 
void _WB_OnContextMenu (int id)
 User has chosen any of your menu item from editor's "Entity" menu which you have recently provided in WB_GetContextMenuItems(). You can use editor API here and do some edit actions.
 
void _WB_OnKeyDown (int keyCode)
 User pressed a key and this entity is main member of entity selection. You can use editor API here and do some edit actions which will be undoable.
 
void _WB_OnCreate (IEntitySource src)
 Called after entity gets created in map during editing or when deleted entity gets restored after undo action. This event isn't called by loading map!!! If you need an event that is being called after every entity creation then use WB_OnInit instead it. You can use editor API here and do some additional edit actions which will be part of the same "create entity" action.
 
void _WB_OnParentChange (IEntitySource src, IEntitySource prevParentSrc)
 Parent entity has been changed ( it's available through src->GetParent() ). prevParentSrc is a pointer to a previous parent (if any)
 
void _WB_OnDelete (IEntitySource src)
 This entity is going to be deleted. You can use editor API here and do some additional edit actions which will be part of the same "entity delete" action.
 
void _WB_OnRename (IEntitySource src, string oldName)
 This entity has been renamed. You can use editor API here and do some additional edit actions which will be part of the same "entity rename" action.
 
- Public Member Functions inherited from IEntity
proto external EntityID GetID ()
 Return unique entity ID.
 
proto external IEntity GetParent ()
 Returns parent of this entity (entity on upper level of hierarchy).
 
proto external IEntity GetRootParent ()
 Returns top-parent of this entity.
 
proto external IEntity GetChildren ()
 Returns first child from this level of hierarchy if there is any.
 
proto external IEntity GetSibling ()
 Returns next sibling of this entity (next entity on this level of hierarchy).
 
proto external VObject GetVObject ()
 Returns visual object set to this Entity. No reference is added.
 
proto external EntityPrefabData GetPrefabData ()
 
proto external EntityComponentPrefabData FindComponentData (TypeName typeName)
 
proto external BaseWorld GetWorld ()
 
proto external void SetFixedLOD (int lod)
 Set fixed LOD. Use -1 for non-fixed LOD.
 
proto external void GetTransform (out vector mat[])
 Returns world transformation of Entity.
 
proto external void GetWorldTransform (out vector mat[])
 See IEntity::GetTransform.
 
proto external void GetLocalTransform (out vector mat[])
 See IEntity::GetTransform.
 
proto external vector VectorToParent (vector vec)
 Transforms local vector to parent(world) space.
 
proto external vector CoordToParent (vector coord)
 Transforms local position to parent(world) space.
 
proto external vector VectorToLocal (vector vec)
 Transforms world space vector to local space.
 
proto external vector CoordToLocal (vector coord)
 Transforms world space position to local space.
 
proto external vector GetYawPitchRoll ()
 Returns orientation of Entity in world space (Yaw, Pitch, Roll).
 
proto external void SetYawPitchRoll (vector angles)
 Sets angles for entity (Yaw, Pitch, Roll).
 
proto external vector GetWorldTransformAxis (int axis)
 See IEntity::GetTransformAxis.
 
proto external vector GetTransformAxis (int axis)
 See IEntity::GetTransformAxis.
 
proto external vector GetLocalTransformAxis (int axis)
 See IEntity::GetTransformAxis.
 
proto external bool SetLocalTransform (vector mat[4])
 See IEntity::SetTransform. Returns false, if there is no change in transformation.
 
proto external bool SetWorldTransform (vector mat[4])
 See IEntity::SetTransform. Returns false, if there is no change in transformation.
 
proto external TNodeId GetPivot ()
 Returns pivot ID from hierarchy component.
 
proto external bool SetTransform (vector mat[4])
 Sets entity world transformation.
 
proto external vector GetLocalAngles ()
 Same as GetLocalYawPitchRoll(), but returns rotation vector around X, Y and Z axis.
 
proto external vector GetLocalYawPitchRoll ()
 Returns local orientation when it's in hierarchy (Yaw, Pitch, Roll).
 
proto external vector GetAngles ()
 Same as GetYawPitchRoll(), but returns rotation vector around X, Y and Z axis.
 
proto external void SetAngles (vector angles)
 Same as SetYawPitchRoll(), but sets rotation around X, Y and Z axis.
 
proto external vector GetOrigin ()
 Returns origin of Entity.
 
proto external void SetOrigin (vector orig)
 Sets origin for entity.
 
proto external void SetScale (float scale)
 
proto external float GetScale ()
 
proto external void GetBounds (out vector mins, out vector maxs)
 Returns local bounding box of model on Entity.
 
proto external void GetWorldBounds (out vector mins, out vector maxs)
 Returns quantized world-bound-box of Entity.
 
proto external volatile void SendEvent (notnull IEntity actor, EntityEvent e, void extra)
 Dynamic event invocation. Parameters are the same as in IEntity::EOnXXXX() methods.
 
proto external string GetName ()
 
proto external int SetVComponentFlags (VCFlags flags)
 Sets component flags.
 
proto external void SetObject (VObject object, string options)
 Sets the visual object to this entity.
 
proto external EntityFlags SetFlags (EntityFlags flags, bool recursively=false)
 Sets Entity flags.
 
proto external EntityFlags ClearFlags (EntityFlags flags, bool recursively=false)
 Clear Entity flags.
 
proto external EntityFlags GetFlags ()
 Returns Entity flags.
 
proto external EntityEvent SetEventMask (EntityEvent e)
 Sets event mask.
 
proto external EntityEvent ClearEventMask (EntityEvent e)
 Clears event mask.
 
proto external EntityEvent GetEventMask ()
 Returns current event mask.
 
proto external bool IsLoaded ()
 
proto external bool IsRemoved ()
 
proto external bool IsDeleted ()
 
proto external int Update ()
 Updates entity state/position.
 
proto external int AddChild (notnull IEntity child, TNodeId pivot, EAddChildFlags flags=EAddChildFlags.AUTO_TRANSFORM)
 Add Entity to hierarchy. Pivot is pivot index, or -1 for center of parent.
 
proto external void RemoveChild (notnull IEntity child, bool keepTransform=false)
 Remove Entity from hierarchy.
 
proto external void SetName (string name)
 
proto external int SetCameraMask (int mask)
 Sets visibility mask for cameras, where Entity will be rendered.
 
proto external Physics GetPhysics ()
 
proto external Particles GetParticles ()
 
proto external Animation GetAnimation ()
 
proto external int Animate (float speed, int loop)
 Updates animation (either xob, or particle, whatever).
 
proto external int AnimateEx (float speed, int loop, out vector lin, out vector ang)
 Updates animation (either xob, or particle, whatever).
 
proto external void SetBone (TNodeId bone, vector angles, vector trans, float scale)
 
proto external bool SetBoneMatrix (TNodeId bone, vector mat[4])
 
proto external bool GetBoneMatrix (TNodeId bone, out vector mat[4])
 
proto external TNodeId GetBoneIndex (string boneName)
 
proto external void GetBoneNames (out notnull array< string > boneNames)
 
proto external bool GetBoneLocalMatrix (TNodeId bone, out vector mat[4])
 
proto external Managed FindComponent (TypeName typeName)
 Finds first occurance of the coresponding component.
 
proto external int FindComponents (TypeName typeName, notnull array< Managed > outComponents)
 Finds all occurances of the coresponding component.
 
- Public Member Functions inherited from Managed
proto external ref Managed Clone ()
 Return shallow copy of object, or null if it is not allowed (not public constructor)
 

Static Public Member Functions

static proto void TimeToHoursMinutesSeconds (float hours24, out int hours, out int minutes, out int seconds)
 
static proto float HoursMinutesSecondsToTime (int hours, int minutes, int seconds)
 
- Static Public Member Functions inherited from GenericEntity
static bool Preload (IEntitySource src)
 
static proto void GetMatrixFromSource (BaseWorld world, IEntitySource src, bool withScale, out vector mat[4])
 

Additional Inherited Members

- Protected Member Functions inherited from GenericEntity
bool RplLoad (ScriptBitReader reader)
 Called when Item is initialized from replication stream.
 
bool RplSave (ScriptBitWriter writer)
 Called when Item is getting replicated from Master to Slave connection.
 
proto external void ConnectToDiagSystem ()
 
proto external void DisconnectFromDiagSystem ()
 
void EOnDiag (IEntity owner, float timeSlice)
 
void EOnActivate (IEntity owner)
 Event when entity is activated.
 
void EOnDeactivate (IEntity owner)
 Event when entity is deactivated.
 
void OnTransformResetImpl (TransformResetParams params)
 Script-side implementation of OnTransformReset.
 
- Protected Member Functions inherited from IEntity
void EOnTouch (IEntity owner, IEntity other, int touchTypesMask)
 Event when touched by other entity.
 
void EOnInit (IEntity owner)
 Event after entity is allocated and initialized.
 
void EOnVisible (IEntity owner, int frameNumber)
 Event when we are visible.
 
void EOnFrame (IEntity owner, float timeSlice)
 Event every frame.
 
void EOnPostFrame (IEntity owner, float timeSlice)
 Event after physics update.
 
void EOnAnimEvent (IEntity owner, int type, int slot)
 Event from animation system.
 
void EOnSimulate (IEntity owner, float timeSlice)
 Event before every physics fixed step (can be multiple calls per engine update)
 
void EOnPostSimulate (IEntity owner, float timeSlice)
 Event after every physics fixed step (can be multiple calls per engine update)
 
void EOnJointBreak (IEntity owner, IEntity other)
 Event when joint attached to RigidBody of this entity is broken.
 
void EOnPhysicsMove (IEntity owner)
 Event when physics engine has moved with this Entity.
 
void EOnContact (IEntity owner, IEntity other, Contact contact)
 Event when physics engine registered contact with other RigidBody.
 
void EOnPhysicsActive (IEntity owner, bool activeState)
 Event when a RigidBody active state is changed between consecutive fixed steps.
 
void EOnFixedFrame (IEntity owner, float timeSlice)
 Event every fixed frame.
 
void EOnFixedPostFrame (IEntity owner, float timeSlice)
 Event after physics update every fixed frame.
 
void EOnUser0 (IEntity other, int extra)
 EntityEvent.EV_USER+0.
 
void EOnUser1 (IEntity other, int extra)
 EntityEvent.EV_USER+1.
 
void EOnUser2 (IEntity other, int extra)
 EntityEvent.EV_USER+2.
 
void EOnUser3 (IEntity other, int extra)
 EntityEvent.EV_USER+3.
 
void EOnUser4 (IEntity other, int extra)
 EntityEvent.EV_USER+4.
 
void IEntity (IEntitySource src, IEntity parent)
 protected script Constructor
 

Member Function Documentation

◆ AddLightning()

proto external void BaseWeatherManagerEntity.AddLightning ( WeatherLightning  lightning)

◆ CheckValidDate()

proto external bool BaseWeatherManagerEntity.CheckValidDate ( int  year,
int  month,
int  day 
)

Checks if date is valid (checks for leap years and correct day of the month)

Parameters
yearYear
monthMonth (in 1-12 range)
dayDay (in 1-31 range)
Returns
Returns true when date is valid, false otherwise.

◆ GetCurrentLatitude()

proto external float BaseWeatherManagerEntity.GetCurrentLatitude ( )

Returns current latitude.

◆ GetCurrentLongitude()

proto external float BaseWeatherManagerEntity.GetCurrentLongitude ( )

Returns current longitude.

◆ GetCurrentSunMoonDirAndPhase()

proto void BaseWeatherManagerEntity.GetCurrentSunMoonDirAndPhase ( out vector  outSunDir,
out vector  outMoonDir,
out float  outMoonPhase01 
)

Retrieve current sun direction, moon direction and moon phase.

Parameters
outSunDirCurrent sun direction
outMoonDirCurrent moon direction
outMoonPhase01Moon phase (0 = new moon, 1 = full moon)

◆ GetCurrentWaterAccumulationCracks()

proto external float BaseWeatherManagerEntity.GetCurrentWaterAccumulationCracks ( )

◆ GetCurrentWaterAccumulationPuddles()

proto external float BaseWeatherManagerEntity.GetCurrentWaterAccumulationPuddles ( )

◆ GetCurrentWeatherState()

proto external ref WeatherState BaseWeatherManagerEntity.GetCurrentWeatherState ( )

◆ GetCurrentWetness()

proto external float BaseWeatherManagerEntity.GetCurrentWetness ( )

◆ GetDate()

proto void BaseWeatherManagerEntity.GetDate ( out int  year,
out int  month,
out int  day 
)

Retrieves the current date (year/month/day).

Returns
Returns Current date (Year, Month in 1-12 range, Day in 1-31 range)

◆ GetDay()

proto external int BaseWeatherManagerEntity.GetDay ( )

Returns current in-game day of the month (Range 1-31)

◆ GetDayDuration()

proto external float BaseWeatherManagerEntity.GetDayDuration ( )

Retrieves in-game day duration as realtime seconds.

Returns
Returns the duration of one in-game day as realtime seconds.

◆ GetDayInYear()

proto external int BaseWeatherManagerEntity.GetDayInYear ( )

Returns the in-game day.

◆ GetDSTOffset()

proto external float BaseWeatherManagerEntity.GetDSTOffset ( )

Gets DST offset (in hours)

◆ GetEngineTime()

proto external float BaseWeatherManagerEntity.GetEngineTime ( )

Retrieves the current engine time (synchronized between clients), this value is not affected by time multiplier nor automatic time advancement attributes.

◆ GetFogAmount()

proto external float BaseWeatherManagerEntity.GetFogAmount ( )

◆ GetFogHeightDensity()

proto external float BaseWeatherManagerEntity.GetFogHeightDensity ( )

◆ GetHoursMinutesSeconds()

proto void BaseWeatherManagerEntity.GetHoursMinutesSeconds ( out int  hours,
out int  minutes,
out int  seconds 
)

Retrieves the current time of the day.

Returns
Returns script wrapper for time Example:
int h, m, s;
Print(h);
Print(m);
Print(s);
>> int h = 16
>> int m = 30
>> int s = 00
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
proto external bool SetTimeOfTheDay(float hours24, bool immediateChange=false)
Sets the current time of the day.
proto void GetHoursMinutesSeconds(out int hours, out int minutes, out int seconds)
Retrieves the current time of the day.

◆ GetIsDayAutoAdvanced()

proto external bool BaseWeatherManagerEntity.GetIsDayAutoAdvanced ( )

Retrieves whether automatic time advancement is enabled or not.

Returns
Returns true if daytime is advaned automatically, false otherwise.

◆ GetMonth()

proto external int BaseWeatherManagerEntity.GetMonth ( )

Returns current in-game month of the year (Range 1-12)

◆ GetMoonPhase()

proto external float BaseWeatherManagerEntity.GetMoonPhase ( float  timeOfTheDay24)

Gets moon phase for supplied time of the day.

Returns
phase in <0...1> range. 0 = new moon, 1 = full moon

◆ GetMoonPhaseForDate()

proto float BaseWeatherManagerEntity.GetMoonPhaseForDate ( int  year,
int  month,
int  day,
float  timeOfTheDay24,
float  timezone,
float  dstOffset 
)

Gets moon phase for supplied date, geo location is not needed but timezone yes in order to calculate UTC correctly.

Parameters
yearYear.
monthMonth in range <1, 12>
dayDay in range <1, 31>
timeOfTheDay24Time of the day in 24 hour floating point format.
timezoneTimeZone Offset in hours ranging <-12, +14>
dstOffsetDST (daylight savings time) offset, must be 0.0 or positive value.
Returns
phase in <0...1> range. 0 = new moon, 1 = full moon

◆ GetRainIntensity()

proto external float BaseWeatherManagerEntity.GetRainIntensity ( )

◆ GetSunriseHour()

proto bool BaseWeatherManagerEntity.GetSunriseHour ( out float  hour24)

Gets sunrise hour in 24 hour format e.g.

12.50 is 12:30 A.M

Returns
True if there is a valid sunrise with current latitude/longitude/date configuration, false otherwise

◆ GetSunriseHourForDate()

proto bool BaseWeatherManagerEntity.GetSunriseHourForDate ( int  year,
int  month,
int  day,
float  latitude,
float  longitude,
float  timezone,
float  dstOffset,
out float  hour24 
)

Gets sunrise hour in 24 hour format e.g.

12.50 is 12:30 A.M. For specific date, geolocation, timezone and DST.

Parameters
yearYear.
monthMonth in range <1, 12>
dayDay in range <1, 31>
latitudeLatitude in range <-90, 90> where +90 equals north pole, 0 equator and -90.0 south pole
longitudeLongitude in range <-180.0, 180.0> where 0 equals (almost) greenwich meridian.
timezoneTimeZone Offset in hours ranging <-12, +14>
dstOffsetDST (daylight savings time) offset, must be 0.0 or positive value.
Returns
True if there is a valid sunrise with current latitude/longitude/date configuration, false otherwise

◆ GetSunsetHour()

proto bool BaseWeatherManagerEntity.GetSunsetHour ( out float  hour24)

Gets sunset hour in 24 hour format e.g.

12.50 is 12:30 A.M

Returns
True if there is a valid sunset with current latitude/longitude/date configuration, false otherwise

◆ GetSunsetHourForDate()

proto bool BaseWeatherManagerEntity.GetSunsetHourForDate ( int  year,
int  month,
int  day,
float  latitude,
float  longitude,
float  timezone,
float  dstOffset,
out float  hour24 
)

Gets sunset hour in 24 hour format e.g.

12.50 is 12:30 A.M for specific date.

Returns
True if there is a valid sunset with current latitude/longitude/date configuration, false otherwise

◆ GetTimeOfTheDay()

proto external float BaseWeatherManagerEntity.GetTimeOfTheDay ( )

Retrieves the current time of the day.

Returns
Time fraction in hours <0.0, 24.0> Example:
float totd = GetTimeOfTheDay();
Print(totd);
>> float totd = 16.5
proto external float GetTimeOfTheDay()
Retrieves the current time of the day.

◆ GetTimeZoneOffset()

proto external float BaseWeatherManagerEntity.GetTimeZoneOffset ( )

Returns time zone offset (in hours)

◆ GetTransitionManager()

proto ref BaseWeatherStateTransitionManager BaseWeatherManagerEntity.GetTransitionManager ( )

Get weather state transition manager.

Returns
Transition manager, null if client is not master.

◆ GetWeatherStatesList()

proto external void BaseWeatherManagerEntity.GetWeatherStatesList ( out notnull array< ref WeatherState outStates)

Gets all Weather States.

◆ GetWeekDay()

proto external int BaseWeatherManagerEntity.GetWeekDay ( )

Returns current in-game week day in range [0-6], starts at Monday=0.

Returns
positive integer 0-6 representing each day of the week, starting at Monday. -1 if current date is invalid.

◆ GetWeekDayForDate()

proto external int BaseWeatherManagerEntity.GetWeekDayForDate ( int  year,
int  month,
int  day 
)

Returns week day in range [0-6], starts at Monday=0, for the supplied date.

Returns
positive integer 0-6 representing each day of the week, starting at Monday. -1 if supplied date is invalid.
Parameters
yearYear.
monthMonth in range <1, 12>
dayDay in range <1, 31>

◆ GetWindDirection()

proto external float BaseWeatherManagerEntity.GetWindDirection ( )

Retrieves in-game wind direction angle in degrees.

Returns
Returns the in-game wind direction angle in degrees <0, 360.0>

◆ GetWindSpeed()

proto external float BaseWeatherManagerEntity.GetWindSpeed ( )

Retrieves in-game wind speed in meters per second.

Returns
Returns the in-game wind speed in meters per second.

◆ GetYear()

proto external int BaseWeatherManagerEntity.GetYear ( )

Returns current in-game year.

◆ HoursMinutesSecondsToTime()

static proto float BaseWeatherManagerEntity.HoursMinutesSecondsToTime ( int  hours,
int  minutes,
int  seconds 
)
static

◆ IsDSTEnabled()

proto external bool BaseWeatherManagerEntity.IsDSTEnabled ( )

Retrieves whether DST (daylight savings time) is enabled.

◆ IsFogAmountOverridden()

proto external bool BaseWeatherManagerEntity.IsFogAmountOverridden ( )

◆ IsFogHeightDensityOverridden()

proto external bool BaseWeatherManagerEntity.IsFogHeightDensityOverridden ( )

◆ IsRainIntensityOverridden()

proto external bool BaseWeatherManagerEntity.IsRainIntensityOverridden ( )

◆ IsWindDirectionOverridden()

proto external bool BaseWeatherManagerEntity.IsWindDirectionOverridden ( )

◆ IsWindSpeedOverridden()

proto external bool BaseWeatherManagerEntity.IsWindSpeedOverridden ( )

◆ SetCurrentLatitude()

proto external bool BaseWeatherManagerEntity.SetCurrentLatitude ( float  latitude)

Sets latitude as <-90, +90>.

Can only be set by the authority (server, singleplayer...)

Returns
Returns true when command is authorized, false otherwise.

◆ SetCurrentLongitude()

proto external bool BaseWeatherManagerEntity.SetCurrentLongitude ( float  longitude)

Sets longitude as <-180, +180>.

Can only be set by the authority (server, singleplayer...)

Returns
Returns true when command is authorized, false otherwise.

◆ SetCurrentWaterAccumulation()

proto external bool BaseWeatherManagerEntity.SetCurrentWaterAccumulation ( float  waterAccumulationCracks,
float  waterAccumulationPuddles 
)

◆ SetCurrentWetness()

proto external bool BaseWeatherManagerEntity.SetCurrentWetness ( float  wetness)

◆ SetDate()

proto external bool BaseWeatherManagerEntity.SetDate ( int  year,
int  month,
int  day,
bool  immediateChange = false 
)

Sets the current in-game date (year/month/day).

Only issuable by the authority. Automatically broadcast to all clients. You may check date validity prior to this call with CheckValidDate method.

Parameters
yearYear
monthMonth (in 1-12 range)
dayDay (in 1-31 range)
immediateChangeWhether change should be applied immediately, forcing recomputation. This should be true only in case of editor and similar items.
Returns
Returns true when command is issued successfully and date is VALID, false otherwise.

◆ SetDayDuration()

proto external bool BaseWeatherManagerEntity.SetDayDuration ( float  realtimeSeconds)

Sets in-game day duration as realtime seconds.

Only issuable by the authority. Automatically broadcast to all clients.

Parameters
realtimeSecondsSeconds in real time one ingame day will take.
Returns
Returns true when command is issued successfully, false otherwise.

◆ SetDSTEnabled()

proto external bool BaseWeatherManagerEntity.SetDSTEnabled ( bool  enabled)

Sets whether DST (daylight savings time) is enabled or disabled.

◆ SetDSTOffset()

proto external bool BaseWeatherManagerEntity.SetDSTOffset ( float  dstOffsetHours)

Sets DST Offset (in hours).

Can only be set by authority.

◆ SetFogAmountOverride()

proto external bool BaseWeatherManagerEntity.SetFogAmountOverride ( bool  doOverride,
float  fog = 0 
)

Sets current fog override (in range <0.0, 1.0>) Can only be set by the authority (server, singleplayer...)

Returns
Returns true when command is authorized, false otherwise.

◆ SetFogHeightDensityOverride()

proto external bool BaseWeatherManagerEntity.SetFogHeightDensityOverride ( bool  doOverride,
float  heightDensity = 0 
)

◆ SetHoursMinutesSeconds()

proto external bool BaseWeatherManagerEntity.SetHoursMinutesSeconds ( int  hours,
int  minutes,
int  seconds,
bool  immediateChange = false 
)

Sets the current time of the day.

Only issuable by the authority. Automatically broadcast to all clients.

Parameters
hoursHours <0,24>
minutesMinutes <0,60>
secondsSeconds <0,60>
immediateChangeWhether change should be applied immediately, forcing recomputation. This should be true only in case of editor and similar items.
Returns
Returns true when command is issued successfully, false otherwise. Example:
int h, m, s;
Print(h);
Print(m);
Print(s);
>> int h = 16
>> int m = 30
>> int s = 00
proto external bool SetHoursMinutesSeconds(int hours, int minutes, int seconds, bool immediateChange=false)
Sets the current time of the day.

◆ SetIsDayAutoAdvanced()

proto external bool BaseWeatherManagerEntity.SetIsDayAutoAdvanced ( bool  autoAdvanced)

Enables or disabled automatic daytime advancement.

Only issuable by the authority. Automatically broadcast to all clients.

Parameters
autoAdvancedTrue to enable, false to disable.
Returns
Returns true when command is issued successfully, false otherwise.

◆ SetRainIntensityOverride()

proto external bool BaseWeatherManagerEntity.SetRainIntensityOverride ( bool  doOverride,
float  rainIntensity = 0 
)

Sets current rain intensity override (in range <0.0, 1.0>) Can only be set by the authority (server, singleplayer...)

Returns
Returns true when command is authorized, false otherwise.

◆ SetTimeOfTheDay()

proto external bool BaseWeatherManagerEntity.SetTimeOfTheDay ( float  hours24,
bool  immediateChange = false 
)

Sets the current time of the day.

Only issuable by the authority. Automatically broadcast to all clients.

Parameters
hoursTime fraction in hours <0.0, 24.0>
immediateChangeWhether change should be applied immediately, forcing recomputation. This should be true only in case of editor and similar items.
Returns
Returns true when command is issued successfully, false otherwise. Example:
int h, m, s;
Print(h);
Print(m);
Print(s);
>> int h = 16
>> int m = 30
>> int s = 00

◆ SetTimeZoneOffset()

proto external bool BaseWeatherManagerEntity.SetTimeZoneOffset ( float  utcTimeZone)

Sets time zone offset (in hours) in range <-12.0, +14.0>

◆ SetWindDirectionOverride()

proto external bool BaseWeatherManagerEntity.SetWindDirectionOverride ( bool  doOverride,
float  windDirection = 0 
)

Sets in-game wind direction angle in degrees.

Only issuable by the authority. Automatically broadcast to all clients.

Parameters
windDirectionWind direction angle in degrees <0, 360.0>
Returns
Returns true when command is issued successfully, false otherwise.

◆ SetWindSpeedOverride()

proto external bool BaseWeatherManagerEntity.SetWindSpeedOverride ( bool  doOverride,
float  windSpeed = 0 
)

Sets in-game wind speed in meters per second.

Only issuable by the authority. Automatically broadcast to all clients.

Parameters
windSpeedWind speed in m/s.
Returns
Returns true when command is issued successfully, false otherwise.

◆ TimeToHoursMinutesSeconds()

static proto void BaseWeatherManagerEntity.TimeToHoursMinutesSeconds ( float  hours24,
out int  hours,
out int  minutes,
out int  seconds 
)
static

◆ UpdateWeather()

proto external void BaseWeatherManagerEntity.UpdateWeather ( float  timeSlice)

The documentation for this interface was generated from the following file: