1C Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

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

Reply
 
Thread Tools Display Modes
  #11  
Old 10-04-2011, 05:31 PM
Ataros Ataros is offline
Senior Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,438
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
  #12  
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
  #13  
Old 10-05-2011, 11:37 AM
FG28_Kodiak FG28_Kodiak is offline
Senior 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
  #14  
Old 10-05-2011, 03:58 PM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Thankyou Kodiak, I've got it now.
__________________
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
  #15  
Old 10-15-2011, 10:20 AM
David198502 David198502 is offline
Senior Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,535
Default

im still not able to spawn a single plane after another one gets destroyed!!!
why the heck has this to be sooo hard to achieve...damn
triggers dont seem to work and the scripts showed here in this thread dont seem to work either if i copy and paste them in the mission cs file.

Last edited by David198502; 10-15-2011 at 11:13 AM.
Reply With Quote
  #16  
Old 10-15-2011, 11:13 AM
David198502 David198502 is offline
Senior Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,535
Default

thats what i did so far...
Attached Files
File Type: zip scriptversuch.zip (1.3 KB, 5 views)
Reply With Quote
  #17  
Old 10-15-2011, 11:47 AM
FG28_Kodiak FG28_Kodiak is offline
Senior Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

I've tested your mission, the problem is that the trigger is never triggered (testet it with different numbers of planes and plane types), then remove the trigger and made a new one but no effect, may be a bug in the Beta. Normaly your code should work.

So I made a workaroung without trigger.

Code:
using System;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;


public class Mission : AMission
{

    public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages)
    {
        base.OnActorDead(missionNumber, shortName, actor, damages);

        AiAction MakeNewAircraft = GamePlay.gpGetAction("SpawnAircraft");
        
        if (actor != null && MakeNewAircraft != null)
        {
            if (actor.Name().Contains("BoB_RAF_F_FatCat_Early.000"))
            {

                MakeNewAircraft.Do();
                GamePlay.gpHUDLogCenter("New Enemy spawned!");
            }
        }
    }
}
What you need:
The script, a action in your Mission (i labled it "SpawnAircraft"), the name of the plane to destroy.
A new Airplane spawns after the previous is shoot down, you can improve it by adding a Planecount, etc.
Attached Files
File Type: zip SpawnAircraft.zip (1.2 KB, 12 views)

Last edited by FG28_Kodiak; 10-15-2011 at 01:03 PM.
Reply With Quote
  #18  
Old 10-15-2011, 02:00 PM
David198502 David198502 is offline
Senior Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,535
Default

thx Kodiak, really kind of you!and finally this works!
-if i understand it correctly, if i shoot the hurri, another one spawns, and i could repeat that to infinity???
i ask this, cause so far i tried the mission several times, and after i shot down the 4th hurri, no plane will spawn anymore....
i also expierence many game crashes, i think mainly when im near the spawning aera..

-can i just increase the number of the hurris without changing the script?i did and made a flight of six hurris, and after i shot down the 4th, the message "New Enemy spawned!" appeared, but unfortunately my game crashed.

-how do i determine the name of the plane???
-whats the planecount you mentioned to improve the mission???

i know i have many questions and im really greatful for your help.
Reply With Quote
  #19  
Old 10-15-2011, 02:33 PM
David198502 David198502 is offline
Senior Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,535
Default

ok tried again and answered some question by myself...its possible to increase the number of the planes...
after i let the hurri spawn further away and let it start on an airfield, the came doesnt crash anymore when spawning.

but it seems that after i shot down the first hurri, another spawns as expected, but after a few seconds, another one spawns without obvious reason....
happens everytime.so if i begin with one hurri, after i shot it down, i will have suddenly two enemies.
if i increase the the number from the beginning, the same thing seems to happen....but im still not sure when the respawn does take place in that situation....do i have to shoot down the first plane of the flight to trigger a respawn, or do i have to kill all planes of the flight??
Reply With Quote
  #20  
Old 10-15-2011, 02:44 PM
Osprey Osprey is offline
Senior Member
 
Join Date: Jan 2010
Location: Gloucestershire, England
Posts: 1,255
Default

From what I understand so far is that if you set up triggers in the FMB then they are no longer working and you have to use a script to fire them?

I am trying to airspawn a fighter escort when the bomber group pass through their sector, otherwise they all spawn together and the fighters are off into the distance and gone.

I have set a trigger for Blue when they enter the fighter area but they are spawning in on map start. I am selecting File>Play mission in order to test.
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 03:33 AM.

Based on a design by: Miner Skinz.com

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © 2007 1C Company. All rights reserved.