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 05-20-2011, 08:12 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Quote:
Originally Posted by klem View Post
Ataros has suggested loading a second FMB mission at the appropriate time but I don't see how I can tie that to an existing mission i.e. an existing Convoy route that receives a second attack later on. It seems I would have to show the convoy route in the new mission to include the Attack and that would duplicate the one in the first misson.
Hi klem, I think the best way to accomplish that would be to use a trigger, action, and a script. You would set a trigger to fire off after how ever many seconds you want, then create an airgroup to attack the convoy. In the airgroup's properties I believe you have to click a check box that says something like "script spawn only".

After that, create an action that will spawn the airgroup you just created. You could even make the action spawn the original airgroup if you want the second attack force to be exactly the same as the first. Just remember to uncheck "script spawn only" so that the airgroup spawns at the start of the mission like normal.

The script will look like this:

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

public class Mission : AMission
{
public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        //call base classes OnTrigger method.
        base.OnTrigger(missionNumber, shortName, active);

        //if the trigger that was called is the trigger that we're looking for
        if (shortName.Equals("attackConvoyDelay") && active)
        {
            AiAction action = GamePlay.gpGetAction("attackConvoy"));
            if (action != null)
                 action.Do();

        }
}
So if you put this code into the mission's script file, it will trigger your action whenever your trigger... triggers.

Note that I've named the trigger "attackConvoyDelay" and the action "attackConvoy". You can change them to whatever you want, just make sure they are the same in both the mission and the script.

I hope this helps.
Reply With Quote
  #2  
Old 05-20-2011, 09:57 AM
klem's Avatar
klem klem is offline
Approved Member
 
Join Date: Nov 2007
Posts: 1,653
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post
Hi klem, I think the best way to accomplish that would be to use a trigger, action, and a script..................
Thanks! I think I even understand that. Simpler than I expected

I've set up the Trigger, Action and Script, just got to add the rest of the waypoints. I'll finish it tonight and try it out.

Cheers
__________________
klem
56 Squadron RAF "Firebirds"
http://firebirds.2ndtaf.org.uk/



ASUS Sabertooth X58 /i7 950 @ 4GHz / 6Gb DDR3 1600 CAS8 / EVGA GTX570 GPU 1.28Gb superclocked / Crucial 128Gb SSD SATA III 6Gb/s, 355Mb-215Mb Read-Write / 850W PSU
Windows 7 64 bit Home Premium / Samsung 22" 226BW @ 1680 x 1050 / TrackIR4 with TrackIR5 software / Saitek X52 Pro & Rudders
Reply With Quote
  #3  
Old 05-20-2011, 10:16 AM
SYN_Flashman SYN_Flashman is offline
Approved Member
 
Join Date: Feb 2011
Posts: 48
Default

I have just had a thought about scripts that start submissions.... can the submissions themselves have scripts? I think they can: when first testing the submission script i accidentally left a script in one of the submissions and it took ages for me to work out what the hell was going on!

Im at work so I can't test this but here is an idea to allow a mission to repeat every 2 hours or so. A few posts up I related how im having trouble doing this with the repeat part of the script but an alternative method might be this:

MAIN MISSION SCRIPT: Spawn bombergroup1 submission after 15 mins server time. NO repeats

15 mins main server time > bombergroup1 submission starts. It has a script itself which says: Spawn bombergroup 1 after 2 hours (i.e. it starts itself again)

2hr 15 min main server time> bombergroup1 submission starts again...

If this works correctly then so long as the server is running every two hours the bombergroup1 submission will spawn.

the bombergroup1 submission will last approx 90 mins plus however long it takes to despawn the landed/crashed planes (using Atatos et als script..which works well!). In other words it should finish and the aircraft despawn BEFORE it starts again.

Questions:

1) has anyone tried this? (I will later... damn I hate work!!)

2) when the submission starts, does it start its own tickcount from its creation, or does it 'read' the master mission tick count?

This is important because if it starts its own tickcount then the second time the bomber group spawns it will be 2 hours after the first. If however it uses the master mission tickcount it might start after 2 hours server time, but this is only 1 hr 45 after the first submission starts. This might mean that the next subsequent submission will not start at all.

3) Am i making any sense whatsoever?

PS I know that the tickcount isn't truly accurate with regards to time, but its close enough for my needs.
Reply With Quote
  #4  
Old 05-20-2011, 10:26 AM
ZaltysZ's Avatar
ZaltysZ ZaltysZ is offline
Approved Member
 
Join Date: Sep 2008
Location: Lithuania
Posts: 426
Default

Quote:
Originally Posted by SYN_Flashman View Post
1) has anyone tried this? (I will later... damn I hate work!!)
Yes.

Quote:
Originally Posted by SYN_Flashman View Post
2) when the submission starts, does it start its own tickcount from its creation, or does it 'read' the master mission tick count?
I am at work too, so not sure, but I think Time comes from Battle and not from Mission. Basically Battle has its own OnTickGame() which iterates through all missions and calls their OnTickGame().


Quote:
Originally Posted by SYN_Flashman View Post
I3) Am i making any sense whatsoever?
Depends on what you want to do.

Last edited by ZaltysZ; 05-20-2011 at 10:30 AM.
Reply With Quote
  #5  
Old 05-24-2011, 02:56 PM
klem's Avatar
klem klem is offline
Approved Member
 
Join Date: Nov 2007
Posts: 1,653
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post
Hi klem, I think the best way to accomplish that would be to use a trigger, action, and a script..........................

The script will look like this:

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

public class Mission : AMission
{
public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        //call base classes OnTrigger method.
        base.OnTrigger(missionNumber, shortName, active);

        //if the trigger that was called is the trigger that we're looking for
        if (shortName.Equals("attackConvoyDelay") && active)
        {
            AiAction action = GamePlay.gpGetAction("attackConvoy"));
            if (action != null)
                 action.Do();

        }
}
So if you put this code into the mission's script file, it will trigger your action whenever your trigger... triggers.

Note that I've named the trigger "attackConvoyDelay" and the action "attackConvoy". You can change them to whatever you want, just make sure they are the same in both the mission and the script.

I hope this helps.
Thought I'd report back on this, I eventually got the following to work:

public override void OnTrigger(int missionNumber, string shortName, bool active)

{
//call base classes OnTrigger method.
base.OnTrigger(missionNumber, shortName, active);
GamePlay.gpHUDLogCenter("shortname = " + shortName);
//if the trigger that was called is the trigger that we're looking for
if (shortName.Equals("AttackConvoy2Delay1"))
{
AiAction action = GamePlay.gpGetAction("AttackConvoy2_1") ;
if (action != null)
{ action.Do(); }
}


}

The '&& active' didn't work because:
1. It seems it should be + not &&
2. You can see I tested for the shortname and of course ("AttackConvoy2Delay1" + active) isn't equal to "AttackConvoy2Delay1". I don't know what 'active' comes back as but it would make the strings unequal.

Also, I put { } around the if(action != null) output as { action.Do(); } although that may not havebeen necessary.

Anyway it works !

Thanks for the help TheEnlightenedFlorist.
__________________
klem
56 Squadron RAF "Firebirds"
http://firebirds.2ndtaf.org.uk/



ASUS Sabertooth X58 /i7 950 @ 4GHz / 6Gb DDR3 1600 CAS8 / EVGA GTX570 GPU 1.28Gb superclocked / Crucial 128Gb SSD SATA III 6Gb/s, 355Mb-215Mb Read-Write / 850W PSU
Windows 7 64 bit Home Premium / Samsung 22" 226BW @ 1680 x 1050 / TrackIR4 with TrackIR5 software / Saitek X52 Pro & Rudders
Reply With Quote
  #6  
Old 05-24-2011, 03:09 PM
ZaltysZ's Avatar
ZaltysZ ZaltysZ is offline
Approved Member
 
Join Date: Sep 2008
Location: Lithuania
Posts: 426
Default

"active" is boolean (logical true or false). You should check "active" to see if trigger is active.

Code:
if (shortName.Equals("attackConvoyDelay") && active)
means: if trigger name is "attackConvoyDelay" AND (&&) this trigger is active, then do something...
Reply With Quote
  #7  
Old 05-24-2011, 03:54 PM
klem's Avatar
klem klem is offline
Approved Member
 
Join Date: Nov 2007
Posts: 1,653
Default

Aaahh! Got it. Thanks
__________________
klem
56 Squadron RAF "Firebirds"
http://firebirds.2ndtaf.org.uk/



ASUS Sabertooth X58 /i7 950 @ 4GHz / 6Gb DDR3 1600 CAS8 / EVGA GTX570 GPU 1.28Gb superclocked / Crucial 128Gb SSD SATA III 6Gb/s, 355Mb-215Mb Read-Write / 850W PSU
Windows 7 64 bit Home Premium / Samsung 22" 226BW @ 1680 x 1050 / TrackIR4 with TrackIR5 software / Saitek X52 Pro & Rudders
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 11:13 AM.


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