OK. got workiing prototype now, works!

This commit is contained in:
FlightControl 2016-07-02 09:26:00 +02:00
parent ae1aeac6ce
commit 4ac962a87a
4 changed files with 5 additions and 3 deletions

View File

@ -108,6 +108,7 @@ function STATEMACHINE:_create_transition(name)
local fsmparent, event = self:_isendstate( to )
if fsmparent and event then
self:_call_handler(self["onstatechange"], params)
fsmparent[event]( fsmparent )
else
self:_call_handler(self["onenter" .. to] or self["on" .. to], params)

View File

@ -43,7 +43,8 @@ function TASK2_SEAD:New( Client, Mission, TargetSet )
onMoreTargets = self.OnMoreTargets,
onDestroyed = self.OnDestroyed,
onKilled = self.OnKilled,
}
},
endstates = { 'Success', 'Failed' }
} )

View File

@ -20,8 +20,8 @@ local Task_Sead = STATEMACHINE:New( {
{ name = 'Start', from = 'None', to = 'Unassigned' },
{ name = 'Next', from = 'Unassigned', to = 'Assigned' },
-- { name = 'Route', from = 'Assigned', to = 'Arrived' },
{ name = 'Next', from = 'Assigned', to = 'Seading' },
{ name = 'Destroyed', from = 'Destroy', to = 'Success' },
{ name = 'Next', from = 'Assigned', to = 'Success' },
{ name = 'Failed', from = 'Assigned', to = 'Failed' },
},
subs = {
Menu = { onstateparent = 'Unassigned', oneventparent = 'Start', fsm = Task_Menu.Fsm, event = 'Menu', returnevents = { 'Next' } },