Module ZoneCaptureCoalition

Functional -- (WIP R2.3) Models the process to capture a Zone for a Coalition, which is guarded by another Coalition.


Banner Image


Contributions: Millertime: Concept

Author: Sven Van de Velde (FlightControl)


Global(s)

ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION class, extends ZoneGoalCoalition#ZONEGOALCOALITION

Models the process to capture a Zone for a Coalition, which is guarded by another Coalition.

Type ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:Attack()

Attack Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:Capture()

Capture Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:Empty()

Empty Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:Guard()

Guard Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:IsAttacked()
ZONE_CAPTURE_COALITION:IsCaptured()
ZONE_CAPTURE_COALITION:IsEmpty()
ZONE_CAPTURE_COALITION:IsGuarded()
ZONE_CAPTURE_COALITION:Mark()

Mark.

ZONE_CAPTURE_COALITION.MarkBlue
ZONE_CAPTURE_COALITION.MarkRed
ZONE_CAPTURE_COALITION:New(Zone, Coalition)

ZONECAPTURECOALITION Constructor.

ZONE_CAPTURE_COALITION:OnAfterAttack(From, Event, To)

Attack Handler OnAfter for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:OnAfterCapture(From, Event, To)

Capture Handler OnAfter for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:OnAfterEmpty(From, Event, To)

Empty Handler OnAfter for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:OnAfterGuard(From, Event, To)

Guard Handler OnAfter for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:OnBeforeAttack(From, Event, To)

Attack Handler OnBefore for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:OnBeforeCapture(From, Event, To)

Capture Handler OnBefore for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:OnBeforeEmpty(From, Event, To)

Empty Handler OnBefore for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:OnBeforeGuard(From, Event, To)

Guard Handler OnBefore for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION.ScheduleStatusZone
ZONE_CAPTURE_COALITION.SmokeScheduler
ZONE_CAPTURE_COALITION.States
ZONE_CAPTURE_COALITION:StatusZone()

Check status Coalition ownership.

ZONE_CAPTURE_COALITION:__Attack(Delay)

Attack Asynchronous Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:__Capture(Delay)

Capture Asynchronous Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:__Empty(Delay)

Empty Asynchronous Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:__Guard(Delay)

Guard Asynchronous Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:onafterGuard()

When started, check the Coalition status.

ZONE_CAPTURE_COALITION:onenterAttacked()
ZONE_CAPTURE_COALITION:onenterCaptured()
ZONE_CAPTURE_COALITION:onenterEmpty()
ZONE_CAPTURE_COALITION:onenterGuarded()

Bound.

Global(s)

#ZONE_CAPTURE_COALITION ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION class, extends ZoneGoalCoalition#ZONEGOALCOALITION

Models the process to capture a Zone for a Coalition, which is guarded by another Coalition.


Banner Image


The Zone is initially Guarded by the owning coalition, which is the coalition that initially occupies the zone with units of its coalition. Once units of an other coalition are entering the Zone, the state will change to Attacked. As long as these units remain in the zone, the state keeps set to Attacked. When all units are destroyed in the Zone, the state will change to Empty, which expresses that the Zone is empty, and can be captured. When units of the other coalition are in the Zone, and no other units of the owning coalition is in the Zone, the Zone is captured, and its state will change to Captured.

Event handlers can be defined by the mission designer to action on the state transitions.

1. ZONE_CAPTURE_COALITION constructor

2. ZONE_CAPTURE_COALITION is a finite state machine (FSM).

2.1 ZONE_CAPTURE_COALITION States

  • Captured: The Zone has been captured by an other coalition.
  • Attacked: The Zone is currently intruded by an other coalition. There are units of the owning coalition and an other coalition in the Zone.
  • Guarded: The Zone is guarded by the owning coalition. There is no other unit of an other coalition in the Zone.
  • Empty: The Zone is empty. There is not valid unit in the Zone.

2.2 ZONE_CAPTURE_COALITION Events

  • Capture: The Zone has been captured by an other coalition.
  • Attack: The Zone is currently intruded by an other coalition. There are units of the owning coalition and an other coalition in the Zone.
  • Guard: The Zone is guarded by the owning coalition. There is no other unit of an other coalition in the Zone.
  • Empty: The Zone is empty. There is not valid unit in the Zone.

Type ZoneCaptureCoalition

Type ZONE_CAPTURE_COALITION

Field(s)

ZONE_CAPTURE_COALITION:Attack()

Attack Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:Capture()

Capture Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:Empty()

Empty Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:Guard()

Guard Trigger for ZONE_CAPTURE_COALITION

ZONE_CAPTURE_COALITION:IsAttacked()
ZONE_CAPTURE_COALITION:IsCaptured()
ZONE_CAPTURE_COALITION:IsEmpty()
ZONE_CAPTURE_COALITION:IsGuarded()
ZONE_CAPTURE_COALITION:Mark()

Mark.

ZONE_CAPTURE_COALITION.MarkBlue
ZONE_CAPTURE_COALITION.MarkRed
ZONE_CAPTURE_COALITION:New(Zone, Coalition)

ZONECAPTURECOALITION Constructor.

Parameters

Return value

#ZONECAPTURECOALITION:

Usage:


 AttackZone = ZONE:New( "AttackZone" )

 ZoneCaptureCoalition = ZONE_CAPTURE_COALITION:New( AttackZone, coalition.side.RED ) -- Create a new ZONE_CAPTURE_COALITION object of zone AttackZone with ownership RED coalition.
 ZoneCaptureCoalition:__Guard( 1 ) -- Start the Guarding of the AttackZone.
 
ZONE_CAPTURE_COALITION:OnAfterAttack(From, Event, To)

Attack Handler OnAfter for ZONE_CAPTURE_COALITION

Parameters

  • #string From :

  • #string Event :

  • #string To :

ZONE_CAPTURE_COALITION:OnAfterCapture(From, Event, To)

Capture Handler OnAfter for ZONE_CAPTURE_COALITION

Parameters

  • #string From :

  • #string Event :

  • #string To :

ZONE_CAPTURE_COALITION:OnAfterEmpty(From, Event, To)

Empty Handler OnAfter for ZONE_CAPTURE_COALITION

Parameters

  • #string From :

  • #string Event :

  • #string To :

ZONE_CAPTURE_COALITION:OnAfterGuard(From, Event, To)

Guard Handler OnAfter for ZONE_CAPTURE_COALITION

Parameters

  • #string From :

  • #string Event :

  • #string To :

ZONE_CAPTURE_COALITION:OnBeforeAttack(From, Event, To)

Attack Handler OnBefore for ZONE_CAPTURE_COALITION

Parameters

  • #string From :

  • #string Event :

  • #string To :

Return value

#boolean:

ZONE_CAPTURE_COALITION:OnBeforeCapture(From, Event, To)

Capture Handler OnBefore for ZONE_CAPTURE_COALITION

Parameters

  • #string From :

  • #string Event :

  • #string To :

Return value

#boolean:

ZONE_CAPTURE_COALITION:OnBeforeEmpty(From, Event, To)

Empty Handler OnBefore for ZONE_CAPTURE_COALITION

Parameters

  • #string From :

  • #string Event :

  • #string To :

Return value

#boolean:

ZONE_CAPTURE_COALITION:OnBeforeGuard(From, Event, To)

Guard Handler OnBefore for ZONE_CAPTURE_COALITION

Parameters

  • #string From :

  • #string Event :

  • #string To :

Return value

#boolean:

ZONE_CAPTURE_COALITION.ScheduleStatusZone
ZONE_CAPTURE_COALITION.SmokeScheduler
ZONE_CAPTURE_COALITION.States
ZONE_CAPTURE_COALITION:StatusZone()

Check status Coalition ownership.

ZONE_CAPTURE_COALITION:__Attack(Delay)

Attack Asynchronous Trigger for ZONE_CAPTURE_COALITION

Parameter

  • #number Delay :

ZONE_CAPTURE_COALITION:__Capture(Delay)

Capture Asynchronous Trigger for ZONE_CAPTURE_COALITION

Parameter

  • #number Delay :

ZONE_CAPTURE_COALITION:__Empty(Delay)

Empty Asynchronous Trigger for ZONE_CAPTURE_COALITION

Parameter

  • #number Delay :

ZONE_CAPTURE_COALITION:__Guard(Delay)

Guard Asynchronous Trigger for ZONE_CAPTURE_COALITION

Parameter

  • #number Delay :

ZONE_CAPTURE_COALITION:onafterGuard()

When started, check the Coalition status.

ZONE_CAPTURE_COALITION:onenterAttacked()
ZONE_CAPTURE_COALITION:onenterCaptured()
ZONE_CAPTURE_COALITION:onenterEmpty()
ZONE_CAPTURE_COALITION:onenterGuarded()

Bound.