Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 10-04-2011, 12:59 PM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

... 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
Reply With Quote
  #2  
Old 10-04-2011, 01:43 PM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

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;            
          }
   }
}
At least that works for me in multiplayer enviroment. Maybe you test you map in multiplayer hosting as server? Some triggers do not work on a dedicated server, but I understood that is not your question.
__________________
http://cornedebrouwer.nl/cf48e

Last edited by SNAFU; 10-04-2011 at 01:46 PM.
Reply With Quote
  #3  
Old 10-04-2011, 02:11 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

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();
    }
Your FMB trigger and action must have the same name if you use this script.

Check if both action and trigger are defined correctly (trigger type, airgroup, etc.) and saved in FMB.
Reply With Quote
  #4  
Old 10-04-2011, 02:19 PM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

I don´t know if it was fixed in the Beta, but the action (spawn airgroup) of triggers was broken, some patches ago. So you have to use a script to link triggers and actions. I supposed you set the trigger and the action in the FMB.
__________________
http://cornedebrouwer.nl/cf48e
Reply With Quote
  #5  
Old 10-04-2011, 03:27 PM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Quote:
Originally Posted by SNAFU View Post
I don´t know if it was fixed in the Beta, but the action (spawn airgroup) of triggers was broken, some patches ago. So you have to use a script to link triggers and actions. I supposed you set the trigger and the action in the FMB.
That's what I've done. The info window reports that the group has spawned in my test, indicating that the script has executed, but alas no planes actually spawned

Here's the script I used, the trigger & the spawn airgroup (after 60s) actions are both named 'Dorniers'...

public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);

if ("Dorniers".Equals(shortName) && active)
{
AiAction action = GamePlay.gpGetAction("Dorniers"); //same as YourTriggerName
GamePlay.gpLogServer(null, " German bomber group spawned ", new object[] { }); //Testmessage
if (action != null)
{
action.Do();
}
GamePlay.gpGetTrigger(shortName).Enable = false;
}
}
__________________
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
Reply With Quote
  #6  
Old 10-04-2011, 03:38 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by salmo View Post
after 60s
How is this possible?

Try without the delay.
Reply With Quote
  #7  
Old 10-04-2011, 03:50 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Made a sample mission, the Doniers spawn after 10sec.
Attached Files
File Type: zip Donier.zip (1.0 KB, 77 views)
Reply With Quote
  #8  
Old 10-04-2011, 05:31 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Sorry after reading the OP post I was thinking the trigger is airgroup destroyed, not TTime 10. My bad

Quote:
Originally Posted by salmo View Post
... and doesn't seem to work for me either (spawning a bomber group every x seconds)
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.
Reply With Quote
  #9  
Old 10-05-2011, 11:18 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Quote:
Originally Posted by Ataros View Post
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.
Thankyou Ataros. I'm aiming to spawn a group of Dorniers every XX min, so I've created the main mission (has all ground objects etc), and a sub-mission with only the Dornier bombers flight & waypoints. Here's my script so far which seem to be working, but I'm a little unsure of the timing parameters & their meaning ...

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
Reply With Quote
  #10  
Old 10-05-2011, 11:37 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

if (Time.tickCounter() % Repeat == Dlay) //


Ok % is the Modulo operator in c#

Repeat has a value of 108000
Dlay has a value of 1800

So your mission would load first after 10min and then every 60min.

for every 10min you should use
if (Time.tickCounter() % 1800 == 1799)
so it waits ~10min and then repeat the doniers every 10min
30ticks are around 1sec, but can vary (so often 34Ticks is a second).
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:39 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.