15 #include <luabind/luabind.hpp>
24 #include <boost/signals2.hpp>
31 namespace makVrfEvents
34 class DtInfluenceEvent;
58 #ifdef DtObjectDebugger_Enable
73 virtual void init()
override;
92 virtual void setLuaState(lua_State* L);
93 virtual lua_State* getLuaState();
95 virtual std::string dumpLuaStack()
const;
96 virtual int luaStackSize()
const;
97 virtual void collectGarbage();
124 virtual bool initializeVRFLuaExtensions(lua_State* L);
125 virtual bool importTaskParams(lua_State* L);
128 virtual bool importSetParams(lua_State* L);
131 virtual luabind::object createLuaTableFromRegistry(lua_State* L,
const DtReaderWriterRegistry& rwRegistry,
bool requireMetadata =
true,
bool hasParamMetaData =
true);
137 static void addKeyToIgnore(
const std::string&);
140 static void removeKeyToIgnore(
const std::string&);
143 void luaEndTask(
bool success);
152 virtual void luaStopScenarioEventWithRewind(
DtScriptVrfObject eventName,
bool rewind);
164 virtual int taskIdNumber();
166 virtual int luaSendEmbeddedEntityTask(std::string eeName, std::string taskName, luabind::object
const& parms);
167 virtual int luaSendEmbeddedEntityTaskActAsSubtask(std::string eeName, std::string taskName,
168 luabind::object
const& parms,
bool actAsSubtask);
170 virtual int luaSendEmbeddedEntitySet(std::string eeName, std::string setName, luabind::object
const& parms);
175 int luaStartSubtask(
const std::string taskName, luabind::object
const& parameters);
177 void luaStopSubtask(
int subtaskId);
179 void luaStopAllSubtasks();
181 bool luaIsSubtaskRunning(
int subtaskId);
183 bool luaIsSubtaskComplete(
int subtaskId);
185 bool luaIsSubtaskCanceled(
int subtaskId);
187 bool luaSubtaskResult(
int subtaskId);
191 void luaCleanupInactiveSubtaskStatus();
196 virtual void luaSendChatMessage(
const std::string& user,
const std::string& channel,
int force,
const std::string& message);
197 virtual void luaSendChatMessageForceString(
const std::string& user,
const std::string& channel,
const std::string& force,
const std::string& message);
200 void luaSendReportWithoutRecipients(const::std::string reportType,
201 luabind::object
const& parameters);
202 void luaSendReport(const::std::string reportType,
203 luabind::object
const& reciptients,
204 luabind::object
const& parameters);
208 luabind::object
const& parameters);
209 int luaSendTaskNotAsSubtask(
DtScriptVrfObject&
object, const::std::string taskName,
210 luabind::object
const& parameters);
211 int luaSendTaskActAsSubtask(
DtScriptVrfObject&
object, const::std::string taskName,
212 luabind::object
const& parameters,
bool actAsSubtask);
214 luabind::object
const& parameters);
215 int luaSendRadioTaskActAsSubtask(
DtScriptVrfObject&
object, const::std::string taskName,
216 luabind::object
const& parameters,
bool actAsSubtask);
217 int luaSendTaskActAsSubtaskWithRadio(
DtScriptVrfObject&
object, const::std::string taskName,
218 luabind::object
const& parameters,
bool actAsSubtask,
bool sendWithRadio);
221 void luaStopAllTasks();
224 void luaSendSetDataToSelf(const::std::string setName,
225 luabind::object
const& parameters);
229 luabind::object
const& parameters);
231 luabind::object
const& parameters);
233 luabind::object
const& parameters,
bool useRadio);
235 bool luaIsTaskAvailable(const::std::string taskName);
236 bool luaIsSetAvailable(const::std::string setName);
239 luabind::object luaGetReactionStatus();
249 luabind::object luaGetOrbatList();
252 std::string luaGetScriptId();
255 std::string luaGetSystemName();
258 luabind::object luaGetObjectsNearWithFilter(
const DtLocation3D& loc,
double distance, luabind::object
const& parameters);
260 luabind::object luaGetScriptAttribute(
const std::string& attributeName,
bool&
error);
263 luabind::object luaGetVrfObjects();
267 luabind::object luaGetDesignatorsNearWithFilter(
const DtLocation3D& loc,
double distance,
268 const luabind::object& params);
270 luabind::object luaGetDesignatorsNear(
const DtLocation3D& loc,
double distance);
275 DtLuaFeatureSet luaGetFeaturesWithinArea(luabind::object
const& points, luabind::object
const& attributes);
278 DtLuaFeatureSet luaGetFeaturesWithinAreaNoAttributes(luabind::object
const& points);
303 std::shared_ptr<DtLuaAsyncJob> generateRandomPoints(
const luabind::object& parameters);
306 std::shared_ptr<DtLuaAsyncJob> findNearbyPointOfInterest(
const int type);
309 std::shared_ptr<DtLuaAsyncJob> findCoverPoint(
311 double threatRadius,
double distanceFromThreat,
double range,
unsigned numberOfPoints);
314 luabind::object findLadders(lua_State* L,
const DtLocation3D& startLocation,
double range);
316 luabind::object findLaddersWithId(lua_State* L,
const DtLocation3D& startLocation,
317 double range,
const unsigned int id);
320 std::shared_ptr<DtLuaAsyncJob> findPathToLocation(
322 bool useAbstractGraphs,
const DtLocation3D& avoidLocation,
double avoidanceRadius);
323 std::shared_ptr<DtLuaAsyncJob> findPathToLocationWithParameters(
const DtLocation3D& startLocation,
324 const DtLocation3D& destinationLocation,
const luabind::object& parameters);
326 std::shared_ptr<DtLuaAsyncJob> findPathToLocationWithParameterObject(
const DtLocation3D& startLocation,
331 std::shared_ptr<DtLuaAsyncJob> placeFormation(
const luabind::object& parameters);
332 std::shared_ptr<DtLuaAsyncJob> placeFormationWithWidth(
const luabind::object& parameters,
340 luabind::object findNavSectors(lua_State* L,
const DtLocation3D& location);
347 std::shared_ptr<DtLuaAsyncJob> luaNavigateThroughFeatures(
const luabind::object& parameters);
351 virtual std::shared_ptr<DtLuaAsyncJob> luaFindHighPoints(
const luabind::object& corners,
unsigned int nPoints);
352 virtual std::shared_ptr<DtLuaAsyncJob> luaFindHighPointsDebug(
const luabind::object& corners,
unsigned int nPoints,
bool bDebug);
369 virtual std::shared_ptr<DtLuaAsyncJob> luaFindSinglePosition(
370 const luabind::object& targetAreaCorners,
372 double targetHeightMeters,
373 double viewHeightMeters,
374 double hideHeightMeters,
375 double forwardBackSearchLimitMeters,
376 double forwardBackSearchIntervalMeters,
377 double maxSlopeDegrees);
392 virtual std::shared_ptr<DtLuaAsyncJob> luaFindSinglePositionDebug(
393 const luabind::object& targetAreaCorners,
395 double targetHeightMeters,
396 double viewHeightMeters,
397 double hideHeightMeters,
398 double forwardBackSearchLimitMeters,
399 double forwardBackSearchIntervalMeters,
400 double maxSlopeDegrees,
417 virtual std::shared_ptr<DtLuaAsyncJob> luaFindVehicleFightingPositions(
418 unsigned int nPositionPairs,
419 const luabind::object& targetAreaCorners,
424 double forwardBackSearchLimit,
425 double sideSideSearchLimit,
426 double maxSlopeDegrees,
427 double positionSpacing);
430 virtual std::shared_ptr<DtLuaAsyncJob> luaFindVehicleFightingPositionsDebug(
431 unsigned int nPositionPairs,
432 const luabind::object& targetAreaCorners,
437 double forwardBackSearchLimit,
438 double sideSideSearchLimit,
439 double maxSlopeDegrees,
440 double positionSpacing,
443 virtual std::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaHilltop(
444 unsigned int nPositionPairsPerGroup,
445 const luabind::object& searchAreaVertices,
446 const luabind::object& targetsAreaVertices,
447 double viewHeightMeters,
448 double coverHeightMeters,
449 unsigned int forwardBackRangeMeters,
450 unsigned int sideSideRangeMeters,
451 unsigned int searchIntervalMeters,
452 double maxSlopeDegrees,
453 unsigned int positionsLateralSpacingMeters);
455 virtual std::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaHilltopDebug(
456 unsigned int nPositionPairsPerGroup,
457 const luabind::object& searchAreaVertices,
458 const luabind::object& targetsAreaVertices,
459 double viewHeightMeters,
460 double coverHeightMeters,
461 unsigned int forwardBackRangeMeters,
462 unsigned int sideSideRangeMeters,
463 unsigned int searchIntervalMeters,
464 double maxSlopeDegrees,
465 unsigned int positionsLateralSpacingMeters,
468 virtual std::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaRidge(
469 unsigned int nPositionPairsPerGroup,
470 const luabind::object& searchAreaVertices,
471 const luabind::object& targetsAreaVertices,
472 unsigned int targetsAreaSampleRate,
473 const luabind::object& tableOfDoubles
476 virtual std::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaRidgeDebug(
477 unsigned int nPositionPairsPerGroup,
478 const luabind::object& searchAreaVertices,
479 const luabind::object& targetsAreaVertices,
480 unsigned int targetsAreaSampleRate,
481 const luabind::object& tableOfDoubles
486 std::shared_ptr<DtLuaAsyncJob> getAllEmbarkationSlots(
DtScriptVrfObject&
object);
493 std::shared_ptr<DtLuaAsyncJob> getEmbarkationSlotsFiltered(
DtScriptVrfObject&
object,
497 std::shared_ptr<DtLuaAsyncJob> reserveEmbarkationSlot(
DtScriptVrfObject&
object,
int slotNumber);
500 std::shared_ptr<DtLuaAsyncJob> getEmbarkationEgressPoints(
DtScriptVrfObject&
object);
502 void luaSendMessage(
const DtScriptVrfObject& receiver,
const std::string& message);
503 void luaSendRadioMessage(
const DtScriptVrfObject& receiver,
const std::string& message);
504 void luaSendRadioMessageToUuid(
const std::string& uuid,
const std::string& message);
505 void luaDeleteObject(std::string
const& receiver);
507 void luaSetInterest(
const DtLocation3D& location,
double range);
509 void luaSendObjectMessage(
const DtScriptVrfObject& receiver,
const std::string& messageType,
const luabind::object& messageContents);
510 void luaSendRadioObjectMessage(
const DtScriptVrfObject& receiver,
const std::string& messageType,
const luabind::object& messageContents);
511 void luaRegisterForObjectMessage(
const std::string& messageType);
512 void luaUnregisterForObjectMessage(
const std::string& messageType);
520 const std::string& influenceName, luabind::object
const& influenceParams);
525 static void influenceEventCallback(std::shared_ptr<const makVrfEvents::DtInfluenceEvent> event,
void* usr);
526 virtual void queueInfluence(std::shared_ptr<const makVrfEvents::DtInfluenceEvent> e);
527 virtual void processInfluence(std::shared_ptr<const makVrfEvents::DtInfluenceEvent> e);
533 luabind::object luaGetCloudLayerDescriptionsAt(lua_State *L,
const DtLocation3D& location);
541 virtual double luaGetExpectedIllumination(
DtScriptVrfObject&
object,
double dateAndTimeOfDay);
542 virtual double luaGetSnowAccumulationByLocation(
const DtLocation3D&
object);
543 virtual double luaGetSnowRoadAccumulationByLocation(
const DtLocation3D&
object);
544 virtual double luaGetRainAccumulationByLocation(
const DtLocation3D&
object);
546 virtual double luaGetAirTemperatureByLocation(
const DtLocation3D&
object);
547 virtual double luaGetAirPressureByLocation(
const DtLocation3D&
object);
548 virtual unsigned int luaGetPrecipitationByLocation(
const DtLocation3D& location,
double*);
549 virtual double luaGetPrecipitationIntensityByLocation(
const DtLocation3D&
object);
550 virtual unsigned int luaGetPrecipitationTypeByLocation(
const DtLocation3D&
object);
551 virtual double luaGetVisibilityDistanceByLocation(
const DtLocation3D&
object);
552 virtual int luaGetVisibilityObscurantByLocation(
const DtLocation3D&
object);
553 virtual double luaGetWindDirectionByLocation(
const DtLocation3D&
object);
554 virtual double luaGetWindSpeedByLocation(
const DtLocation3D&
object);
555 virtual double luaGetUnderwaterVisibilityByLocation(
const DtLocation3D&
object);
556 virtual unsigned int luaGetSwellStateByLocation(
const DtLocation3D&
object);
557 virtual double luaGetSwellStateDirectionByLocation(
const DtLocation3D&
object);
558 virtual unsigned int luaGetSeaStateByLocation(
const DtLocation3D&
object);
559 virtual double luaGetSeaStateDirectionByLocation(
const DtLocation3D&
object);
560 virtual double luaGetSurgeDepthByLocation(
const DtLocation3D&
object);
561 virtual double luaGetIlluminationByLocation(
const DtLocation3D&
object);
562 virtual double luaGetExpectedIlluminationByLocation(
const DtLocation3D&
object,
double dateAndTimeOfDay);
567 virtual double luaRunDurationTime();
568 virtual void luaRunForDuration(
double);
569 virtual void luaStopSimulationDurationTimer();
574 virtual void luaSetCheckpointMode(
bool);
575 virtual void initializeCheckpointStateTable(lua_State* L);
586 luabind::object
const& options,
int displayFlags);
588 luabind::object
const& options,
int displayFlags);
590 luabind::object
const& options,
int displayFlags);
591 virtual int luaAskUserQuestionSS(
const std::string& title,
const std::string& message,
592 luabind::object
const& options,
int displayFlags);
597 virtual int luaStatusOfUserQuestion(
int questionId);
600 virtual void luaCancelUserQuestion(
int questionId);
608 void luaCreateEntityParallel(luabind::object
const& parameters);
638 std::vector<DtLocation3D> luaMakeOffsetPoints(
639 luabind::object
const& fromPoints,
641 std::vector<DtLocation3D> luaMakeOffsetPointsWithRadius(luabind::object
const& fromPoints,
645 void luaCreateSelectionGroup(
const std::string& name, luabind::object
const& parameters);
650 void luaFinishTest(
const int status,
const std::string message);
653 bool luaUpdateTaskVisualization(
const std::string& visualizationName,
654 const std::string& visualizationType, luabind::object
const& parameters);
657 void luaDeleteTaskVisualization(
const std::string& visualizationName);
660 void luaRequire(lua_State* L,
const std::string&
filename);
664 unsigned luaBitwiseOr(
unsigned val1,
unsigned val2);
665 unsigned luaBitwiseAnd(
unsigned val1,
unsigned val2);
666 unsigned luaBitwiseXor(
unsigned val1,
unsigned val2);
667 unsigned luaBitwiseNot(
unsigned val);
668 unsigned luaBitwiseLeftShift(
unsigned val,
unsigned shift);
669 unsigned luaBitwiseRightShift(
unsigned val,
unsigned shift);
677 virtual bool luaIsDatabaseLoggingEnabled();
680 virtual void luaLogEventToDatabase(
unsigned eventType, luabind::object
const& parameters);
690 , myFunctionName(functionName)
701 return myFunctionName;
714 DtInfo <<
"DtLuaScriptFunctionReference::operator< attempt to compare with wrong type.\n";
726 const std::string& functionName);
730 const std::string& functionName);
743 virtual luabind::object luaGetParamPropertyFromType(
744 const std::string typeString, std::string
const& paramName);
746 virtual luabind::object luaGetApplicationSetting(
747 const std::string settingName);
750 virtual void putObjectsFromTableIntoGlobalTable(lua_State* state, luabind::object& table);
751 virtual void putObjectsFromGlobalTableIntoTable(lua_State* state, luabind::object& table);
754 virtual luabind::object luaGetSubordinateFunctionNames();
757 virtual luabind::object luaGetParameterSubordinateFunctionsFromType(
758 const std::string typeString);
760 virtual void connectForCallbacks();
761 virtual void processEvents();
764 std::shared_ptr<DtLuaAsyncJob> luaGetWeaponSystemsInfo(
DtScriptVrfObject&
object);
770 virtual bool callLuaNoArgFunction(
const std::string& functionName,
bool* functionExists =
nullptr);
772 virtual void updateFuncCallCount();
783 LuaExtension() : creator(nullptr), onlyForEntity(nullptr), usr(nullptr) {};
805 bool myNeedsInvokeShutdown =
true;
817 namespace luaScriptInterface
851 const std::string& formationName, luabind::object
const& options,
857 const std::string& formationName,
913 luabind::object
const& typeFilters,
bool observedOnly);
918 luabind::object
const& typeFilters,
bool observedOnly,
925 luabind::object
const& typeFilters,
bool observedOnly,
934 luabind::object
const& typeFilters,
935 luabind::object
const& flags);
939 luabind::object
const& options);
951 const std::string& propertyName, luabind::object
const& prop);
958 const std::string& propertyName, luabind::object
const& prop,
bool addIfNotFound);
969 luabind::object
const& keyValues, luabind::object
const& itemValue);
979 int index, luabind::object
const& itemValue);
990 luabind::object
const& keyValue, luabind::object
const& itemValue);
995 const std::string& context,
const std::string& propertyName, luabind::object
const& prop);
1001 const std::string& context,
const std::string& propertyName, luabind::object
const& prop,
bool addIfNotFound);
1010 const std::string& context,
const std::string& propertyName,
1011 luabind::object
const& keyValues, luabind::object
const& itemValue);
1019 const std::string& context,
const std::string& propertyName,
1020 int index, luabind::object
const& itemValue);
1029 const std::string& context,
const std::string& propertyName,
1030 luabind::object
const& keyValue, luabind::object
const& itemValue);
1053 luabind::object
const& keyValues,
int& index);
1056 luabind::object
const& keyValues,
int& index);
1083 luabind::object
const& keyValue);
1086 luabind::object
const& keyValue);
1093 const std::string& context,
const std::string& propertyName);
1104 const std::string& context,
const std::string& propertyName,
1105 luabind::object
const& keyValues,
int& index);
1115 const std::string& context,
const std::string& propertyName,
int index);
1125 const std::string& context,
const std::string& propertyName, luabind::object
const& keyValue);
1146 luabind::object
const& keyValues,
int& index);
1149 luabind::object
const& keyValues,
int& index);
1174 luabind::object
const& keyValue);
1177 luabind::object
const& keyValue);
1181 const luabind::object & value,
virtual void invokePostSetDataCallback(DtScriptFunctionReferencePtr functionReference, DtSetDataRequestMessage *setDatRequest)=0
Implement to invoke the function referenced by functionReference. setDatRequest contains the informat...
virtual void processEntityDestroyed()
Can be overridden to perform some processing when the entity is destroyed.
Definition: scriptInterface.h:200
General settings that apply to all modes.
Definition: iffMode5Settings.h:12
std::vector< DtVrfObjectMessage * > myTextReportCallbacks
Definition: luaScriptInterfaceImpl.h:802
virtual bool operator<(const DtScriptFunctionReference &other) const override
Required for std::set.
Definition: luaScriptInterfaceImpl.h:704
virtual void addPostSetDataCallback(const DtSetMessageType &setDataType, DtScriptFunctionReferencePtr functionReference)
Adds a callback to be invoked after the specified type of set data request is executed.
virtual bool invokeInit()=0
luabind::object luaGetParameterPropertyListItemByIndex(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, int index)
Returns an object containing the value of the of an item in the given parameter property. The property must be a list. Returns the item at the given index, using the Lua convention that the first item is at index 1. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or list item could not be found, the returned table will be empty.
bool luaSetInternalStateProperty(lua_State *L, DtScriptOwnshipObject &entity, const std::string &context, const std::string &propertyName, luabind::object const &prop)
Sets the specified internal state property with the given value. If the property does not exist or th...
std::list< DtScriptVrfObject > luaGetContactsWithFilterAliveOnly(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, bool observedOnly, bool aliveOnly)
Same as luaGetContactsWithFiler but adds a boolean flag to indicate that only non-destroyed entities ...
This class is a wrapper for a DtCompSystem for use by scripts. It derives from DtAsciiSerializable so...
Definition: scriptWeaponInfo.h:22
luabind::object luaGetParamProperty(lua_State *L, const DtScriptVrfObject &entity, std::string const ¶mName)
Returns an object containing the value of the requested parameter property. May be a table containing...
const char ContactObservedOnly[]
Definition: luaScriptInterfaceImpl.h:48
void getMode1Data(lua_State *L, luabind::object &result, const DtIffMode1Settings *settings)
luabind::object luaGetSubordinateFunctions(lua_State *L, const DtScriptVrfObject &entity)
Return a table of {{"subordinate" = DtScriptVrfObject, "function" = string}}.
std::vector< DtScriptVrfObject > luaGetAllHostileContacts(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &options)
static GlobalInterfaceExtensions theLuaInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:794
std::vector< LuaExtension > GlobalInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:792
lua_State * myLState
Definition: luaScriptInterfaceImpl.h:774
virtual bool invokeResume()=0
Definition: iffBasicModeSettings.h:84
luabind::object luaGetStateOwnshipPropertyListItemByIndex(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, int index)
virtual bool loadState(const DtReaderWriter *savedState)=0
Called when the scenario is loaded. The load state pointer may not be valid, which does not indicate ...
bool luaSetSubordinateFunctions(lua_State *L, const DtScriptVrfObject &entity, luabind::object const &subsAndFunctions)
Given a table of {{"subordinate" = DtScriptVrfObject, "function" = string}} Set the state propert...
luabind::object luaGetStateOwnshipPropertyMapItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValue)
unsigned myFuncCallCount
Definition: luaScriptInterfaceImpl.h:775
luabind::object luaGetSubordinateFormation(lua_State *L, const DtScriptOwnshipObject &entity, DtScriptVrfObject &leadSubordinate)
Gets a table indexed by simObject (subordinates) of position offset relative to the formation leader...
virtual void invokeCheckInit()=0
Definition: luaNavJob.h:319
luabind::object luaGetParameterPropertyListItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
Returns an object containing the value of the of an item in the given parameter property. The property must be a list. The item returned will have values matching the specified key values in the key fields. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or list item could not be found, the returned table will be empty. Sets index to be the index of the item, using the Lua convention that the first item is at index 1.
Definition: readerWriter.h:85
void getMode2Data(lua_State *L, luabind::object &result, const DtIffMode2Settings *settings)
#define DT_DEFINE_OBJECT_DEBUGGER_NAME(type)
Definition: objectCounter.h:31
Default on in debug, off in release.
Definition: objectCounter.h:27
luabind::object(* ReaderWriterToLuaTableFcn)(lua_State *LS, const DtReaderWriter *rwString, const DtSimulationServices *mgr, const DtString ¶meterType)
When adding decoder functions to turn reader/writer into lua tables, the format must be of the follow...
Definition: luaScriptInterfaceImpl.h:45
bool luaSetStatePropertyListItemByIndex(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, int index, luabind::object const &itemValue)
Finds the item in the list at the specified index and updates it to the new value. If the list is not long enough, new entries are added. Any items added in this way will be given the same value as the new entry. If the property does not exist or the format of the data is incorrect, returns false. Will try to find the state property in both internal and external properties.
virtual void removePostSetDataCallback(const DtSetMessageType &setDataType, DtScriptFunctionReferencePtr functionReference)
Remove a callback invoked after the specified type of set data request is executed.
Definition: readerWriterRegistry.h:39
virtual DtReaderWriter * saveState()=0
Called when the scenario is saved. The stateState pointer may not be valid, in which case something w...
luabind::object luaGetStatePropertyListItemByIndex(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, int index)
Returns an object containing the value of the of an item in the given state property. The state property must be a list. Returns the item at the given index, using the Lua convention that the first item is at index 1. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. Will try to find the state property in both internal and external properties. If the property or list item could not be found, the returned table will be empty.
luabind::object luaGetInternalStatePropertyMapItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &context, const std::string &propertyName, luabind::object const &keyValue)
Returns an object containing the value of the of an item in the given internal state property...
General settings that apply to all modes.
Definition: iffTCASDataSettings.h:12
bool luaSetInternalStatePropertyMapItem(lua_State *L, DtScriptOwnshipObject &entity, const std::string &context, const std::string &propertyName, luabind::object const &keyValue, luabind::object const &itemValue)
Sets a single item in na internal map state property to the given value. First looks in the map to se...
LocalInterfaceExtensions myInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:779
virtual bool loadScript(bool reload=false)=0
This will be called by the parent to let the interface know when to load the script.
bool myLuaScriptWarningShown
Definition: luaScriptInterfaceImpl.h:776
Definition: iffBasicModeSettings.h:100
static ReaderWriterToLuaTableMap theReaderWriterToLuaTableMap
Definition: luaScriptInterfaceImpl.h:799
void getMode3CData(lua_State *L, luabind::object &result, const DtIffMode3CSettings *settings)
luabind::object luaGetParameterSubordinateFunctions(lua_State *L, const DtScriptVrfObject &entity)
Gets a table of entity type and subordinate function handle pairs {{ENTITY_TYPE_STRING, FUNCTION_HANDLE_STRING}}.
luabind::object luaGetWeaponInfo(lua_State *L, const DtScriptOwnshipObject &thisEntity, const std::string &weaponId)
std::list< DtScriptVrfObject > luaGetContactsWithFilter(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, bool observedOnly)
This function supports the script API. It gets the list of contacts matching the given filter and ret...
bool luaSetOrAddInternalStateProperty(lua_State *L, DtScriptOwnshipObject &entity, const std::string &context, const std::string &propertyName, luabind::object const &prop, bool addIfNotFound)
Sets the specified internal state property with the given value. If not found and addIfNotFound is tr...
std::string functionName() const
Definition: luaScriptInterfaceImpl.h:699
DtLuaScriptFunctionReference(const std::string &functionName)
Definition: luaScriptInterfaceImpl.h:688
luabind::object luaGetStatePropertyMapItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValue)
Returns an object containing the value of the of an item in the given state property. The state property must be a map. The item returned will have values matching the specified key value. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. Will try to find the state property in both internal and external properties. If the property or map item could not be found, the returned table will be empty.
std::shared_ptr< DtScriptFunctionReference > DtScriptFunctionReferencePtr
Shared ptr to DtScriptFunctionReference.
Definition: scriptInterface.h:54
VectorOffset3D is a direction vector that is relative to some direction specified by a Vector3D...
Definition: scriptGeometry.h:428
Handles translation of messages from C++ structures into Lua tables and the reverse translation as we...
Definition: luaMessageInterface.h:23
void getMode5Data(lua_State *L, luabind::object &result, const DtIffMode5Settings *settings)
luabind::object luaGetOwnshipParamProperty(lua_State *L, const DtScriptOwnshipObject &entity, std::string const ¶mName)
std::string luaGetSubordinateFunction(lua_State *L, const DtScriptVrfObject &entity, const DtScriptVrfObject &subEntity)
Return a string representing subordinate function for indicated subordinate.
LuaExtension(const LuaExtension &orig)
Definition: luaScriptInterfaceImpl.h:784
bool luaSetStatePropertyMapItem(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValue, luabind::object const &itemValue)
Sets a single item in a map state property to the given value. First looks in the map to see if any e...
void getModeSData(lua_State *L, luabind::object &result, const DtIffModeSSettings *settings)
luabind::object luaGetIffSystem(lua_State *L, const DtScriptVrfObject &entity)
Returns a table of Iff Settings Data for the specified entity.
virtual DtString type() const =0
Script engine type.
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
Represents a feature geometry.
Definition: luaFeatureGeometry.h:25
luabind::object luaGetStateOwnshipPropertyListItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
static const std::map< DtString, rwToLuaBindObjectFcn > & rwToLuaBindObjectMap()
const DtLocalObject * onlyForEntity
Definition: luaScriptInterfaceImpl.h:788
Definition: luaScriptInterfaceImpl.h:56
luabind::object luaGetOwnshipParameterPropertyListItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
bool luaGetIffModeIsOn(lua_State *L, const DtScriptVrfObject &entity, const DtModeType mode)
Returns a bool representing if the specified IFF mode is on or off.
bool luaSetInternalStatePropertyListItemByIndex(lua_State *L, DtScriptOwnshipObject &entity, const std::string &context, const std::string &propertyName, int index, luabind::object const &itemValue)
Finds the item in the internal state property list at the specified index and updates it to the new v...
bool luaSetStateProperty(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &prop)
Sets the specified state property with the given value. If the property does not exist or the format ...
luabind::object luaGetSystemAttribute(const DtScriptComponentSystem &system, const std::string &attributeName, bool *error, lua_State *L)
virtual ~DtLuaScriptFunctionReference() override
Definition: luaScriptInterfaceImpl.h:695
luabind::object luaGetInternalStateProperty(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &context, const std::string &propertyName)
Returns an object containing the value of the requested internal state property. May be a table conta...
luabind::object(* rwToLuaBindObjectFcn)(const DtReaderWriter *rw, lua_State *L)
Definition: luaScriptInterfaceImpl.h:819
virtual void invokeDisable()=0
Only called for reactive tasks which can be enabled but not active. When the task is completely disab...
virtual void invokeTick()=0
This will be called by the parent to invoke the script tick.
luabind::object luaGetInternalStatePropertyListItemByIndex(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &context, const std::string &propertyName, int index)
Returns an object containing the value of the of an item in the given internal state property...
std::list< DtVectorOffset3D > luaGetFormationPositions(lua_State *L, const DtScriptVrfObject &unit, const std::string &formationName, int *leaderIndex)
Calls luaGetOptionFormationPositions with empty options.
#define DT_DLL_vrfLua
This file is used to determine how to build.
Definition: vrfLuaDefines.h:25
bool luaSetStatePropertyListItem(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValues, luabind::object const &itemValue)
Sets a single item in a list state property to the given value. First looks in the list to see if any...
const char ContactAliveOnly[]
Definition: luaScriptInterfaceImpl.h:49
luabind::object luaGetStatePropertyListItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
Returns an object containing the value of the of an item in the given state property. The state property must be a list. The item returned will have values matching the specified key values in the key fields. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. Will try to find the state property in both internal and external properties. If the property or list item could not be found, the returned table will be empty. Sets index to be the index of the item, using the Lua convention that the first item is at index 1.
This stream is used by the scripting classes to be able to send out translatable messages from script...
Definition: translatableStream.h:22
luabind::object luaGetContactInfo(lua_State *L, const DtScriptOwnshipObject &thisEntity, const DtScriptVrfObject &otherEntity)
Gets the perceived contact info that this entity has for another entity.
The base class for all messages to/from a specific DtVrfObject. Various subclasses of this class will...
Definition: vrfObjectMessage.h:30
Override of DtScriptInterface::DtScriptFunctionReference that holds a function reference by function ...
Definition: luaScriptInterfaceImpl.h:685
std::vector< DtLuaScriptInterfaceExtension * > LocalInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:778
Abstract object used to hold a reference to a function defined in the script language, to be used later to invoke that function. Used for registering callbacks to be invoked after specified types of set data requests are executed. For this functionality to be used in a derived script interface implementation, a derived class must be implemented to represent a reference to a function in the script language.
Definition: scriptInterface.h:43
Definition: iffMode3CSettings.h:10
luabind::object luaGetEntityParam(lua_State *L, const DtScriptVrfObject &entity, std::string const ¶mName)
luabind::object luaGetStateProperty(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName)
Returns an object containing the value of the requested state property. May be a table containing a n...
virtual void processClearForReuse()
This function should be overridden by the inheritor to clear out any task specific variables...
Definition: asyncJobServer.h:39
bool luaSetSubordinateFunction(lua_State *L, const DtScriptVrfObject &entity, const DtScriptVrfObject &subEntity, const std::string &subFunction)
Given a table of {{"subordinate" = DtScriptVrfObject, "function" = string}} Set the state propert...
General settings that apply to all modes.
Definition: iffModeSSettings.h:13
std::vector< std::shared_ptr< const makVrfEvents::DtInfluenceEvent > > myInfluenceEvents
Definition: luaScriptInterfaceImpl.h:803
bool luaSetInternalStatePropertyListItem(lua_State *L, DtScriptOwnshipObject &entity, const std::string &context, const std::string &propertyName, luabind::object const &keyValues, luabind::object const &itemValue)
Sets a single item in an internal list state property to the given value. First looks in the list to ...
Contains the DtTranslatableStream class declaration.
const char ContactCurrentlyDetectedOnly[]
Definition: luaScriptInterfaceImpl.h:51
DtLuaScriptInterfaceExtension *(* CreatorFcn)(void *usr)
Prototype for DtLuaScriptInterfaceExtension creator function.
Definition: luaScriptInterfaceExtension.h:37
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
luabind::object luaGetOwnshipParameterPropertyMapItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValue)
DtScriptInterface & operator=(const DtScriptInterface &other)
virtual bool invokeCheck()=0
The DtLuaFeatureSet class is a wrapper around a DtFeatureSet that will provide feature information fo...
Definition: luaFeatureSet.h:27
luabind::object luaGetAisData(lua_State *L, const DtScriptVrfObject &entity)
Returns a table of AIS data for the specified entity.
LuaExtension()
Definition: luaScriptInterfaceImpl.h:783
std::map< DtString, ReaderWriterToLuaTableFcn > ReaderWriterToLuaTableMap
Definition: luaScriptInterfaceImpl.h:798
DtLuaScriptInterfaceExtension.
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
const char int mode
Definition: ioapi.h:38
luabind::object myCheckpointStateTable
Definition: luaScriptInterfaceImpl.h:796
bool luaSetSystemAttribute(DtScriptComponentSystem &system, const std::string &attributeName, const luabind::object &value, lua_State *L)
Contains Extended DI-Guy Object net types.
luabind::object luaGetTargetPriorityList(lua_State *L, const DtScriptOwnshipObject &thisEntity)
Gets the target priority list that this entity has.
luabind::object luaGetInternalStatePropertyListItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &context, const std::string &propertyName, luabind::object const &keyValues, int &index)
Returns an object containing the value of the of an item in the given internal state property...
void getMode3AData(lua_State *L, luabind::object &result, const DtIffMode3ASettings *settings)
void * usr
Definition: luaScriptInterfaceImpl.h:789
const char ContactHostileOnly[]
Definition: luaScriptInterfaceImpl.h:50
Definition: luaScriptInterfaceImpl.h:781
The "this" version is the own-ship object. It is separated to allow special functions for the ownshi...
Definition: scriptVrfObject.h:418
DtLuaMessageInterface * myMessageInterface
Definition: luaScriptInterfaceImpl.h:800
std::list< DtVectorOffset3D > luaGetOptionFormationPositions(lua_State *L, const DtScriptVrfObject &unit, const std::string &formationName, luabind::object const &options, int *leaderIndex)
Gets a list of offset vectors defining the positions in the formation. Returns the index of the leade...
luabind::object luaGetWeaponInfoList(lua_State *L, const DtScriptOwnshipObject &thisEntity)
Lua "getWeaponInfo()" Returns a list of the weapon info for weapons on this entity.
This class is a wrapper for a DtCompSystem for use by scripts. It derives from DtAsciiSerializable so...
Definition: scriptComponentSystem.h:18
This class is a two-way interface between the script language and its parent controller. There are functions that either the parent controller will call on the script interface (such as tick() ) and there will be functions the script interface will call on the parent controller to inform the parent of status updates and for data access.
Definition: scriptInterface.h:32
std::string myFunctionName
Definition: luaScriptInterfaceImpl.h:720
luabind::object luaGetOwnshipParameterPropertyListItemByIndex(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, int index)
virtual void invokeSuspend()=0
voidpf uLong offset
Definition: ioapi.h:42
A DtSetDataRequestMessage is a DtRadioMsg with a pointer to a setDataRequest. The type of the DtSetDa...
Definition: setDataRequestMessage.h:29
void getTCASData(lua_State *L, luabind::object &result, const DtIffTCASDataSettings *settings)
luabind::object luaGetStateOwnshipProperty(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName)
bool luaSetOrAddStateProperty(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &prop, bool addIfNotFound)
Sets the specified state property with the given value. If not found and addIfNotFound is true...
std::list< DtScriptVrfObject > luaGetContacts(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, luabind::object const &flags)
Lua "getContacts()" Return a list of contacts matching the given table of entity type filters...
luabind::object luaGetParameterPropertyMapItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValue)
Returns an object containing the value of the of an item in the given parameter property. The property must be a map. The item returned will have values matching the specified key value. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or map item could not be found, the returned table will be empty.
std::list< DtScriptVrfObject > luaGetHostileContactsWithFilterAliveOnly(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, bool observedOnly, bool aliveOnly)
This function is the same as luaGetContactsWithFilterAliveOnly, but it returns only hostile contacts...
Definition: iffBasicModeSettings.h:66
virtual void invokeShutdown()=0
virtual void invokeUpdateDisplayGraph()=0
Called when graphs are enabled to get an immediate graph output.
A locally simulated VRF object.
Definition: localObject.h:98
Definition: scriptVrfObject.h:30
luabind::object luaGetIffModeData(lua_State *L, const DtScriptVrfObject &entity, const DtModeType mode)
Returns a table with the Iff Mode specific data of the specified entity using the given IFF mode...
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22