![]() |
|
#1
|
|||
|
|||
![]() Quote:
This is a sample script to create a small 'campaign' containing a main mission and 3 sub-missions. Copy this script to Notepad and save it as sample.cs into the same folder your mission will be located, e.g. C:\Users\%user%\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\My_mis1\ Scripts have to be saved with .cs extension and have the same name as the main mission. Create and edit your main mission in FMB. In this example the main mission name should be sample.mis because the script name is sample.cs. Make sure you have both sample.mis and sample.cs in the following directory (on the drive you have your Documents folder): C:\Users\%user%\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\My_mis1\ Create and edit 3 missions you want to be loaded into the main mission with FMB. Put these 3 missions in the same directory, name them as mission1.mis, mission2.mis and mission3.mis. That's it. In case you saved your mission files into other directory than Multi/Dogfight/Dogfight/My_mis1/ , then edit 3 filepaths in this file. e.g. the line GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/My_mis1/mission1.mis" contains the path to the 1st sub-mission. * Change message text after GamePlay.gpHUDLogCenter commands to whatever you like (usually mission objectives and their location on the map). The text in this example is visible to both sides for simplicity. You may wish to download and use Microsoft Visual Studio 2010 Express to open and edit .cs files. It is free and makes .cs files easy to read and understand. Download link http://www.microsoft.com/express/Dow...2010-Visual-CS All text after // marks are comments describing what the script does. You may play your mission in MP or as a SP mission if you create a passworded server. I hope to put up some missions using this script to Repka server soon. Code:
/**** * Brief startup guide to scripting. * This is a sample script to create a small 'campaign' containing a main mission and 3 sub-missions. * * Copy this script to Notepad and save it as sample.cs into the same folder your mission will be located, e.g. * C:\Users\%user%\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\My_mis1\ * Scripts have to be saved with .cs extension and have the same name as the main mission. * Create and edit your main mission in FMB. In this example the main mission name should be sample.mis because the script name is sample.cs. * Make sure you have both sample.mis and sample.cs in the following directory (on the drive you have your Documents folder): * C:\Users\%user%\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\My_mis1\ * Create and edit 3 missions you want to be loaded into the main mission with FMB. * Put these 3 missions in the same directory, name them as mission1.mis, mission2.mis and mission3.mis. * That's it. * * In case you saved your mission files into other directory than Multi/Dogfight/Dogfight/My_mis1/ , than edit 3 filepaths in the script file. * e.g. the line GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/My_mis1/mission1.mis" contains the path to the 1st sub-mission. * * * Change message text after GamePlay.gpHUDLogCenter commands to whatever you like (usually mission objectives and their location on the map). * The text in this example is visible to both sides for simplicity. * * You may wish to download and use Microsoft Visual Studio 2010 Express to open and edit .cs files. It is free and makes .cs files easy to read and understand. * Download link http://www.microsoft.com/express/Downloads/#2010-Visual-CS * * All text after // marks are comments describing what the script does. * You may play your mission in MP or as a SP mission if you create a passworded server. * Have fun! and S! from 3GIAP * * Feel free to delete all the comments above and including this line from this file. ****/ using System; using maddox.game; using maddox.game.world; using System.Collections.Generic; public class Mission : AMission { public override void OnTickGame() { // loads the 1st sub-mission in 10 min and repeates it every 60 min. if (Time.tickCounter() % 108000 == 18000) // 108000 = 60 min repeat. 18000 = 10 min delay. // pls. note!!! the 1st figure above must be always larger than 2nd! { GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/My_mis1/mission1.mis"); // prints message on screen after mission load GamePlay.gpHUDLogCenter("Hello, world! Mission1.mis loaded!"); // prints message on screen in 10 minutes / 600 seconds double initTime = 0.0; Timeout(initTime += 600, () => { GamePlay.gpHUDLogCenter("10 minutes into the 1st mission! Wow! It works!!!"); }); // prints message on screen in 5 minutes / 300 seconds Timeout(initTime += 300, () => { GamePlay.gpHUDLogCenter("Wholy s.. it works!!!"); }); } // loads the 2nd sub-mission, etc. the same way if (Time.tickCounter() % 108000 == 54000) // 108000 = 60 min repeat, 54000 = 30 min delay. { GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/My_mis1/mission2.mis"); GamePlay.gpHUDLogCenter("Mission2.mis loaded!"); double initTime = 0.0; Timeout(initTime += 600, () => { GamePlay.gpHUDLogCenter("Mission2 10 min message!"); }); Timeout(initTime += 300, () => { GamePlay.gpHUDLogCenter("Mission2 15 min message!"); }); } // loads the 3rd sub-mission if (Time.tickCounter() % 108000 == 90000) // 60 min repeat, 50 min delay { GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/My_mis1/mission3.mis"); GamePlay.gpHUDLogCenter("Mission3.mis loaded!"); double initTime = 0.0; Timeout(initTime += 600, () => { GamePlay.gpHUDLogCenter("Mission3 10 min message!"); }); Timeout(initTime += 300, () => { GamePlay.gpHUDLogCenter("Now it really works! You are a genius! Have fun!"); }); } } } Last edited by Ataros; 10-14-2011 at 08:03 AM. |
#2
|
|||
|
|||
![]()
Ataros -
![]() Thanks for all the info here.. i'll try and get my head around this over the weekend, your help is very much appreciated. |
#3
|
|||
|
|||
![]()
The above script runs on Repka DS #1 server ATM loading 5 smaller missions into main mission with various time-cycles. Check it out.
|
#4
|
|||
|
|||
![]()
Ataros,
Thanks for all the info. We'll see if the latest kill actor script works with beta 1. We found the latest beta to be far to unstable for the server and have reverted back. |
#5
|
|||
|
|||
![]()
What is the best script to remove empty & crash landed planes.. there seem to be many versions knocking about.
I've heard there are issues with these scripts & the latest patch.. some enlightenment would be much appreciated. Looking at bob & bof 1.6 neither seem to have these scripts added.. ![]() |
#6
|
|||
|
|||
![]() Quote:
Runs on Repka server. I think it works (not 100% sure though of cause ![]() |
#7
|
|||
|
|||
![]()
Great thread on searchlights and adding AA to trains and trucks
http://forum.1cpublishing.eu/showthr...t=22740&page=2 |
![]() |
|
|