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
  #21  
Old 04-08-2012, 07: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
  #22  
Old 04-08-2012, 07:43 PM
FG28_Kodiak FG28_Kodiak is offline
Senior 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, 51 views)

Last edited by FG28_Kodiak; 04-14-2012 at 05:44 AM.
Reply With Quote
  #23  
Old 04-08-2012, 08: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
  #24  
Old 04-14-2012, 04:42 AM
Smokeynz Smokeynz is offline
Senior 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
  #25  
Old 04-14-2012, 05:45 AM
FG28_Kodiak FG28_Kodiak is offline
Senior Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Quote:
Originally Posted by Smokeynz View Post
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();
Corrected, thanks.
Reply With Quote
  #26  
Old 07-18-2012, 10:38 AM
SG1_Lud's Avatar
SG1_Lud SG1_Lud is offline
Approved Member
 
Join Date: Jul 2010
Location: Spain
Posts: 376
Default

Hi Kodiak, first of all many thanks for your presentation and introduction.


I have some questions, sorry if it is too basic but I am starting to learn.

Where can I know the definition of the object type ISectionFile, I mean, all the fields that contains the different data fos setting up the new actor?

My second question, the list of groups like BoB_LW_StG2_II.03?

and finally, the list of callsigns associated to their codes (in the case above, was 30)?

S!
Reply With Quote
  #27  
Old 07-18-2012, 11:34 AM
FG28_Kodiak FG28_Kodiak is offline
Senior Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Quote:
Originally Posted by SG1_Lud View Post
Where can I know the definition of the object type ISectionFile, I mean, all the fields that contains the different data fos setting up the new actor?
Make a little Mission, then open the mis file, there are all informations you need:

for example in mis file:
[AirGroups]
BoB_LW_KG3_I.01
[BoB_LW_KG3_I.01]
Flight0 1
Class Aircraft.He-111H-2
Formation LINEABREAST
CallSign 26
Fuel 100
Weapons 1
SetOnPark 1
Idle 1
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_LW_KG3_I.01_Way]
TAKEOFF 40064.00 20458.26 0 0

internal ISectionFile CreateNewPlaneAtAirfield()
{
ISectionFile f = GamePlay.gpCreateSectionFile();

f.add("AirGroups", "BoB_LW_KG3_I.01", "");
f.add("BoB_LW_KG3_I.01", "Flight0", "1");
f.add("BoB_LW_KG3_I.01", "Class", "Aircraft.He-111H-2");
f.add("BoB_LW_KG3_I.01", "Formation", "LINEABREAST");
f.add("BoB_LW_KG3_I.01", "CallSign", "30");
f.add("BoB_LW_KG3_I.01", "Fuel", "100");
f.add("BoB_LW_KG3_I.01", "Weapons", "1");
f.add("BoB_LW_KG3_I.01", "SetOnPark", "1");
f.add("BoB_LW_KG3_I.01", "Idle", "1");
f.add("BoB_LW_KG3_I.01", "Skill", "0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3");
f.add("BoB_LW_KG3_I.01_Way", "TAKEOFF", "298417.47 127327.45 0 0");

return f;
}

Quote:
My second question, the list of groups like BoB_LW_StG2_II.03?
Don't know if there is a list of all Airgroups available, simplest solution create a mission with all Airgroups you need, then open the mis file.

Quote:
and finally, the list of callsigns associated to their codes (in the case above, was 30)?
Callsigns are available from 0-35 (german, italian beginning with Adler, english with Acorn) but don't think there is a complete list present, never needed one

Last edited by FG28_Kodiak; 07-18-2012 at 11:38 AM.
Reply With Quote
  #28  
Old 07-18-2012, 12:10 PM
SG1_Lud's Avatar
SG1_Lud SG1_Lud is offline
Approved Member
 
Join Date: Jul 2010
Location: Spain
Posts: 376
Default

Many thanks Kodiak, very helpful.
Reply With Quote
  #29  
Old 08-21-2012, 02:46 PM
WhiskeyBravo's Avatar
WhiskeyBravo WhiskeyBravo is offline
Approved Member
 
Join Date: Apr 2010
Posts: 8
Default

Excellent tutorial for a total C# noob like me.

Any signs of the next lessons yet?

Many thanks,

WB.
Reply With Quote
  #30  
Old 08-23-2012, 05:27 AM
FG28_Kodiak FG28_Kodiak is offline
Senior Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

After my vacation i will publish the next lessons
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 01:08 AM.

Based on a design by: Miner Skinz.com

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