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 09-24-2011, 01:07 PM
Mington Mington is offline
Approved Member
 
Join Date: Apr 2008
Posts: 29
Default

Wow thanks very much for your collection Ataros!

It is better to start a new thread for each new module you need

Wiil do, thanks

they just looked [FMB stuff] up

Kodiak works/worked for Maddox perhaps - this is a compliment btw. He/she definitely knows his stuff. Let's face it somebody has to

onTrigger method with really big trigger radius around an airfield

A trigger radius hmm - thanks (I'll see if I can trigger a message 'We see your plane incoming, it looks damaged...' to 'Crossed the airfield EmergencyAlertRadius')

Thinking out loud then- two airfields say Croydon and Biggin Hill and my single plane taking off at one airfield. Testing the other airfield's EmergencyAlert (procedure) - with a simple onscreen message if my plane trips the second airfield's trigger. Baby steps.

Adding the trigger in a script rather than via the FMB, to make it universal. Does the FMB write trigger code into the dot cs I wonder. I know that airfields have one radius and then another radius

Ming
Reply With Quote
  #2  
Old 09-24-2011, 01:24 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by Mington View Post

Adding the trigger in a script rather than via the FMB, to make it universal. Does the FMB write trigger code into the dot cs I wonder. I know that airfields have one radius and then another radius
Trigger has its own radius. It is set in FMB and is stored in a mission file, not in script file.

According to the devs to make FMB triggers work together with any script you can add this code to script. Action and trigger must have the same name in this case.
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();
    }
There are other more advanced and complex possibilities. Check out the _Triggers and actions folder in my archive or search forums for trigger script.

ps. BTW are you one of simhq admins by chance? I have trouble registering at simhq forums somehow. Same nickname.

Last edited by Ataros; 09-24-2011 at 01:31 PM.
Reply With Quote
  #3  
Old 09-25-2011, 12:39 PM
Mington Mington is offline
Approved Member
 
Join Date: Apr 2008
Posts: 29
Default

Very nice thanks Ataros!

Trigger has its own radius. It is set in FMB and is stored in a mission file, not in script file

I am trying to think universally, where scripts are independent of missions, so setting the radius in the FMB (while working perfectly yes) is not what I'm after

An airfield built by construction engineers (looking forward to D-Day) would not have a radius but it would be an Airfield object and a script could (hopefully) read and return the AirfieldEmergency distance. That could be a constant couple of miles perhaps and would apply to all airfields, permanent or temporary. We often create small airfields fairly close together for multiplayer dogfights - created in Il-2 I mean

Thanks for that info mate, no I'm not an admin over there but I will advise admin Dart that you're having problems and get back to you

Ming
Reply With Quote
  #4  
Old 09-25-2011, 09:51 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

In this example naryv creates a mission file by script. http://forum.1cpublishing.eu/showthread.php?t=23493

The file is called triggersFile. Actually it is a "section" file, i.e. a segment of a mission file.
Code:
    public ISectionFile triggersFile
Then script writes triggers into this file at the locations of frontline markers placed in the original mission manually.

Code:
                    keyTr = "changeArmy" + i.ToString()+"_1";                                // попутно на маркере делаем два триггера - для каждой стороны  
                    valueTr = " TPassThrough 3 1 " + strs[0] + " " + strs[1] + " 500";       // "TPassThrough 3" - триггер сработает при заезде в него наземки, "1" красной, strs[0] + " " + strs[1] координаты, "500"- радиус триггера
                    triggersFile.add(sectionTr, keyTr, valueTr);                             // сохраняем триггер в файле триггерной миссии
                    keyTr = "changeArmy" + i.ToString() + "_2";                              // то же самое для синей стороны
                    valueTr = " TPassThrough 3 2 " + strs[0] + " " + strs[1] + " 500";       
                    triggersFile.add(sectionTr, keyTr, valueTr);                             // сохраняем триггер в файле триггерной миссии
500 - is radius of the trigger
Reply With Quote
  #5  
Old 09-26-2011, 01:00 PM
Mington Mington is offline
Approved Member
 
Join Date: Apr 2008
Posts: 29
Default

Thanks Ataros, hugely interesting

The clue that 500 is the radius no wait it's a radius- is that an airfield radius I wonder?

There are two radii for each airfield

This is a command to assemble a string, can you decode the string please? Something like-

TPassThrough

Ahah pass through, passes through, crosses a radius...

Decoding, building a string-

TPassThrough 3 1

strs[0] (red or blue maybe, 'red' from Babelfish)

strs[1] appears to be a 'coordinate' from Babelfish

-it gets quite complicated eg-

double y; double.TryParse( strs[1], out y);

500

Maybe the whole assembled string is a coordinate somewhere on the map, with a radius around the coordinate of 500m

Yes that sounds reasonable, if we can now work out a test value for the cryptic strs[1]

valueTr = " TPassThrough 3 1 " + strs[0] + " " + strs[1] + " 500";

Maybe the TPassThrough trigger is documented somewhere, I'll see what I can find, the mysterious (without C# string-operation knowledge) coordinate bit is interesting

'TPassThrough: gets active' - does this mean that some Boolean variable is set to True or False? How to link to the emergency ambulance method I wonder, If NoBellsAreRinging CarryOn = True

Working left for inspection

Ming

Quote:
TPassThrough: gets active after a GroundGroup or Airgroup or Player entering the Area
http://forum.1cpublishing.eu/showthr...413#post339413
Reply With Quote
  #6  
Old 09-26-2011, 02:54 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

500 is trigger radius, not airfield.

TPassThrough 3 - is type of trigger, 3 is for ground units pass through.

1 or 2 is army (red/blue)

For airgroup passthrough the type of trigger will be different iirc. If you place various triggers in FMB and then save and open the mission file in notepad you will see how different triggers are recorded into a mission file: name of trigger type of trigger side coordinates radius. E.g.
Code:
[Trigger]
  110_down TGroupDestroyed BoB_LW_LG2_I.01 49
  bauf_down TGroupDestroyed BoB_RAF_F_FatCat_Early.01 46
  blu_bomb1 TPassThrough 1 BoB_RAF_B_218Sqn.07 275948 207553 2800
  bauf_up TPassThrough 3 1 271200 153942 300
  110_up TPassThrough 3 1 269976 153045 300
  red_bomb1 TPassThrough 3 1 270836 152088 300

strs[0] + " " + strs[1] - coordinates of the frontline marker parsed from the main mission file earlier.

Quote:
Originally Posted by Ataros View Post
Then script writes triggers into this file at the locations of frontline markers placed in the original mission manually.
Then in onTrigger method you check if the trigger is active, e.g.
Code:
    public override void OnTrigger(int missionNumber, string shortName, bool active) 
    {
       base.OnTrigger(missionNumber, shortName, active); 

          if ("your_trigger_name".Equals(shortName) && active) 
          { 
                // optional if you have an action set in the mission file
                AiAction action = GamePlay.gpGetAction("your_action_name");
                if (action != null)
                {
                     action.Do();
                }
                // include other operations here, e.g. loading submissions
                GamePlay.gpHUDLogCenter("your onscreen message");      
                GamePlay.gpGetTrigger(shortName).Enable = false;            
          }
    }
Reply With Quote
Reply


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 06:46 PM.


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