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 11-24-2012, 02:31 PM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default How to get mission file name?

How to get mission file name by script please?
__________________
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
  #2  
Old 11-25-2012, 05:47 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

Quote:
Originally Posted by salmo View Post
How to get mission file name by script please?
A sub mission file name that you are loading or the main mission file that is running from start?
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals
Reply With Quote
  #3  
Old 11-25-2012, 08:34 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Quote:
Originally Posted by hc_wolf View Post
A sub mission file name that you are loading or the main mission file that is running from start?
Get the main mission file that is running from start while it's running.
__________________
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
  #4  
Old 11-25-2012, 07:56 PM
theOden theOden is offline
Approved Member
 
Join Date: May 2011
Location: Sweden
Posts: 221
Default

This is how I do in my BoB5 campaign:

Quote:

if (GamePlay is GameServerDef)
{
GameServerDef gameServer = (GameServerDef)GamePlay;
ISectionFile missFile = gameServer.game.FirstMissionFile();
//int n = missFile.lines("FrontMarker");
//GamePlay.gpHUDLogCenter("FrontMarker " +n.ToString());
readMission(missFile);
};
if (GamePlay is GameSingleDef)
{
GameSingleDef gameServer = (GameSingleDef)GamePlay;
ISectionFile missFile = gameServer.game.FirstMissionFile();
//int n = missFile.lines("FrontMarker");
//GamePlay.gpHUDLogCenter("FrontMarker " + n.ToString());
readMission(missFile);
};


Edit: you might need this reference above public class Mission: [//$reference parts\core\gamePlay.dll]
Download and copypaste whatever if it helps: download
__________________

Last edited by theOden; 11-25-2012 at 08:01 PM.
Reply With Quote
  #5  
Old 11-26-2012, 10:34 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

Another easy way is just set a const string and ref that when you need to. This works if you have a .cs for that mission.
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals
Reply With Quote
  #6  
Old 11-26-2012, 03:45 PM
theOden theOden is offline
Approved Member
 
Join Date: May 2011
Location: Sweden
Posts: 221
Default

Used to do that but it forces you to predict where the user will copy/install your missionfile.
Instructions aren't often read nowadays.
This other way is more solid.
__________________
Reply With Quote
  #7  
Old 11-27-2012, 03:42 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Thankyou Oden. I've tried pasting the code below into the OnBattleStart. It gives errors & I can't figure out how to reference the gamePlay.dll even when I look at your examples.

Code:
if (GamePlay is GameServerDef)
{
GameServerDef gameServer = (GameServerDef)GamePlay;
ISectionFile missFile = gameServer.game.FirstMissionFile();
//int n = missFile.lines("FrontMarker");
//GamePlay.gpHUDLogCenter("FrontMarker " +n.ToString());
readMission(missFile);
};
if (GamePlay is GameSingleDef)
{
GameSingleDef gameServer = (GameSingleDef)GamePlay;
ISectionFile missFile = gameServer.game.FirstMissionFile();
//int n = missFile.lines("FrontMarker");
//GamePlay.gpHUDLogCenter("FrontMarker " + n.ToString());
readMission(missFile);
};
__________________
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
  #8  
Old 11-27-2012, 08:12 AM
theOden theOden is offline
Approved Member
 
Join Date: May 2011
Location: Sweden
Posts: 221
Default

Hmm, weird.
You do add the reference with double slash (looks like commented out to me)?

No idea what could be wrong.
__________________
Reply With Quote
  #9  
Old 12-04-2012, 04:08 PM
moggel moggel is offline
Approved Member
 
Join Date: Mar 2011
Posts: 70
Default

theOden,

I've been looking for a solution to get the (main) mission file too. I get an error message informing me the object implementing the "ISectionFile" interface is not marked as serializable (the error is thrown when invoking "ISectionFile missFile = gameServer.game.FirstMissionFile();").
Seems it can't be remoted from the sim AppDomain ...

Would you mind sending the whole .cs file?
__________________
Core i7 3930K @ 4.8GHz; 16Gb DDR3 (Vengeance); nVidia GTX580; OS disk: 150Gb 10000rpm; SIM disk: 300Gb 10000rpm; Windows 7 x64 Ultimate

Last edited by moggel; 12-04-2012 at 04:20 PM.
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:57 PM.


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