Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
BaseWeatherStateTransitionManager Interface Reference

Public Member Functions

proto external bool IsPreviewingState ()
 Check if we are previewing a transition.
 
proto external bool IsPreviewingDateTime ()
 
proto external bool IsPreviewingWind ()
 
proto external bool SetStatePreview (bool preview, string stateName="")
 Previews state locally (without network syncing).
 
proto external bool SetDateTimePreview (bool preview, int year=-1, int month=-1, int day=-1, float timeOfTheDay01=-1)
 Previews date and time of the day locally (without network syncing).
 
proto external bool SetWindPreview (bool preview, float windSpeed=-1, float windAngleDegrees=-1)
 
proto external WeatherTransitionRequestResponse RequestStateTransitionImmediately (WeatherStateTransitionNode node)
 Requests an immediate transition.
 
proto external WeatherTransitionRequestResponse RequestStateTransition ()
 Requests next state transition from the state transition node queue.
 
proto external ref WeatherStateTransitionNode CreateStateTransition (string stateName, float transitionDurationHours, float stateDurationHours)
 
proto external bool EnqueueStateTransition (WeatherStateTransitionNode transition, bool checkValidity)
 Adds a new state transition to the state transition queue.
 
proto external bool InsertStateTransition (int index, WeatherStateTransitionNode transition, bool checkValidity)
 Inserts a state transition to the state transition queue.
 
proto external void GetStateTransitionNodeList (out notnull array< ref WeatherStateTransitionNode > outArr)
 Retrieves state transition node list.
 
proto external WeatherStateTransitionNode GetStateTransitionNode (int index)
 
proto external WeatherStateTransitionNode GetCurrentStateTransitionNode ()
 
proto external WeatherState GetCurrentState ()
 
proto external WeatherState GetNextState ()
 
proto external float GetTimeLeftUntilNextState ()
 Retrieves in-game remaining time until next state is completely set.
 
proto external float GetTimeLeftUntilNextVariant ()
 Retrieves in-game remaining time until next state's variant is completely set.
 
proto external bool RemoveStateTransition (int index, bool removeInvalidTransitions, out int totalRemoved)
 Removes state transition node at supplied index.
 
proto external int GetStateTransitionsCount ()
 Get total number of state transitions.
 
proto external bool CheckValidStateTransition (int stateIndexFrom, int stateIndexTo)
 
proto external void AddTransitionCallbacks (BaseWeatherTransitionCallbacks callbacks)
 
proto external void RemoveTransitionCallbacks (BaseWeatherTransitionCallbacks callbacks)
 

Member Function Documentation

◆ AddTransitionCallbacks()

proto external void BaseWeatherStateTransitionManager.AddTransitionCallbacks ( BaseWeatherTransitionCallbacks  callbacks)

◆ CheckValidStateTransition()

proto external bool BaseWeatherStateTransitionManager.CheckValidStateTransition ( int  stateIndexFrom,
int  stateIndexTo 
)

◆ CreateStateTransition()

proto external ref WeatherStateTransitionNode BaseWeatherStateTransitionManager.CreateStateTransition ( string  stateName,
float  transitionDurationHours,
float  stateDurationHours 
)

◆ EnqueueStateTransition()

proto external bool BaseWeatherStateTransitionManager.EnqueueStateTransition ( WeatherStateTransitionNode  transition,
bool  checkValidity 
)

Adds a new state transition to the state transition queue.

Keep in mind that state transition node cannot be inserted to the first node if a transition is already on course. Can only be called by the authority (server, singleplayer...).

Parameters
transitionTransition object to enqueue
checkValidityIf true, it will only accept valid transitions (transition must be compatible with previous node)
Returns
TRUE if transition is enqueued correctly. FALSE if transition is invalid not enqueued

◆ GetCurrentState()

proto external WeatherState BaseWeatherStateTransitionManager.GetCurrentState ( )

◆ GetCurrentStateTransitionNode()

proto external WeatherStateTransitionNode BaseWeatherStateTransitionManager.GetCurrentStateTransitionNode ( )

◆ GetNextState()

proto external WeatherState BaseWeatherStateTransitionManager.GetNextState ( )

◆ GetStateTransitionNode()

proto external WeatherStateTransitionNode BaseWeatherStateTransitionManager.GetStateTransitionNode ( int  index)

◆ GetStateTransitionNodeList()

proto external void BaseWeatherStateTransitionManager.GetStateTransitionNodeList ( out notnull array< ref WeatherStateTransitionNode outArr)

Retrieves state transition node list.

◆ GetStateTransitionsCount()

proto external int BaseWeatherStateTransitionManager.GetStateTransitionsCount ( )

Get total number of state transitions.

◆ GetTimeLeftUntilNextState()

proto external float BaseWeatherStateTransitionManager.GetTimeLeftUntilNextState ( )

Retrieves in-game remaining time until next state is completely set.

◆ GetTimeLeftUntilNextVariant()

proto external float BaseWeatherStateTransitionManager.GetTimeLeftUntilNextVariant ( )

Retrieves in-game remaining time until next state's variant is completely set.

◆ InsertStateTransition()

proto external bool BaseWeatherStateTransitionManager.InsertStateTransition ( int  index,
WeatherStateTransitionNode  transition,
bool  checkValidity 
)

Inserts a state transition to the state transition queue.

Keep in mind that state transition node cannot be inserted to the first node if a transition is already on course. Can only be called by the authority (server, singleplayer...).

Parameters
indexCorrect index, from 0 to length
transitionTransition node
checkValidityIf true, it will only accept valid transitions (transition must be compatible with previous and next nodes)
Returns
TRUE if transition is valid. FALSE if transition is invalid or not authority or out of bounds.

◆ IsPreviewingDateTime()

proto external bool BaseWeatherStateTransitionManager.IsPreviewingDateTime ( )

◆ IsPreviewingState()

proto external bool BaseWeatherStateTransitionManager.IsPreviewingState ( )

Check if we are previewing a transition.

◆ IsPreviewingWind()

proto external bool BaseWeatherStateTransitionManager.IsPreviewingWind ( )

◆ RemoveStateTransition()

proto external bool BaseWeatherStateTransitionManager.RemoveStateTransition ( int  index,
bool  removeInvalidTransitions,
out int  totalRemoved 
)

Removes state transition node at supplied index.

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

Parameters
indexIndex of node which will be deleted.
removeInvalidTransitionsPerform a sanity check and remove any transition nodes which arent compatible after deleting the selected one.
totalRemovedhow many nodes were removed, this will be 0 if supplied index is invalid or caller is not master. 1 if index is valid and removeInvalidTransitions == false, N if index is valid and removeInvalidTransitions == true
Returns
true if master and something was removed, false otherwise.

◆ RemoveTransitionCallbacks()

proto external void BaseWeatherStateTransitionManager.RemoveTransitionCallbacks ( BaseWeatherTransitionCallbacks  callbacks)

◆ RequestStateTransition()

proto external WeatherTransitionRequestResponse BaseWeatherStateTransitionManager.RequestStateTransition ( )

Requests next state transition from the state transition node queue.

This will start transitioning smoothly according to transition duration. Cannot be called if a transition is already on course.

Returns
SUCCESS if correct, otherwise see WeatherTransitionRequestResponse for possible responses.

◆ RequestStateTransitionImmediately()

proto external WeatherTransitionRequestResponse BaseWeatherStateTransitionManager.RequestStateTransitionImmediately ( WeatherStateTransitionNode  node)

Requests an immediate transition.

Parameters
nodeThe transition node we want to transition to, it must be a valid node within the state transition queue
Returns
SUCCESS if correct, otherwise see WeatherTransitionRequestResponse for possible responses.

◆ SetDateTimePreview()

proto external bool BaseWeatherStateTransitionManager.SetDateTimePreview ( bool  preview,
int  year = -1,
int  month = -1,
int  day = -1,
float  timeOfTheDay01 = -1 
)

Previews date and time of the day locally (without network syncing).

Parameters
previewEnables or disables the preview

◆ SetStatePreview()

proto external bool BaseWeatherStateTransitionManager.SetStatePreview ( bool  preview,
string  stateName = "" 
)

Previews state locally (without network syncing).

It is not required that the state is part of the state transition queue. I.e. you can preview nodes without inserting them.

Parameters
previewEnables or disables the preview
stateNameThe state to preview

◆ SetWindPreview()

proto external bool BaseWeatherStateTransitionManager.SetWindPreview ( bool  preview,
float  windSpeed = -1,
float  windAngleDegrees = -1 
)

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