![]() |
|
|
|
#1
|
||||
|
||||
|
just cannot get airplanes to spawn.
in the FMB i want to spawn a group of planes after another is destroyed, but nothing happens. ![]() after i destroyed the first group, the second will just not appear. can someone please explain how to do that? |
|
#2
|
|||
|
|||
|
The Trigger-Action was broken a few patchs ago. You have to activate the Action by script.
First define Triggers as usual (Groupdead Triggers must have same Name as the Spawn-Action) and then implement the following into your script: Code:
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
if ("YourTriggerName".Equals(shortName) && active)
{
AiAction action = GamePlay.gpGetAction("YourActionName"); //same as YourTriggerName
GamePlay.gpLogServer(null, " Your Trigger was triggered ", new object[] { }); //Testmessage
if (action != null)
{
action.Do();
}
GamePlay.gpGetTrigger(shortName).Enable = false;
}
}
__________________
http://cornedebrouwer.nl/cf48e Last edited by SNAFU; 09-27-2011 at 11:39 AM. |
|
#3
|
||||
|
||||
|
thx but doesnt seem to work...
|
|
#4
|
|||
|
|||
|
... and doesn't seem to work for me either (spawning a bomber group every x seconds)
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash. Get the latest COD Team Fusion patch info HERE |
|
#5
|
|||
|
|||
|
Mmh, you are using a script like the following and named your triggers and actions accordingly, also in the script? (Triggername = Actionname)
Code:
using System;
using System.Text;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
if ("YourTriggerName".Equals(shortName) && active) //Edit "YourTriggerName"
{
AiAction action = GamePlay.gpGetAction("YourActionName"); //same as "YourTriggerName"
GamePlay.gpLogServer(null, " Your Trigger was triggered ", new object[] { }); //Testmessage
if (action != null)
{
action.Do();
}
GamePlay.gpGetTrigger(shortName).Enable = false;
}
}
}
__________________
http://cornedebrouwer.nl/cf48e Last edited by SNAFU; 10-04-2011 at 02:46 PM. |
|
#6
|
|||
|
|||
|
If you do not use any script FMB triggers would work if name of a trigger and action are the same.
If you have any script working with your mission you have to add a trigger section to it to allow triggers to work. The most simple one is Code:
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
AiAction action = GamePlay.gpGetAction(ActorName.Full(missionNumber, shortName));
if (action != null)
action.Do();
}
Check if both action and trigger are defined correctly (trigger type, airgroup, etc.) and saved in FMB. |
|
#7
|
|||
|
|||
|
Sorry after reading the OP post I was thinking the trigger is airgroup destroyed, not TTime 10. My bad
But anyway, I think it is not possible to repeat spawn with a trigger only. It is better to use ontickgame method in a script described for instance in link #2 in my sig. |
|
#8
|
|||
|
|||
|
Quote:
using System; using maddox.game; using maddox.game.world; using System.Collections.Generic; public class Mission : AMission { public override void OnTickGame() { // Timing parameters int Repeat = 108000; // ?? repeat mission every 60 min int Dlay = 18000; // ?? launch Dorniers flights every 10 min // load the Dornier's bombers sub-mission every ??10 min if (Time.tickCounter() % Repeat == Dlay) // what does repeat parameter do? Dlay seems to spawn bombers every 10min OK { GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/Test/Dorniers.mis"); // prints message on screen after mission load GamePlay.gpHUDLogCenter("Another wave of German bombers heading towards Lympne airfield"); // prints message on screen in 10 minutes / 600 seconds double initTime = 0.0; Timeout(initTime += 600, () => { GamePlay.gpHUDLogCenter("Another wave of German bombers heading towards Lympne airfield"); }); } } }
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash. Get the latest COD Team Fusion patch info HERE |
![]() |
| Thread Tools | |
| Display Modes | |
|
|