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 04-08-2012, 11:40 AM
moggel moggel is offline
Approved Member
 
Join Date: Mar 2011
Posts: 70
Default Console Window

Me again...

I'm into scripting now and things are slowly starting to fall into place. I've experimented with triggers, got some planes to drop a wing and so on, all in the good name of exploration.

However, I really do miss the ability to write some output into a console window. I've seen several scripts that write to the normal System.Console and since it's possible to configure an "Info Window" to write "Console Output" I thought I had found the way to do it. However, the only stuff that goes into such an Info Window is the stuff written by the game engine it seems. I never see any of my own stuff ending up in there.

Is there some neat trick I need to know about in order to make use of System.Console? Why else do script authors bother to write to the System.Console?
__________________
Core i7 3930K @ 4.8GHz; 16Gb DDR3 (Vengeance); nVidia GTX580; OS disk: 150Gb 10000rpm; SIM disk: 300Gb 10000rpm; Windows 7 x64 Ultimate
Reply With Quote
  #2  
Old 04-08-2012, 11:54 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

you can write things into console with
example:
GamePlay.gpLogServer(null, "Teststring", null);

Explanation
void gpLogServer(Player[] to, string format, object[] args);
first argument is the addressat.
null = all can read it.
new Player[]{ player} = single player
or Array of players, which will get the message

second parameter is the Message itself.

third parameter are additional values.
null = none.
new object[]{ value1, value2}
example:
GamePlay.gpLogServer(null, "Red has {0} Points, Blue has {1} Points", new object[]{redpoints, bluepoints});
Reply With Quote
  #3  
Old 04-08-2012, 12:15 PM
moggel moggel is offline
Approved Member
 
Join Date: Mar 2011
Posts: 70
Default

Works perfectly! Thanks mate.

BTW: In C# you can initialize arrays implicitly:
GamePlay.gpLogServer(null, "Red has {0} Points, Blue has {1} Points", new[] {redpoints, bluepoints});

Cheers
__________________
Core i7 3930K @ 4.8GHz; 16Gb DDR3 (Vengeance); nVidia GTX580; OS disk: 150Gb 10000rpm; SIM disk: 300Gb 10000rpm; Windows 7 x64 Ultimate
Reply With Quote
  #4  
Old 04-08-2012, 08:31 PM
moggel moggel is offline
Approved Member
 
Join Date: Mar 2011
Posts: 70
Default Dynamic spawning?

Ok, another one:

I have found no way to dynamically create an AiActor and spawn it from my script. Is it not possible? If so, how does all those wonderful dynamic campaigns work?
__________________
Core i7 3930K @ 4.8GHz; 16Gb DDR3 (Vengeance); nVidia GTX580; OS disk: 150Gb 10000rpm; SIM disk: 300Gb 10000rpm; Windows 7 x64 Ultimate
Reply With Quote
  #5  
Old 04-08-2012, 08:43 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

No it's not possible directly but you can create a "in memory" mis - file. And load it to the main mission.

for example
Code:
internal ISectionFile CreateNewPlaneAtAirfield()
        {
            ISectionFile f = GamePlay.gpCreateSectionFile();

            f.add("AirGroups", "BoB_LW_StG2_II.03", "");
            f.add("BoB_LW_StG2_II.03", "Flight0", "1 2 3 4 5 6");
            f.add("BoB_LW_StG2_II.03", "Class", "Aircraft.Ju-87B-2");
            f.add("BoB_LW_StG2_II.03", "Formation", "VIC");
            f.add("BoB_LW_StG2_II.03", "CallSign", "30");
            f.add("BoB_LW_StG2_II.03", "Fuel", "100");
            f.add("BoB_LW_StG2_II.03", "Weapons", "1");
            f.add("BoB_LW_StG2_II.03", "SetOnPark", "1");
            f.add("BoB_LW_StG2_II.03", "Idle", "1");
            f.add("BoB_LW_StG2_II.03", "Skill", "0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3");
            f.add("BoB_LW_StG2_II.03_Way", "TAKEOFF", "298417.47 127327.45 0 0");

            return f;
        }
Then you can load it with
Code:
GamePlay.gpPostMissionLoad(CreateNewPlaneAtAirfield());
For more example take a look on
Tanks from narvy (added as atachment)
Attached Files
File Type: zip Tanks from naryv.zip (8.9 KB, 54 views)

Last edited by FG28_Kodiak; 04-14-2012 at 06:44 AM.
Reply With Quote
  #6  
Old 04-08-2012, 09:29 PM
moggel moggel is offline
Approved Member
 
Join Date: Mar 2011
Posts: 70
Default

Nice...

I think using a more or less textual declaration like that is even more powerful (and elegant) than pure code.

Thanks again!
__________________
Core i7 3930K @ 4.8GHz; 16Gb DDR3 (Vengeance); nVidia GTX580; OS disk: 150Gb 10000rpm; SIM disk: 300Gb 10000rpm; Windows 7 x64 Ultimate
Reply With Quote
  #7  
Old 04-14-2012, 05:42 AM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

Just note Kodiak,
There is a syntax error in this line in your example
ISectionFile f = gamePlay.gpCreateSectionFile();

Should be this, capital G
ISectionFile f = GamePlay.gpCreateSectionFile();

Oh from your example above I managed to create random generating flight including plane types, numbers and skills that is a response trigger loc to player and army specific. Still work in progress, but the basic script is working.
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 03:07 PM.


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