Module Functional.Tiresias
Functional - TIRESIAS - manages AI behaviour.
The #TIRESIAS class is working in the back to keep your large-scale ground units in check.
Features:
- Designed to keep CPU and Network usage lower on missions with a lot of ground units.
- Does not affect ships to keep the Navy guys happy.
- Does not affect OpsGroup type groups.
- Distinguishes between SAM groups, AAA groups and other ground groups.
- Exceptions can be defined to keep certain actions going.
- Works coalition-independent in the back
- Easy setup.
Missions:
TIRESIAS
Author : *applevangelist *
Global(s)
Global TIRESIAS |
Tiresias, Greek demi-god and shapeshifter, blinded by the Gods, works as oracle for you. (Wiki) TIRESIAS Concept
|
Tiresias, Greek demi-god and shapeshifter, blinded by the Gods, works as oracle for you. (Wiki)
TIRESIAS Concept
- Designed to keep CPU and Network usage lower on missions with a lot of ground units.
- Does not affect ships to keep the Navy guys happy.
- Does not affect OpsGroup type groups.
- Distinguishes between SAM groups, AAA groups and other ground groups.
- Exceptions can be defined in SET_GROUP objects to keep certain actions going.
- Works coalition-independent in the back
- Easy setup.
Setup
Setup is a one-liner:
local blinder = TIRESIAS:New()
Optionally you can set up exceptions, e.g. for convoys driving around
local exceptionset = SET_GROUP:New():FilterCoalitions("red"):FilterPrefixes("Convoy"):FilterStart()
local blinder = TIRESIAS:New()
blinder:AddExceptionSet(exceptionset)
Options
-- Setup different radius for activation around helo and airplane groups (applies to AI and humans)
blinder:SetActivationRanges(10,25) -- defaults are 10, and 25
-- Setup engagement ranges for AAA (non-advanced SAM units like Flaks etc) and if you want them to be AIOff
blinder:SetAAARanges(60,true) -- defaults are 60, and true
Type(s)
Fields and Methods inherited from TIRESIAS | Description |
---|---|
[USER] Add a SET_GROUP of GROUP objects as exceptions. |
|
[USER] Create a new Tiresias object and start it up. |
|
[USER] Set AAA Ranges - AAA equals non-SAM systems which qualify as AAA in DCS world. |
|
[USER] Set activation radius for Helos and Planes in Nautical Miles. |
|
Triggers the FSM event "Start". |
|
Triggers the FSM event "Stop". |
|
[INTERNAL] Event handler function |
|
[INTERNAL] Filter Function |
|
[INTERNAL] Filter Function |
|
[INTERNAL] Filter Function |
|
[INTERNAL] Filter Function |
|
[INTERNAL] Init Groups |
|
[INTERNAL] Switch Groups Behaviour |
|
Triggers the FSM event "Start" after a delay. |
|
Triggers the FSM event "Stop" after a delay. |
|
[INTERNAL] FSM Function |
|
[INTERNAL] FSM Function |
|
[INTERNAL] FSM Function |
|
[INTERNAL] FSM Function |
|
Fields and Methods inherited from FSM | Description |
---|---|
Adds an End state. |
|
Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task. |
|
Adds a score for the FSM to be achieved. |
|
TIRESIAS:AddScoreProcess(From, Event, State, ScoreText, Score) |
Adds a score for the FSM_PROCESS to be achieved. |
Add a new transition rule to the FSM. |
|
Get current state. |
|
Returns the End states. |
|
Returns a table of the SubFSM rules defined within the FSM. |
|
Returns a table with the scores defined. |
|
Returns the start state of the FSM. |
|
Get current state. |
|
Returns a table with the Subs defined. |
|
Returns a table of the transition rules defined within the FSM. |
|
Check if FSM is in state. |
|
Load call backs. |
|
Creates a new FSM object. |
|
Sets the start state of the FSM. |
|
Add to map. |
|
Call handler. |
|
Create transition. |
|
Delayed transition. |
|
Event map. |
|
Go sub. |
|
Handler. |
|
Is end state. |
|
Sub maps. |
|
Check if can do an event. |
|
Check if cannot do an event. |
|
Check if FSM is in state. |
|
Fields and Methods inherited from TIRESIAS.Data | Description |
---|---|
- TIRESIAS class, extends Core.Base#BASE
Field(s)
Function(s)
[USER] Add a SET_GROUP of GROUP objects as exceptions.
Can be done multiple times. Does not work work for GROUP objects spawned into the SET after start, i.e. the groups need to exist in the game already.
Defined in:
TIRESIAS
Parameter:
to add to the exception list.
Return value:
self
[USER] Create a new Tiresias object and start it up.
[USER] Set AAA Ranges - AAA equals non-SAM systems which qualify as AAA in DCS world.
Defined in:
TIRESIAS
Parameters:
#number FiringRange
The engagement range that AAA units will be set to. Can be 0 to 100 (percent). Defaults to 60.
#boolean SwitchAAA
Decide if these system will have their AI switched off, too. Defaults to true.
Return value:
self
[USER] Set activation radius for Helos and Planes in Nautical Miles.
Defined in:
TIRESIAS
Parameters:
#number HeloMiles
Radius around a Helicopter in which AI ground units will be activated. Defaults to 10NM.
#number PlaneMiles
Radius around an Airplane in which AI ground units will be activated. Defaults to 25NM.
Return value:
self
Triggers the FSM event "Start".
Starts TIRESIAS and all its event handlers. Note - :New()
already starts the instance.
Defined in:
TIRESIAS
Triggers the FSM event "Stop".
Stops TIRESIAS and all its event handlers.
Defined in:
TIRESIAS
[INTERNAL] Event handler function
[INTERNAL] Filter Function
[INTERNAL] Filter Function
[INTERNAL] Filter Function
[INTERNAL] Filter Function
[INTERNAL] Switch Groups Behaviour
Defined in:
TIRESIAS
Parameters:
Wrapper.Group#GROUP group
#number radius
Radius in NM
Return value:
self
Triggers the FSM event "Start" after a delay.
Starts TIRESIAS and all its event handlers. Note - :New()
already starts the instance.
Defined in:
TIRESIAS
Parameter:
#number delay
Delay in seconds.
Triggers the FSM event "Stop" after a delay.
Stops TIRESIAS and all its event handlers.
Defined in:
TIRESIAS
Parameter:
#number delay
Delay in seconds.
[INTERNAL] FSM Function
Defined in:
TIRESIAS
Parameters:
#string From
#string Event
#string To
Return value:
self
[INTERNAL] FSM Function
Defined in:
TIRESIAS
Parameters:
#string From
#string Event
#string To
Return value:
self
[INTERNAL] FSM Function
Defined in:
TIRESIAS
Parameters:
#string From
#string Event
#string To
Return value:
self
[INTERNAL] FSM Function
Defined in:
TIRESIAS
Parameters:
#string From
#string Event
#string To
Return value:
self
Field(s)
Function(s)
Adds an End state.
Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.
Defined in:
Parameters:
#table From
Can contain a string indicating the From state or a table of strings containing multiple From states.
#string Event
The Event name.
Core.Fsm#FSM_PROCESS Process
An sub-process FSM.
#table ReturnEvents
A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.
Return value:
The SubFSM.
Adds a score for the FSM to be achieved.
Defined in:
Parameters:
#string State
is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
#string ScoreText
is a text describing the score that is given according the status.
#number Score
is a number providing the score of the status.
Return value:
#FSM:
self
Adds a score for the FSM_PROCESS to be achieved.
Defined in:
Parameters:
#string From
is the From State of the main process.
#string Event
is the Event of the main process.
#string State
is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
#string ScoreText
is a text describing the score that is given according the status.
#number Score
is a number providing the score of the status.
Return value:
#FSM:
self
Add a new transition rule to the FSM.
A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.
Defined in:
Parameters:
#table From
Can contain a string indicating the From state or a table of strings containing multiple From states.
#string Event
The Event name.
#string To
The To state.
Get current state.
Returns the End states.
Returns a table of the SubFSM rules defined within the FSM.
Returns a table with the scores defined.
Returns the start state of the FSM.
Get current state.
Returns a table with the Subs defined.
Returns a table of the transition rules defined within the FSM.
Check if FSM is in state.
Defined in:
Parameter:
#string State
State name.
Return value:
#boolean:
If true, FSM is in this state.
Load call backs.
Sets the start state of the FSM.
Add to map.
Call handler.
Defined in:
Parameters:
#string step
Step "onafter", "onbefore", "onenter", "onleave".
#string trigger
Trigger.
#table params
Parameters.
#string EventName
Event name.
Return value:
Value.
Create transition.
Defined in:
Parameter:
#string EventName
Event name.
Return value:
#function:
Function.
Delayed transition.
Defined in:
Parameter:
#string EventName
Event name.
Return value:
#function:
Function.
Event map.
Go sub.
Defined in:
Parameters:
#string ParentFrom
Parent from state.
#string ParentEvent
Parent event name.
Return value:
#table:
Subs.
Handler.
Is end state.
Defined in:
Parameter:
#string Current
Current state name.
Return values:
#table:
FSM parent.
#string:
Event name.
Sub maps.
Check if can do an event.
Defined in:
Parameter:
#string e
Event name.
Return values:
#boolean:
If true, FSM can do the event.
#string:
To state.
Check if cannot do an event.
Defined in:
Parameter:
#string e
Event name.
Return value:
#boolean:
If true, FSM cannot do the event.
Check if FSM is in state.
Defined in:
Parameters:
#string State
State name.
state
Return value:
#boolean:
If true, FSM is in this state.