Special Action selection
Posted: Mon Jun 25, 2018 10:02 pm
This may be more of a logic question than a pure Lua one but here goes:
1. I have set up four special actions in a scenario, each one 'builds' something then turns all four special actions off. E.g.:
ScenEdit_AddUnit({type = 'Facility', name = 'Socotra Landing Zone', dbid = 91, side = 'NATO', latitude='12.6289409489019', longitude='53.9100187657863'})
ScenEdit_SpecialMessage('NATO','Sir: The Engineers have cleared a helicopter landing and operations area')
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - HLZ', IsActive='False'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Parking', IsActive='False'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Pier', IsActive='False'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Runway', IsActive='False'})
2. On a regular time interval these special actions will be turned back on:
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - HLZ', IsActive='True'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Parking', IsActive='True'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Pier', IsActive='True'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Runway', IsActive='True'})
ScenEdit_SpecialMessage('NATO','You have Special Actions available for engineering work')
This all works fine but - is there a way I can remove the special action just completed from the active list? For instance, player decides to build the HLZ, so once s/he choses that action it no longer appears when the list of available actions is triggered again.
Thanks.
B
1. I have set up four special actions in a scenario, each one 'builds' something then turns all four special actions off. E.g.:
ScenEdit_AddUnit({type = 'Facility', name = 'Socotra Landing Zone', dbid = 91, side = 'NATO', latitude='12.6289409489019', longitude='53.9100187657863'})
ScenEdit_SpecialMessage('NATO','Sir: The Engineers have cleared a helicopter landing and operations area')
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - HLZ', IsActive='False'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Parking', IsActive='False'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Pier', IsActive='False'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Runway', IsActive='False'})
2. On a regular time interval these special actions will be turned back on:
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - HLZ', IsActive='True'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Parking', IsActive='True'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Pier', IsActive='True'})
ScenEdit_SetSpecialAction ({ActionNameOrID ='Engr - Runway', IsActive='True'})
ScenEdit_SpecialMessage('NATO','You have Special Actions available for engineering work')
This all works fine but - is there a way I can remove the special action just completed from the active list? For instance, player decides to build the HLZ, so once s/he choses that action it no longer appears when the list of available actions is triggered again.
Thanks.
B