CommonLibSSE NG
Loading...
Searching...
No Matches
RE::BSScript::IVirtualMachine Class Referenceabstract

#include <IVirtualMachine.h>

Inheritance diagram for RE::BSScript::IVirtualMachine:
RE::BSIntrusiveRefCounted RE::BSScript::Internal::VirtualMachine

Public Types

using Severity = BSScript::ErrorLogger::Severity
 

Public Member Functions

virtual ~IVirtualMachine ()
 
virtual void SetLinkedCallback (ITypeLinkedCallback *a_callback)=0
 
virtual void TraceStack (const char *a_str, VMStackID a_stackID, Severity a_severity=Severity::kError)=0
 
virtual void FormatAndPostMessage (const char *a_message, Severity a_severity)=0
 
virtual void Update (float a_budget)=0
 
virtual void UpdateTasklets (float a_budget)=0
 
virtual void SetOverstressed (bool a_set)=0
 
virtual bool IsCompletelyFrozen () const =0
 
virtual bool RegisterObjectType (VMTypeID a_typeID, const char *a_className)=0
 
virtual bool GetScriptObjectType1 (const BSFixedString &a_className, BSTSmartPointer< ObjectTypeInfo > &a_outTypeInfoPtr)=0
 
virtual bool GetScriptObjectType2 (VMTypeID a_typeID, BSTSmartPointer< ObjectTypeInfo > &a_outTypeInfoPtr)=0
 
virtual bool GetScriptObjectTypeNoLoad1 (const BSFixedString &a_className, BSTSmartPointer< ObjectTypeInfo > &a_typeInfoPtr) const =0
 
virtual bool GetScriptObjectTypeNoLoad2 (VMTypeID a_typeID, BSTSmartPointer< ObjectTypeInfo > &a_outTypeInfoPtr) const =0
 
virtual bool GetTypeIDForScriptObject (const BSFixedString &a_className, VMTypeID &a_typeID) const =0
 
virtual void GetScriptObjectsWithATypeID (BSScrapArray< BSFixedString > &a_classes) const =0
 
virtual bool GetParentNativeType (const BSFixedString &a_className, BSTSmartPointer< ObjectTypeInfo > &a_typeInfoPtr)=0
 
virtual bool TypeIsValid (const BSFixedString &a_className)=0
 
virtual bool ReloadType (const char *a_className)=0
 
virtual void TasksToJobs (BSJobs::JobList &a_jobList)=0
 
virtual void CalculateFullReloadList (void) const =0
 
virtual bool CreateObject1 (const BSFixedString &a_className, void *a_property, BSTSmartPointer< Object > &a_objPtr)=0
 
virtual bool CreateObject2 (const BSFixedString &a_className, BSTSmartPointer< Object > &a_result)=0
 
virtual bool CreateArray1 (const TypeInfo &a_typeInfo, std::uint32_t a_size, BSTSmartPointer< Array > &a_arrayPtr)=0
 
virtual bool CreateArray2 (TypeInfo::RawType a_typeID, const BSFixedString &a_className, std::uint32_t a_size, BSTSmartPointer< Array > &a_arrayPtr)=0
 
virtual bool BindNativeMethod (IFunction *a_fn)=0
 
virtual void SetCallableFromTasklets1 (const char *a_className, const char *a_stateName, const char *a_fnName, bool a_callable)=0
 
virtual void SetCallableFromTasklets2 (const char *a_className, const char *a_fnName, bool a_callable)=0
 
virtual void New_1B (void)=0
 
SKYRIM_REL_VR_VIRTUAL void ForEachBoundObject (VMHandle a_handle, IForEachScriptObjectFunctor *a_functor)
 
virtual void New_1D (void)=0
 
SKYRIM_REL_VR_VIRTUAL bool FindBoundObject (VMHandle a_handle, const char *a_className, BSTSmartPointer< Object > &a_result) const
 
SKYRIM_REL_VR_VIRTUAL void MoveBoundObjects (VMHandle a_from, VMHandle a_to)
 
SKYRIM_REL_VR_VIRTUAL void ResetAllBoundObjects (VMHandle a_handle)
 
SKYRIM_REL_VR_VIRTUAL bool CastObject (const BSTSmartPointer< Object > &a_fromObjPtr, const BSTSmartPointer< ObjectTypeInfo > &a_toTypeInfoPtr, BSTSmartPointer< Object > &a_toObjPtr)
 
SKYRIM_REL_VR_VIRTUAL bool SetPropertyValue (BSTSmartPointer< Object > &a_obj, const char *a_propertyName, Variable &a_setVal)
 
SKYRIM_REL_VR_VIRTUAL bool GetPropertyValue (BSTSmartPointer< Object > &a_obj, const char *a_propertyName, Variable &a_getVal)
 
SKYRIM_REL_VR_VIRTUAL bool GetVariableValue1 (const BSTSmartPointer< Object > &a_objPtr, std::uint32_t a_index, Variable &a_out) const
 
SKYRIM_REL_VR_VIRTUAL bool GetVariableValue2 (VMHandle a_handle, const BSFixedString &a_className, std::int32_t a_variableIndex, Variable &a_out) const
 
SKYRIM_REL_VR_VIRTUAL void SendEvent (VMHandle a_handle, const BSFixedString &a_eventName, IFunctionArguments *a_args)
 
SKYRIM_REL_VR_VIRTUAL void SendEventAll (const BSFixedString &a_eventName, IFunctionArguments *a_args)
 
SKYRIM_REL_VR_VIRTUAL bool DispatchStaticCall (const BSFixedString &a_className, const BSFixedString &a_fnName, IFunctionArguments *a_args, BSTSmartPointer< IStackCallbackFunctor > &a_result)
 
SKYRIM_REL_VR_VIRTUAL bool DispatchMethodCall1 (BSTSmartPointer< Object > &a_obj, const BSFixedString &a_fnName, IFunctionArguments *a_args, BSTSmartPointer< IStackCallbackFunctor > &a_result)
 
SKYRIM_REL_VR_VIRTUAL bool DispatchMethodCall2 (VMHandle a_handle, const BSFixedString &a_className, const BSFixedString &a_fnName, IFunctionArguments *a_args, BSTSmartPointer< IStackCallbackFunctor > &a_result)
 
SKYRIM_REL_VR_VIRTUAL bool DispatchUnboundMethodCall (void)
 
SKYRIM_REL_VR_VIRTUAL bool IsWaitingOnLatent (VMStackID a_stackID) const
 
SKYRIM_REL_VR_VIRTUAL void ReturnFromLatent (VMStackID a_stackID, const Variable &a_val)
 
SKYRIM_REL_VR_VIRTUAL ErrorLoggerGetErrorLogger ()
 
SKYRIM_REL_VR_VIRTUAL IObjectHandlePolicyGetObjectHandlePolicy1 ()
 
SKYRIM_REL_VR_VIRTUAL const IObjectHandlePolicyGetObjectHandlePolicy2 () const
 
SKYRIM_REL_VR_VIRTUAL ObjectBindPolicyGetObjectBindPolicy1 ()
 
SKYRIM_REL_VR_VIRTUAL const ObjectBindPolicyGetObjectBindPolicy2 () const
 
SKYRIM_REL_VR_VIRTUAL ISavePatcherInterfaceGetSavePatcherInterface ()
 
SKYRIM_REL_VR_VIRTUAL void RegisterForLogEvent (BSTEventSink< LogEvent > *a_sink)
 
SKYRIM_REL_VR_VIRTUAL void UnregisterForLogEvent (BSTEventSink< LogEvent > *a_sink)
 
SKYRIM_REL_VR_VIRTUAL void RegisterForStatsEvent (BSTEventSink< StatsEvent > *a_sink)
 
SKYRIM_REL_VR_VIRTUAL void UnregisterForStatsEvent (BSTEventSink< StatsEvent > *a_sink)
 
bool CreateArray (const TypeInfo &a_typeInfo, std::uint32_t a_size, BSTSmartPointer< Array > &a_arrayPtr)
 
bool CreateArray (TypeInfo::RawType a_typeID, const BSFixedString &a_className, std::uint32_t a_size, BSTSmartPointer< Array > &a_arrayPtr)
 
bool CreateObject (const BSFixedString &a_className, void *a_property, BSTSmartPointer< Object > &a_objPtr)
 
bool CreateObject (const BSFixedString &a_className, BSTSmartPointer< Object > &a_result)
 
bool DispatchMethodCall (BSTSmartPointer< Object > &a_obj, const BSFixedString &a_fnName, IFunctionArguments *a_args, BSTSmartPointer< IStackCallbackFunctor > &a_result)
 
bool DispatchMethodCall (VMHandle a_handle, const BSFixedString &a_className, const BSFixedString &a_fnName, IFunctionArguments *a_args, BSTSmartPointer< IStackCallbackFunctor > &a_result)
 
ObjectBindPolicyGetObjectBindPolicy ()
 
const ObjectBindPolicyGetObjectBindPolicy () const
 
IObjectHandlePolicyGetObjectHandlePolicy ()
 
const IObjectHandlePolicyGetObjectHandlePolicy () const
 
bool GetScriptObjectType (const BSFixedString &a_className, BSTSmartPointer< ObjectTypeInfo > &a_outTypeInfoPtr)
 
bool GetScriptObjectType (VMTypeID a_typeID, BSTSmartPointer< ObjectTypeInfo > &a_outTypeInfoPtr)
 
bool GetScriptObjectTypeNoLoad (const BSFixedString &a_className, BSTSmartPointer< ObjectTypeInfo > &a_typeInfoPtr) const
 
bool GetScriptObjectTypeNoLoad (VMTypeID a_typeID, BSTSmartPointer< ObjectTypeInfo > &a_outTypeInfoPtr) const
 
bool GetVariableValue (const BSTSmartPointer< Object > &a_objPtr, std::uint32_t a_index, Variable &a_out) const
 
bool GetVariableValue (VMHandle a_handle, const BSFixedString &a_className, std::int32_t a_variableIndex, Variable &a_out) const
 
template<class F >
void RegisterFunction (std::string_view a_fnName, std::string_view a_className, F a_callback, bool a_callableFromTasklets=false)
 
template<class R , class F >
void RegisterLatentFunction (std::string_view a_fnName, std::string_view a_className, F a_callback, bool a_callableFromTasklets=false)
 Registers a latent function. Unlike normal native functions, latent functions do not return a result to the script immediately.
 
template<class V >
requires is_return_convertible_v<V>
void ReturnLatentResult (VMStackID a_stackID, V result)
 Returns a result to the stack if it is waiting for a latent function to return. This is a wrapper over ReturnFromLatent.
 
void SetCallableFromTasklets (const char *a_className, const char *a_stateName, const char *a_fnName, bool a_callable)
 
void SetCallableFromTasklets (const char *a_className, const char *a_fnName, bool a_callable)
 
void TraceForm (TESForm *a_form, const char *a_str, VMStackID a_stackID, Severity a_severity=Severity::kError)
 
void VTraceStack (VMStackID a_stackID, Severity a_severity, const char *a_fmt,...)
 
- Public Member Functions inherited from RE::BSIntrusiveRefCounted
std::uint32_t IncRef () const
 
std::uint32_t DecRef () const
 
 TES_HEAP_REDEFINE_NEW ()
 

Public Attributes

std::uint32_t pad0C
 

Static Public Attributes

static constexpr auto RTTI = RTTI_BSScript__IVirtualMachine
 

Additional Inherited Members

- Protected Attributes inherited from RE::BSIntrusiveRefCounted
volatile std::uint32_t _refCount { 0 }
 

Member Typedef Documentation

◆ Severity

Constructor & Destructor Documentation

◆ ~IVirtualMachine()

virtual RE::BSScript::IVirtualMachine::~IVirtualMachine ( )
virtual

Member Function Documentation

◆ BindNativeMethod()

virtual bool RE::BSScript::IVirtualMachine::BindNativeMethod ( IFunction a_fn)
pure virtual

◆ CalculateFullReloadList()

virtual void RE::BSScript::IVirtualMachine::CalculateFullReloadList ( void  ) const
pure virtual

◆ CastObject()

SKYRIM_REL_VR_VIRTUAL bool RE::BSScript::IVirtualMachine::CastObject ( const BSTSmartPointer< Object > &  a_fromObjPtr,
const BSTSmartPointer< ObjectTypeInfo > &  a_toTypeInfoPtr,
BSTSmartPointer< Object > &  a_toObjPtr 
)

◆ CreateArray() [1/2]

bool RE::BSScript::IVirtualMachine::CreateArray ( const TypeInfo a_typeInfo,
std::uint32_t  a_size,
BSTSmartPointer< Array > &  a_arrayPtr 
)

◆ CreateArray() [2/2]

bool RE::BSScript::IVirtualMachine::CreateArray ( TypeInfo::RawType  a_typeID,
const BSFixedString a_className,
std::uint32_t  a_size,
BSTSmartPointer< Array > &  a_arrayPtr 
)

◆ CreateArray1()

virtual bool RE::BSScript::IVirtualMachine::CreateArray1 ( const TypeInfo a_typeInfo,
std::uint32_t  a_size,
BSTSmartPointer< Array > &  a_arrayPtr 
)
pure virtual

◆ CreateArray2()

virtual bool RE::BSScript::IVirtualMachine::CreateArray2 ( TypeInfo::RawType  a_typeID,
const BSFixedString a_className,
std::uint32_t  a_size,
BSTSmartPointer< Array > &  a_arrayPtr 
)
pure virtual

◆ CreateObject() [1/2]

bool RE::BSScript::IVirtualMachine::CreateObject ( const BSFixedString a_className,
BSTSmartPointer< Object > &  a_result 
)

◆ CreateObject() [2/2]

bool RE::BSScript::IVirtualMachine::CreateObject ( const BSFixedString a_className,
void *  a_property,
BSTSmartPointer< Object > &  a_objPtr 
)

◆ CreateObject1()

virtual bool RE::BSScript::IVirtualMachine::CreateObject1 ( const BSFixedString a_className,
void *  a_property,
BSTSmartPointer< Object > &  a_objPtr 
)
pure virtual

◆ CreateObject2()

virtual bool RE::BSScript::IVirtualMachine::CreateObject2 ( const BSFixedString a_className,
BSTSmartPointer< Object > &  a_result 
)
pure virtual

◆ DispatchMethodCall() [1/2]

bool RE::BSScript::IVirtualMachine::DispatchMethodCall ( BSTSmartPointer< Object > &  a_obj,
const BSFixedString a_fnName,
IFunctionArguments a_args,
BSTSmartPointer< IStackCallbackFunctor > &  a_result 
)

◆ DispatchMethodCall() [2/2]

bool RE::BSScript::IVirtualMachine::DispatchMethodCall ( VMHandle  a_handle,
const BSFixedString a_className,
const BSFixedString a_fnName,
IFunctionArguments a_args,
BSTSmartPointer< IStackCallbackFunctor > &  a_result 
)

◆ DispatchMethodCall1()

SKYRIM_REL_VR_VIRTUAL bool RE::BSScript::IVirtualMachine::DispatchMethodCall1 ( BSTSmartPointer< Object > &  a_obj,
const BSFixedString a_fnName,
IFunctionArguments a_args,
BSTSmartPointer< IStackCallbackFunctor > &  a_result 
)

◆ DispatchMethodCall2()

SKYRIM_REL_VR_VIRTUAL bool RE::BSScript::IVirtualMachine::DispatchMethodCall2 ( VMHandle  a_handle,
const BSFixedString a_className,
const BSFixedString a_fnName,
IFunctionArguments a_args,
BSTSmartPointer< IStackCallbackFunctor > &  a_result 
)

◆ DispatchStaticCall()

SKYRIM_REL_VR_VIRTUAL bool RE::BSScript::IVirtualMachine::DispatchStaticCall ( const BSFixedString a_className,
const BSFixedString a_fnName,
IFunctionArguments a_args,
BSTSmartPointer< IStackCallbackFunctor > &  a_result 
)

◆ DispatchUnboundMethodCall()

SKYRIM_REL_VR_VIRTUAL bool RE::BSScript::IVirtualMachine::DispatchUnboundMethodCall ( void  )

◆ FindBoundObject()

SKYRIM_REL_VR_VIRTUAL bool RE::BSScript::IVirtualMachine::FindBoundObject ( VMHandle  a_handle,
const char *  a_className,
BSTSmartPointer< Object > &  a_result 
) const

◆ ForEachBoundObject()

SKYRIM_REL_VR_VIRTUAL void RE::BSScript::IVirtualMachine::ForEachBoundObject ( VMHandle  a_handle,
IForEachScriptObjectFunctor *  a_functor 
)

◆ FormatAndPostMessage()

virtual void RE::BSScript::IVirtualMachine::FormatAndPostMessage ( const char *  a_message,
Severity  a_severity 
)
pure virtual

◆ GetErrorLogger()

SKYRIM_REL_VR_VIRTUAL ErrorLogger * RE::BSScript::IVirtualMachine::GetErrorLogger ( )

◆ GetObjectBindPolicy() [1/2]

ObjectBindPolicy * RE::BSScript::IVirtualMachine::GetObjectBindPolicy ( )

◆ GetObjectBindPolicy() [2/2]

const ObjectBindPolicy * RE::BSScript::IVirtualMachine::GetObjectBindPolicy ( ) const

◆ GetObjectBindPolicy1()

SKYRIM_REL_VR_VIRTUAL ObjectBindPolicy * RE::BSScript::IVirtualMachine::GetObjectBindPolicy1 ( )

◆ GetObjectBindPolicy2()

SKYRIM_REL_VR_VIRTUAL const ObjectBindPolicy * RE::BSScript::IVirtualMachine::GetObjectBindPolicy2 ( ) const

◆ GetObjectHandlePolicy() [1/2]

IObjectHandlePolicy * RE::BSScript::IVirtualMachine::GetObjectHandlePolicy ( )

◆ GetObjectHandlePolicy() [2/2]

const IObjectHandlePolicy * RE::BSScript::IVirtualMachine::GetObjectHandlePolicy ( ) const

◆ GetObjectHandlePolicy1()

SKYRIM_REL_VR_VIRTUAL IObjectHandlePolicy * RE::BSScript::IVirtualMachine::GetObjectHandlePolicy1 ( )

◆ GetObjectHandlePolicy2()

SKYRIM_REL_VR_VIRTUAL const IObjectHandlePolicy * RE::BSScript::IVirtualMachine::GetObjectHandlePolicy2 ( ) const

◆ GetParentNativeType()

virtual bool RE::BSScript::IVirtualMachine::GetParentNativeType ( const BSFixedString a_className,
BSTSmartPointer< ObjectTypeInfo > &  a_typeInfoPtr 
)
pure virtual

◆ GetPropertyValue()

SKYRIM_REL_VR_VIRTUAL bool RE::BSScript::IVirtualMachine::GetPropertyValue ( BSTSmartPointer< Object > &  a_obj,
const char *  a_propertyName,
Variable a_getVal 
)

◆ GetSavePatcherInterface()

SKYRIM_REL_VR_VIRTUAL ISavePatcherInterface * RE::BSScript::IVirtualMachine::GetSavePatcherInterface ( )

◆ GetScriptObjectsWithATypeID()

virtual void RE::BSScript::IVirtualMachine::GetScriptObjectsWithATypeID ( BSScrapArray< BSFixedString > &  a_classes) const
pure virtual

◆ GetScriptObjectType() [1/2]

bool RE::BSScript::IVirtualMachine::GetScriptObjectType ( const BSFixedString a_className,
BSTSmartPointer< ObjectTypeInfo > &  a_outTypeInfoPtr 
)

◆ GetScriptObjectType() [2/2]

bool RE::BSScript::IVirtualMachine::GetScriptObjectType ( VMTypeID  a_typeID,
BSTSmartPointer< ObjectTypeInfo > &  a_outTypeInfoPtr 
)

◆ GetScriptObjectType1()

virtual bool RE::BSScript::IVirtualMachine::GetScriptObjectType1 ( const BSFixedString a_className,
BSTSmartPointer< ObjectTypeInfo > &  a_outTypeInfoPtr 
)
pure virtual

◆ GetScriptObjectType2()

virtual bool RE::BSScript::IVirtualMachine::GetScriptObjectType2 ( VMTypeID  a_typeID,
BSTSmartPointer< ObjectTypeInfo > &  a_outTypeInfoPtr 
)
pure virtual

◆ GetScriptObjectTypeNoLoad() [1/2]

bool RE::BSScript::IVirtualMachine::GetScriptObjectTypeNoLoad ( const BSFixedString a_className,
BSTSmartPointer< ObjectTypeInfo > &  a_typeInfoPtr 
) const

◆ GetScriptObjectTypeNoLoad() [2/2]

bool RE::BSScript::IVirtualMachine::GetScriptObjectTypeNoLoad ( VMTypeID  a_typeID,
BSTSmartPointer< ObjectTypeInfo > &  a_outTypeInfoPtr 
) const

◆ GetScriptObjectTypeNoLoad1()

virtual bool RE::BSScript::IVirtualMachine::GetScriptObjectTypeNoLoad1 ( const BSFixedString a_className,
BSTSmartPointer< ObjectTypeInfo > &  a_typeInfoPtr 
) const
pure virtual

◆ GetScriptObjectTypeNoLoad2()

virtual bool RE::BSScript::IVirtualMachine::GetScriptObjectTypeNoLoad2 ( VMTypeID  a_typeID,
BSTSmartPointer< ObjectTypeInfo > &  a_outTypeInfoPtr 
) const
pure virtual

◆ GetTypeIDForScriptObject()

virtual bool RE::BSScript::IVirtualMachine::GetTypeIDForScriptObject ( const BSFixedString a_className,
VMTypeID a_typeID 
) const
pure virtual

◆ GetVariableValue() [1/2]

bool RE::BSScript::IVirtualMachine::GetVariableValue ( const BSTSmartPointer< Object > &  a_objPtr,
std::uint32_t  a_index,
Variable a_out 
) const

◆ GetVariableValue() [2/2]

bool RE::BSScript::IVirtualMachine::GetVariableValue ( VMHandle  a_handle,
const BSFixedString a_className,
std::int32_t  a_variableIndex,
Variable a_out 
) const

◆ GetVariableValue1()

SKYRIM_REL_VR_VIRTUAL bool RE::BSScript::IVirtualMachine::GetVariableValue1 ( const BSTSmartPointer< Object > &  a_objPtr,
std::uint32_t  a_index,
Variable a_out 
) const

◆ GetVariableValue2()

SKYRIM_REL_VR_VIRTUAL bool RE::BSScript::IVirtualMachine::GetVariableValue2 ( VMHandle  a_handle,
const BSFixedString a_className,
std::int32_t  a_variableIndex,
Variable a_out 
) const

◆ IsCompletelyFrozen()

virtual bool RE::BSScript::IVirtualMachine::IsCompletelyFrozen ( ) const
pure virtual

◆ IsWaitingOnLatent()

SKYRIM_REL_VR_VIRTUAL bool RE::BSScript::IVirtualMachine::IsWaitingOnLatent ( VMStackID  a_stackID) const

◆ MoveBoundObjects()

SKYRIM_REL_VR_VIRTUAL void RE::BSScript::IVirtualMachine::MoveBoundObjects ( VMHandle  a_from,
VMHandle  a_to 
)

◆ New_1B()

virtual void RE::BSScript::IVirtualMachine::New_1B ( void  )
pure virtual

◆ New_1D()

virtual void RE::BSScript::IVirtualMachine::New_1D ( void  )
pure virtual

◆ RegisterForLogEvent()

SKYRIM_REL_VR_VIRTUAL void RE::BSScript::IVirtualMachine::RegisterForLogEvent ( BSTEventSink< LogEvent > *  a_sink)

◆ RegisterForStatsEvent()

SKYRIM_REL_VR_VIRTUAL void RE::BSScript::IVirtualMachine::RegisterForStatsEvent ( BSTEventSink< StatsEvent > *  a_sink)

◆ RegisterFunction()

template<class F >
void RE::BSScript::IVirtualMachine::RegisterFunction ( std::string_view  a_fnName,
std::string_view  a_className,
a_callback,
bool  a_callableFromTasklets = false 
)

◆ RegisterLatentFunction()

template<class R , class F >
void RE::BSScript::IVirtualMachine::RegisterLatentFunction ( std::string_view  a_fnName,
std::string_view  a_className,
a_callback,
bool  a_callableFromTasklets = false 
)

Registers a latent function. Unlike normal native functions, latent functions do not return a result to the script immediately.

A latent function is intended for any native functions that take significant amount of time to execute (Utility.Wait(X) as an example). A latent function will block a script event until the latent function finishes Setup: A latent function is setup with three pieces:

  1. The initial callback. This will setup the necessary logic for the latent execution, and returns a BSScript::LatentStatus for if the setup is successful. Note this callback must return as soon as possible to unblock the game.
  2. The latent logic. This can be a timer waiting X amount of time, a wait for some event, some crazy number crunching or anything inbetween. It is very important this logic is not executed in the callback
  3. The return. This will be any code that returns the result back to the script. It is important to store the stackID from the callback somewhere to identify which script event to return the result to.

Notes:

  1. Since latent functions do not execute their logic while blocking the game, the player can save during a latent function execution. Care must be taken to store the stackID as well as necessary relevant data for the latent function in the cosave, to resume execution when loading up the save. Otherwise, the script event will be permanently blocked without a call to return a result to it
  2. When returning a value, the value type must exactly match the result type specified here. As an example, if the result type in the registration is TESForm*, and the actual value is Actor* (which inherits TESForm), the actor MUST be casted to TESForm with myActor->As<TESForm>() before being returned;
Template Parameters
RThe result type to return with IVirtualMachine::ReturnLatentResult
Parameters
a_fnNamename of the latent function
a_classNamename of the class holding the latent function
a_callbackinitial callback. This must be setup as BSScript::LatentStatus callback(BSScript::Internal::VirtualMachine*, VMStackID, Cls, Args...)
a_callableFromTaskletsWhether the function can be invoked immediately from a script (not thread safe!) or wait for the next frame to invoke (thread safe!)
See also
IVirtualMachine::ReturnLatentResult
https://www.creationkit.com/index.php?title=Category:Latent_Functions

◆ RegisterObjectType()

virtual bool RE::BSScript::IVirtualMachine::RegisterObjectType ( VMTypeID  a_typeID,
const char *  a_className 
)
pure virtual

◆ ReloadType()

virtual bool RE::BSScript::IVirtualMachine::ReloadType ( const char *  a_className)
pure virtual

◆ ResetAllBoundObjects()

SKYRIM_REL_VR_VIRTUAL void RE::BSScript::IVirtualMachine::ResetAllBoundObjects ( VMHandle  a_handle)

◆ ReturnFromLatent()

SKYRIM_REL_VR_VIRTUAL void RE::BSScript::IVirtualMachine::ReturnFromLatent ( VMStackID  a_stackID,
const Variable a_val 
)

◆ ReturnLatentResult()

template<class V >
requires is_return_convertible_v<V>
void RE::BSScript::IVirtualMachine::ReturnLatentResult ( VMStackID  a_stackID,
a_result 
)

Returns a result to the stack if it is waiting for a latent function to return. This is a wrapper over ReturnFromLatent.

Parameters
a_stackIDID of the stack waiting for the latent result
a_resultresult to return to the stack

◆ SendEvent()

SKYRIM_REL_VR_VIRTUAL void RE::BSScript::IVirtualMachine::SendEvent ( VMHandle  a_handle,
const BSFixedString a_eventName,
IFunctionArguments a_args 
)

◆ SendEventAll()

SKYRIM_REL_VR_VIRTUAL void RE::BSScript::IVirtualMachine::SendEventAll ( const BSFixedString a_eventName,
IFunctionArguments a_args 
)

◆ SetCallableFromTasklets() [1/2]

void RE::BSScript::IVirtualMachine::SetCallableFromTasklets ( const char *  a_className,
const char *  a_fnName,
bool  a_callable 
)

◆ SetCallableFromTasklets() [2/2]

void RE::BSScript::IVirtualMachine::SetCallableFromTasklets ( const char *  a_className,
const char *  a_stateName,
const char *  a_fnName,
bool  a_callable 
)

◆ SetCallableFromTasklets1()

virtual void RE::BSScript::IVirtualMachine::SetCallableFromTasklets1 ( const char *  a_className,
const char *  a_stateName,
const char *  a_fnName,
bool  a_callable 
)
pure virtual

◆ SetCallableFromTasklets2()

virtual void RE::BSScript::IVirtualMachine::SetCallableFromTasklets2 ( const char *  a_className,
const char *  a_fnName,
bool  a_callable 
)
pure virtual

◆ SetLinkedCallback()

virtual void RE::BSScript::IVirtualMachine::SetLinkedCallback ( ITypeLinkedCallback *  a_callback)
pure virtual

◆ SetOverstressed()

virtual void RE::BSScript::IVirtualMachine::SetOverstressed ( bool  a_set)
pure virtual

◆ SetPropertyValue()

SKYRIM_REL_VR_VIRTUAL bool RE::BSScript::IVirtualMachine::SetPropertyValue ( BSTSmartPointer< Object > &  a_obj,
const char *  a_propertyName,
Variable a_setVal 
)

◆ TasksToJobs()

virtual void RE::BSScript::IVirtualMachine::TasksToJobs ( BSJobs::JobList &  a_jobList)
pure virtual

◆ TraceForm()

void RE::BSScript::IVirtualMachine::TraceForm ( TESForm a_form,
const char *  a_str,
VMStackID  a_stackID,
Severity  a_severity = Severity::kError 
)

◆ TraceStack()

virtual void RE::BSScript::IVirtualMachine::TraceStack ( const char *  a_str,
VMStackID  a_stackID,
Severity  a_severity = Severity::kError 
)
pure virtual

◆ TypeIsValid()

virtual bool RE::BSScript::IVirtualMachine::TypeIsValid ( const BSFixedString a_className)
pure virtual

◆ UnregisterForLogEvent()

SKYRIM_REL_VR_VIRTUAL void RE::BSScript::IVirtualMachine::UnregisterForLogEvent ( BSTEventSink< LogEvent > *  a_sink)

◆ UnregisterForStatsEvent()

SKYRIM_REL_VR_VIRTUAL void RE::BSScript::IVirtualMachine::UnregisterForStatsEvent ( BSTEventSink< StatsEvent > *  a_sink)

◆ Update()

virtual void RE::BSScript::IVirtualMachine::Update ( float  a_budget)
pure virtual

◆ UpdateTasklets()

virtual void RE::BSScript::IVirtualMachine::UpdateTasklets ( float  a_budget)
pure virtual

◆ VTraceStack()

void RE::BSScript::IVirtualMachine::VTraceStack ( VMStackID  a_stackID,
Severity  a_severity,
const char *  a_fmt,
  ... 
)

Member Data Documentation

◆ pad0C

std::uint32_t RE::BSScript::IVirtualMachine::pad0C

◆ RTTI

constexpr auto RE::BSScript::IVirtualMachine::RTTI = RTTI_BSScript__IVirtualMachine
inlinestaticconstexpr

The documentation for this class was generated from the following files: