|
#1
|
|||
|
|||
Scripts collection
As some found the previous collection useful I added some recent missions including Repka ones, sorted files and translated some filenames into English.
The collection contains script examples and missions posted in the FMB forum section on 1C forum http://forum.1cpublishing.eu/forumdisplay.php?f=203 and on sukhoi.ru forum http://sukhoi.ru/forum/forumdisplay.php?f=192 I am not the author of the scripts or missions. Hope the files can be helpful to beginners starting to learn C#. Some useful links are listed in my sig. More advanced help can be always found on the above mentioned forums. Sorry, I did not save names of all the authors of the scripts and missions. Please let me know if you want your name to be included. If your mission or script is not included in the archive please post it below in the thread to keep it up-to-date for new C# learners. If you have questions on some particular scripts or a request for a new script please do not post them in this thread but start a separate thread with a question/request if you can not find a solution using forum search function. Let's keep this thread for publishing learning material only to make it easier to find script samples. upd. Please discuss in this thread http://forum.1cpublishing.eu/showthread.php?t=26527 EDIT: Important coop scripts: COOP script by naryv http://forum.1cpublishing.eu/showthr...537#post354537 COOP script by 41Sqn_Banks http://forum.1cpublishing.eu/showthread.php?t=28559 NEW version: http://forum.1cpublishing.eu/showthr...d=1#post469603 Last edited by Ataros; 10-15-2012 at 09:48 AM. |
#2
|
|||
|
|||
RESOURCES
Scripting tutorials by FG28_Kodiak http://translate.google.com/translat...rd%2C17.0.html FMB forums @ airwarfare.com http://www.airwarfare.com/sow/index....d=43&Itemid=54 @ sukhoi.ru http://translate.google.com/translat....php%3Ff%3D234 naryv (a member of the dev team) can be contacted there in English e.g. in Questions thread IL2 CoD Scripting evaluation by adonys http://forum.1cpublishing.eu/showthread.php?t=23959 FMB templates http://forum.1cpublishing.eu/showpos...3&postcount=22 http://forum.1cpublishing.eu/showthr...523#post395523 Last edited by Ataros; 03-01-2012 at 10:39 AM. |
#3
|
|||
|
|||
More samples
SayToGroup messages script by FG28_Kodiak http://forum.1cpublishing.eu/showthr...ght=saytogroup Script to Remove AI by TheEnlightenedFlorist http://www.airwarfare.com/sow/index....=539&Itemid=54 Start Airgroup Engines by FG28_Kodiak http://forum.1cpublishing.eu/showpos...02&postcount=4 Custom ingame Mission Menu by naryv http://forum.1cpublishing.eu/showthread.php?t=25941 Mission Menu and Ambulance by fearlessfrog http://forum.1cpublishing.eu/showthread.php?t=26112 Death/ESC-Ban / Prison Camp Script by FG28_Kodiak http://forum.1cpublishing.eu/showpos...66&postcount=7 Basic beginners script with comments http://forum.1cpublishing.eu/showpos...6&postcount=95 For complete beginners how the 1st Repka mission was created http://forum.1cpublishing.eu/showthread.php?t=21518 @ authors If you post a script sample or a scripted mission somewhere please crosslink from this thread for learning purposes as I did above. Many thanks from grateful students! Last edited by Ataros; 10-06-2011 at 10:57 AM. |
#4
|
|||
|
|||
Wow Ataros,
Very nice of you to gather up this collection. Thank you! |
#5
|
|||
|
|||
Great job. I know you're the kind of person who will try to keep this updated, so here's a sticky for you
|
#6
|
|||
|
|||
Quote:
I hope others help me as I can miss some valuable examples from this forum. On my side I will try to make sure everything worth mentioning that appears on sukhoi.ru is available here. If you post a script example please link it from this thread. But please keep discussion of each specific script in separate threads. upd. Please feel free to discuss in this thread http://forum.1cpublishing.eu/showthread.php?t=26527 Last edited by Ataros; 09-28-2011 at 08:55 AM. |
#7
|
|||
|
|||
Chat <stas, <tl, ....Interface
I found very useful lately IPlayer interface with all its goodies....
Here is example script to execute chat info in good old style check available commands: <stats , <guns, <kills, <stats<all, <tl, <te...etc That is just simple examples but You can convert lot of things from game to it.... If Any one is interested to give it a go on servers let me know if You experience any troubles with it... There is some delay on data read and some things are not working or are just not activated maybe Enjoy... Code:
//$reference parts/core/Strategy.dll //$reference parts/core/MySql.Data.dll //$reference parts/core/System.Data.dll //$reference parts/core/gamePlay.dll #region timer long Tick_Mission_Time { get; set; }// Sets the Mission Clock for Time Remaining in Mission. Random random = new Random();//Function for Randomising events Stopwatch stopWatch = new Stopwatch(); public string GetTimeElapsed() { string StringToReturn = ""; StringToReturn = ""; TimeSpan ts = stopWatch.Elapsed; // Format and display the TimeSpan value. string elapsedTime = String.Format("{0:00}h:{1:00}m:{2:00}s", ts.Hours, ts.Minutes, ts.Seconds); StringToReturn = StringToReturn + elapsedTime; return StringToReturn; } #endregion #region Iplayer stats public string GetDictionary<T>(Dictionary<string, T> ds) { StringBuilder sb = new StringBuilder(); foreach (string key in ds.Keys) { T d = ds[key]; if (sb.Length != 0) { sb.Append(", "); } //sb.AppnedFormat("[{0}]={1}", key, d); sb.AppendFormat("[{0}]={1}", key, d); } return sb.ToString(); } public string WritePlayerStatBase(Player player) { string Stats = ""; if (player is IPlayer) { IPlayerStat st = (player as IPlayer).GetBattleStat(); Stats = (String.Format("Take Offs: [{0}]; " + "Landings: [{1}]; " + "Deaths: [{2}]; " + "Bails: [{3}]; ", st.takeoffs, st.landings, st.deaths, st.bails)); } return Stats; } public string WritePlayerStatsGunnery(Player player) { string Stats = ""; if (player is IPlayer) { IPlayerStat st = (player as IPlayer).GetBattleStat(); if (st.bulletsFire != 0) { double accuracy = ((st.bulletsHit) / (st.bulletsFire)) * 100; Stats = (String.Format("Accuracy: " + accuracy + " %;" + " Bullets Fired: [{0}]; " + "Bullets Hits: [{1}]; " + "Bullets Air Hits: [{2}]; ", st.bulletsFire, st.bulletsHit, st.bulletsHitAir)); } } return Stats; } public string WritePlayerStatsKills(Player player) { string Stats = ""; if (player is IPlayer) { IPlayerStat st = (player as IPlayer).GetBattleStat(); Stats = (String.Format("Plane Kill Types: \"{0}\"; Planes Flown Types: \"{1}\";", st.kills, GetDictionary(st.killsTypes), GetDictionary(st.tTotalTypes))); } return Stats; } public string WritePlayerStatsBombs(Player player) { string Stats = ""; if (player is IPlayer) { IPlayerStat st = (player as IPlayer).GetBattleStat(); Stats = (String.Format("Bombs Fired : [{0}]; " + "Bombs Hit : [{1}]; " + "Bombs Weight : [{2}]; " + "g kills: {3}; ", st.bombsFire, st.bombsHit, st.bombsWeight, st.gkills[0])); } return Stats; } #endregion #region Time Left public string WriteTime_Remaining(Player player) { string Time_Remaining = ""; Tick_Mission_Time = ((32 * 60) * 240) - Time.tickCounter(); var Mission_Time = Tick_Mission_Time / 2000; TimeSpan Convert_Ticks = TimeSpan.FromMinutes(Mission_Time); Time_Remaining = string.Format("{0:D2}h:{1:D2}m:{2:D2}s", Convert_Ticks.Hours, Convert_Ticks.Minutes, Convert_Ticks.Seconds); return Time_Remaining; } public string WriteTime_Elapsed(Player player) { string Time_Remaining = GetTimeElapsed(); return Time_Remaining; } #endregion #region objectives public string WriteRedObjectives(Player player) { string Objectives = Objective_Total_Red; ; return Objectives; } public string WriteBlueObjectives(Player player) { string Objectives = Objective_Total_Blue; return Objectives; } #endregion #region chat public void Chat(string line, Player player) { if (GamePlay is GameDef) { (GamePlay as GameDef).gameInterface.CmdExec("chat " + line + " TO " + player.Name()); } } void Mission_EventChat(IPlayer from, string msg) { if (msg.StartsWith("<obj")) { Chat("Red Triggers: " + WriteRedObjectives(from as Player), from); //GamePlay.gpHUDLogCenter(new Player[] { from as Player }, "Time Elapsed is " + WriteObjectives(from as Player)); Chat("Blue Triggers: " + WriteBlueObjectives(from as Player), from); //GamePlay.gpHUDLogCenter(new Player[] { from as Player }, "Time Elapsed is " + WriteObjectives(from as Player)); } if (msg.StartsWith("<te")) { //Chat(Time_Elapsed(from as Player), from); GamePlay.gpHUDLogCenter(new Player[] { from as Player }, "Time Elapsed is " + WriteTime_Elapsed(from as Player)); } if (msg.StartsWith("<tl")) { GamePlay.gpHUDLogCenter(new Player[] { from as Player }, "Time Remaining is " + WriteTime_Remaining(from as Player)); } if (msg.StartsWith("<timeleft")) { GamePlay.gpHUDLogCenter(new Player[] { from as Player }, "Time Remaining is " + WriteTime_Remaining(from as Player)); } if (msg.StartsWith("<stats")) { GamePlay.gpHUDLogCenter(new Player[] { from as Player }, WritePlayerStatBase(from as Player)); } if (msg.StartsWith("<guns")) { GamePlay.gpHUDLogCenter(new Player[] { from as Player }, WritePlayerStatsGunnery(from as Player)); } if (msg.StartsWith("<kills")) { GamePlay.gpHUDLogCenter(new Player[] { from as Player }, WritePlayerStatsKills(from as Player)); } if (msg.StartsWith("<bombs")) { GamePlay.gpHUDLogCenter(new Player[] { from as Player }, WritePlayerStatsBombs(from as Player)); } if (msg.StartsWith("<stats<all")) { Timeout(1, () => { GamePlay.gpHUDLogCenter(new Player[] { from as Player }, WritePlayerStatBase(from as Player)); } ); Timeout(6, () => { GamePlay.gpHUDLogCenter(new Player[] { from as Player }, WritePlayerStatsGunnery(from as Player)); } ); Timeout(10, () => { GamePlay.gpHUDLogCenter(new Player[] { from as Player }, WritePlayerStatsKills(from as Player)); } ); Timeout(15, () => { GamePlay.gpHUDLogCenter(new Player[] { from as Player }, WritePlayerStatsBombs(from as Player)); } ); } } #endregion
__________________
Asus P6T V2 Deluxe, I7 930, 3x2 GB RAM XMS3 Corsair1333 Mhz, Nvidia Leadtek GTX 470, Acer 1260p screen projector, Track IR 4 OS ver5, Saitek Pro Flight Rudder, Saitek X52, Win 7 x64 ultimate |
|
|