![]() |
Can you group multiple [Action] to spawn from one time [Trigger]?
I want to use one time trigger to spawn multiple groups in an [ACTION] spawn
Is there a way you can spawn multiple actions when the time trigger G17 is active? [Trigger] G17 TTime 60 [Action] action17 ASpawnGroup 1 BoB_LW_KuFlGr_706.01 action18 ASpawnGroup 1 BoB_LW_KuFlGr_706.04 action19 ASpawnGroup 1 BoB_LW_KuFlGr_706.02 Code:
base.OnTrigger(missionNumber, shortName, active); |
yes create a list (or array) which contains the actionnames.
Example: Code:
List<string> ActionToDoList = new List<string>{"action17", "action18", "action19"}; Code:
if ("G17".Equals(shortName) && active) |
FG28_Kodiak I tried this with a number of other changes but I keep getting the following server error.
The name 'action' does not exist in the current context. I have looked at other coding and can not see the problem. Code:
and if I use this code I get another error saying Invalid expression term 'if' Code:
List<string> ActionToDoList = new List<string>{"action17", "action18", "action19", "action20", "action21", "action22"}; |
Hm look at my example. ;)
ActionToDoList.ForEach(item => { AiAction action = GamePlay.gpGetAction(item); //<== you forget this line if (action != null) { action.Do(); } }); Second problem: if ("G17".Equals(shortName) && active) { ActionToDoList.ForEach(item => { //<== you forget this bracket if (action != null) { action.Do(); } }); |
Yes that got it. Gees mate. I am gonna have to put your name in lights in this next mission to be released hahaha
Thanks so much |
All times are GMT. The time now is 08:56 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.