![]() |
Online War - FMB scripting
1 Attachment(s)
I'll just copy my post from Syndicate forums:
Please have a look at post #73 from a developer here. http://translate.google.com/translat...964%26page%3D3 Corrected translation: Quote:
1) kill all bots after a player exits an aircraft for better stability and much more important(!) 2) create any submissions for current mission loading every 10, 15, 20 and 30 minutes, including - programmed bombing runs on England (and France ) - tank battles - armored cars attacking airfields - ship convoys (bombing/intercepting submissions) - free hunters surprisingly attacking on takeoff - submarines sinking convoys (with 3rd party addons :grin: ) - etc, etc. Basically any mission from Offline Campaign can be taken online. Another useful thread on scripting and triggers. http://translate.google.com/translat...hp%3Ft%3D68369 upd. New forum section on FMB and scripting http://translate.google.com/translat....php%3Ff%3D234 Lets make some small missions consisting of 3-4 submissions first to simulate what we had in IL-2 online wars like VEF or ADW. File with sample mission from developer attached. Let the full-scale war begin! |
had a look at that this morning.
1. works a treat. spawn, respawn, first spawn plane immediately gone. 2. didn't work. From what I could see, it actually tries to load a new mission. Perhaps it is possible to load a mission into a mission, doesn't seem desirable, but then maybe i need more coffee. Great finds again though Ataros. :) |
Quote:
In original Il-2 when mission objectives are met you server had to stop the mission to load a new one. If you were flying in the air at this moment you would have to start again on the ground. Now in CoD you can continue flying when "mission is changing". Say you have a mission to stop enemy tanks from taking an airfield. Then you have options 1) If you are successful this triggers loading next objectives: - for your tanks advance to next city and for your aircraft to cover them. - for enemy to bomb your airfield 2) If you fail to protect your airfield the objectives will be different: - for you to cover bomber strike on enemy tank factory - for enemy to escort transport aircraft to the newly taken airfield. New objectives (together with new aircraft, tanks, ships, etc.) will be loaded into current mission while you are still flying in the air. You can prepare say 20-50 such small sub-missions and they will rotate on your server depending on results of previous missions set as triggers. Several sub-missions may overlap in time. And this is just one possibility, there are much more of them. Atm you may wish to try adding sub-missions of Stukas attacking shipping in the channel loading into your current mission every 20 minutes. ...and Beaufighters attacking blue airfields every 30 minutes, and... the possibilities are endless. I will try to do it myself on Monday probably as i am currently away from my gaming PC. |
Ah, thanks for explaining the concept.
Part of the confusion was that in 2.mis, it contained information for [PARTS], [MAIN] etc.. (set as a full mission) also, and call me a doughnut, I had the tmp file in multi folder, not just missions. *facepalm* So most the fluff can be removed and in that instance just have the airgroup/waypoints. It does work. I need that caffiene in the morning. |
These things looks really promising!
|
Thank you very much for sharing.
I'm using it on my server, and it's really cool not to see thousands of IAs flying without ammo or standing on the taxiway. |
Great find!!!
now if i can only script the dog to walk himself in the morning and not pester me :) S! |
Quote:
The original poster of the error also noted it happend after the Chanel map has been running for a while. S! |
I must be doing something wrong...i have added the script to one of my maps and there is even a .cs file of the same name but when i tested it and spwned four planes they just took off like they always do :( is the file below correct?
Quote:
|
Quote:
Why do you expect the AI aircraft not to take off? If basic40c.mis tells them to take off, they will. upd. All events you can use in a mission script. Sorry for jpg format. http://www.sukhoi.ru/forum/attachmen...9&d=1303038770 upd.2 And a good thread on triggers here http://forum.1cpublishing.eu/showthr...builder&page=2 |
Quote:
|
1 Attachment(s)
Sample use of triggers to load a new mission into current one.
Quote:
It does not work on static objects completely as intended but works for aircraft I think. File attached |
Spawn/despawn script is kinda "incomplete" and causes unwanted behavior: plane instantly disappearing on bail out or plane disappearing when single member of crew leaves the plane (i.e. one of bomber gunners leaves the plane) while other members are still inside.
Additionally checking if plane is manned before "killing" it should help with multicrew plane despawns. Bail out despawns probably will be a lot tricker. |
Attention mission makers! A person from dev team told we can put AA guns on oil tankers at other forums. This means we can have some sea battles going on in the channel )) or coastal airfields attacked from sea.
Can not try it myself yet. |
Quote:
|
Script for despawning planes without humans inside. Multicrew friendly.
Code:
using System; |
WOW! Thanks a lot!!!
|
Quote:
the selection will be under cargo :) |
thank you Zalty does this replace the original script?
|
Quote:
|
Quote:
|
I have edited my despawn script post and added additional "null" check to prevent some possible error.
|
Quote:
edit : It seems there is one more "}" than needed, but works flawlessly :) |
More experiments with scripting. New version of Battle of France mission here http://forum.1cpublishing.eu/showpos...1&postcount=12
|
bottom of that script says timeout 1 which is one sec. set that to 60 and your planes will despawn after 60 sec which is enough time for an aircraft to hit the ground when you bail and despwan ;)
|
Won't that leave the AI in control for 60 seconds, rather than having it glide into the ground? Really, the code should be ran instantly, and it should disable AI control instead of simply removing the aircraft--assuming that's currently possible.
|
This sample script made for fun disables player controls. Maybe someone can use it to disable AI controls for say 10 minutes before destroying AI
Code:
using System; |
Quote:
Yes, you can disable the controls, but trimmed plane can happily fly even without working controls. What I want to say: disabling the controls does not guarantee a quick crash. Extending despawn timeout can lead to great clutter, i.e. when player presses "Create" multiple times. |
The aim should be, imho, when a player bails from a working plane and he tries to create a new plane, he find himself in that "abandoned" plane, as long as it is still flying :-D
And from a realism point of view, it is realistic that planes with dead crews were hunted and so live planes could escape. I dont think that happens so often to have a felt influence on playability. |
Quote:
Quote:
|
Thanks for the answer ZaltysZ,
the first part of my post was just wishful thinking, pointed at players which abandon a working plane so they dont have to fly home and land. And for your second point, i think i saw part of the problems in form of fata-morgana-bomber-raids, which disappear as you come closer to them, on the syn-server. |
Quote:
|
In my opinion this is what we need:
Quote:
|
About bombers. Doesn't the problem dissappear if their last waypoint is "landing"?
|
yes, but...
I would think so... But landing takes time ...
I just want them to disappear once they get back over 'friendly' areas |
Quote:
|
Quote:
This is an example of my mission that runs on Repka server atm. http://forum.1cpublishing.eu/showpos...8&postcount=24 I have no idea what I should put in the .cs file to make "Destroy() method of AiAircraft inside OnTaskCompleted(). " work. Another thing is that aircraft should fall to ground before it is destroyed with some timeout ideally as described here http://forum.1cpublishing.eu/showpos...1&postcount=33. |
So have modified ZaltysZ script, with some damage ;), fastes way to ground is to disable all controlls and the engines.
Code:
using System; |
FG28_Kodiak, thank you so much! i will try it tonight.
|
Guys, don't bother with engines, kill fuel pump instead (all engines should stop). :-P
By the way, what will happen if player presses "Create" multiple time? There will probably be lots of planes on ground without working controls and engines. There is handy method IsAirborne(). If it returns false, plane should be destroyed immediately; if it returns true, only then disabling of controls should commence. |
Disable fuel pump doesn't help, the engines wouldn't stop. Fuel pump is only nessesary at altitudes above 2500m.
You are right IsAirborne() can be very usefull in this script. Corrected Version ;) Code:
using System; |
Thanks again!
Copied to my mission script. Is it OK? Code:
using System; |
More to learn...
Quote:
I have noticed that the time counter isnt 100% accurate - the planes appears a couple of minutes soon than what they should... bug? Ross |
Destroys crashlanded aircraft in 5 seconds ))
Code:
public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft) Quote:
if (Time.tickCounter() % 72000 == 72000) is wrong probably. |
What the?
someone help me here :S
Main map starts at 05:00 - like the rest of the "sub" maps Code:
using System; He 115 starts at 05:09 - 1 min fast Blenheim starts at 05:13 - 7 min fast!! He 111 starts at 05:18 - 3 min late?! Whats going on :S :S :S |
Quote:
Code:
if (Time.tickCounter() % 72000 == 0) |
Some timings ive got
1 Attachment(s)
Check attachment...
Is the last comment for me or :S |
Quote:
Code:
if (Time.tickCounter() % 72000 == 71999) |
The % is the modulus operator in C# (C, C++ and others)
http://en.wikipedia.org/wiki/Modulo_operation |
Quote:
Code:
if (Time.tickCounter() % A == B) A = 30 * amount second of seconds you want to repeat something B = 30 * amount second you want to offset (delay) from beginning of mission I suppose you want to delay something by 72000 and not by 71999 (although the difference is only 1/30s). So: Code:
if (Time.tickCounter() % 72000 == 0 && Time.tickCounter()-72000==0) |
Quote:
|
Regarding ticks.
1) naryv (dev) said that 30 ticks are around 1 second. Because of that "around", you can get errors. :) 2) No one said that single tick always takes the same amount of time (if so, lag can screw your timing badly). |
Quote:
please ;) |
30 ticks ~ 1 sec
Tested this. Works most of the time I think )) Thanks to all for scripts! Code:
using System; |
Valuable note from a developer here
Quote:
ATM we have some knowledge on the following: - triggers to check if mission objectives are complete - scripts to load new mission objectives into a current mission based on triggers - simple interface to give players new objectives GamePlay.gpHUDLogCenter Say if enemy tanks are destroyed in a mission, we can move frontline, change one airfield spawnpoint from blue to red and load next mission objectives. But a good interface mod would be extremely useful to show different briefings based on airfields selected, to allow relocating airgroups from airfield to airfield, manage fuel resources, routes of supply convoys, voting for a commander, etc. There is a great game-mode mod called "Warfare" in ArmA2. I hope we can create something similar and better. |
This sample to use Time.current()
count in seconds from started battle. Code:
private double nextMsgTime = 0; |
These all are very useful posts, in fact I have borrowed a bit of the script for my own mission that I hope will appear on the Syndicate Server soon.
I have a few questions as I know nothing about these scripts 1) If I want the text that comes up with the 'GamePlay.gpHUDLogCenter' command to show to only one team, can this be done and if so how? 2) I have noriced that using these scripts with the spawn removal stops the in game action and trigger events working where it spawns an aircraft. Is there a way of using both? Keep up the good work, and thanks for your help in advance. |
Quote:
2) Did not quite get what you mean by "spawn removal" and "trigger events working where it spawns an aircraft". Could you clarify please. |
New bits of code from devs.
Shows mission objectives to players depending on side and aircraft type (fighter/bomber). "hitler caput" lol Code:
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex) |
Hi Ataros,
Hopefully I will be a little more clear this time! I used the in-game script system using a Trigger to cause an Action to happen. Eg in my missions if a plane I select is shot down, it triggers the spawn of another plane. EDIT>Script Trigger: Walrus 1= Target Group destroyed (Walrus flying boat selected) Action: Walrus 1= Air spawn group (second walrus selected) This system works in single player, so that when the first walrus is shot down a second spawns at a preselected place. However, when I include the scripts you guys have been developing to despawn empty aircraft (for use online) the ingame script above does not work in either single or multiplayer. Any ideas what i am doing wrong? |
I was just looking at the .mis files in notepad...
Example Code:
[PARTS] Also looks like we can edit aircraft here much "easier"... if you know what your doing! :D NOTE - not at home to test it myself lol Ross |
Quote:
|
Argh german language:
Das bomber! -> (singular) Der Bomber! (plural) Die Bomber! Das jager! -> (singular) Der Jäger! (plural) Die Jäger! Next time i fly a bombing raid over the translator. :grin: AircraftType could be: AmphibiousPlane BNZFighter Bomber DiveBomber Fighter Glider HeavyFighter JaBo SailPlane Scout Sturmovik TNBFighter TorpedoBomber Transport UNKNOWN So if you are in a Ju87 or Ju88 there should be Bomber or DiveBomber to Show that you are in a Bomber Code:
if ((aircraft.Type() == AircraftType.Bomber) || (aircraft.Type() == AircraftType.DiveBomber)) // if Bomber or Divebomber |
Quote:
|
Quote:
I think you can shut server down with .cmd file. |
Start mission... plays... End mission... Start mission again... etc etc
Well as you know we both start a mission through the script, but i want to know if we can stop it... as we had already discused :S
But as we dont know how to do this via scipt, i was woundering is we could do it through the .mis file... |
Yeah, I would like to know this as well. The way the MP missions are designed are amazing (with missions able to be loaded into missions etc.) but, for instance, lets say you want an ongoing war, how are you going to stop it from going into the night?
Or could you just load a mission and make the sun appear again out of nowhere, without missing a beat, while others are playing at the same time? More testing I guess :) |
I wish I were a part of the dev team and know all the answers :grin:
Meanwhile another script destroying abandoned planes from ru forums. Tell me what you think of it. Code:
using System; Quote:
Quote:
Quote a Dev: Quote:
My guess is you can switch server off, but you can not unload a mission as you can not unload life as it gives birth to smth :grin: This is not a game this is real life simulator. |
Problem with exploding fuel tanks could be that other players also get damaged.
|
Hi Guys, im having some fun with this scripting business and have finally got a script that works, however I could do with some help with the timing commands:
I know that 1800 ticks = 1 minute but im not entirely sure what these two number cause to happen. From my script file: if (Time.tickCounter() % 126000 == 18000) When this counts down a mission is launched but im unsure as to the significane of the two timings: does the 126000 give the time between each repeat operation of the operation? I have found the second number, 18000 in this case appears to set the time for the first operation. Is this correct? SO, if i want the operation (in this case a mission starts within themain mission and planes spawn) to repeat every 2 hours, but the first operation is 10 minutes after the main mission begins would this be correct? if (Time.tickCounter() % 216000 == 18000) Thanks! |
1st number = repeat i.e if it was 108000 - the map/ mission should load every 1hour...
2nd number = start time i.e. if it was 18000 = the map/mission should start within 10 minutes of the game start, or repeat interval... But i dont think it works 100%... but as i have been told 1800 ticks "roughly" equals a minute... |
Quote:
I actually did some offline testing and set the timings to minutes adn sped things up! It appears to work roughly as you say... it will do for now! |
Quote:
|
AI damage & destory
Ive tested and tested... its not working :S
Help ! |
Just to have it all in one thread
Quote:
|
Quote:
However we should try: 1) make a mission with internal triggers without script 2) make a mission with script that loads the first mission in. 3) load more missions when needed. I will not have time to try this for a couple of days however (( Alternatively you can program all the triggers in a script by hand. Check links in the 1st message of this thread for examples. e.g. Code:
/ / $ Reference Campaign.dll Code:
using System; Code:
using System; http://translate.google.com/translat...hp%3Ft%3D68369 Quote:
Would you tell us what exactly you are trying to do and what does not work. Run my script it loads missions on timing more or less. Does not always destroy planes on the server however. |
I have pretty much copied and pasted your scripting ...
I always right click and compile to see if the script is OK, which it is ... So when ever I try and test it ... My ai bots are still flying At the current time I am in the middle of making a new online map with less 'repeat mission' loading, and more internal triggers But as you have posted above, I will need script for 'triggers' to flash messages on the screen about incoming planes etc ... I shall give the above a try when I'm on my pc later! |
Quote:
The issue reported to the devs already. Try the second script I copied from sukhoi.ru. Just uploaded a new mission into missions thread. http://forum.1cpublishing.eu/showpos...3&postcount=31 |
Do you try ABattle and not AMission?
|
Quote:
public class Mission : AMission to public class Mission : ABattle Should I? Every script I have seen uses AMission I think. Code:
// v.1.6.14 |
I am not sure it is possible to overload ABattle without creating your own add-in.
|
Hm just try and error and see what happen, ABattle has mostly the same methods than AMission. The only examples i know are from the campaign directory and are only single missions.
I wish there where a documentation about scripting. :rolleyes: |
Quote:
Code:
using System; |
HI Squoag,
I tried your version in nthe post above and it despawned the plane if I changed from pilot to a gunners position. I tested this on my own 'server' and in single player. Obviously in MP this would not be desireable! |
Hi Flashman,
Are you 100% sure that you used the second code block in my post and not the first? What you're seeing is very symptomatic of the first code block in my post. I put it there as a before/after for the original author but perhaps I should mark it more clearly... |
Quote:
Will test on Australian Skies tomorrow EDIT: This works for me, thanks No457_Mako & No457_Squog, has helped with server stability. Ran 3 maps no worries, we were having issues with loading new maps before this Worked with Position swap ONLINE in the bf 110 as well. Matoni |
Quote:
Im pretty sure I tried both but truth be told you have me wondering now.... I will try this again when I get the time and see if it works for me. Please note: i tried this on my own 'server' not on the Syndicate server. |
Script to destroy actors in a mission (e.g. before loading new one to server).
This kills mission (or submission) own actors. To kill all actors 'living' on a server (e.g. loaded by other missions) remove the lines put in blue color. Code:
foreach (int army in GamePlay.gpArmies()) May need some testing and fine-tuning. |
~S
I would appear Beta 4 breaks all of these kill actor scripts... well it does 4 me |
Quote:
|
And it reintroduces the stutters online which I kinda missed .....NOT!....lol. Rolled client back to 14305 will try on Matoni's OGN later. :)
|
Quote:
Code:
// v.1.6.17 trig NEW |
Sample shows moving frontline and changing spawnpoints from red to blue and vice versa based on trigger (flyby above an airfield).
Can someone program a small 3 airfields battle based on it? Say a middle airfield becomes red or blue based on which tanks remain alive after taking the airfield. Then spawn new groups of tanks in say 20 minutes for a new round. Code:
using System; |
... my head hurts trying to understand this..:grin:
Does anyone fancy writing a fuckwits guide to all this, err sorry i mean a dummies guide? It would be very much appreciated, i'd buy the 1st round or virtual beers! I'm keen to create MP missions but trying to gain the level of understanding needed from these forums and google translations is rather daunting. And i suspect waiting for an official manual would be foolish, considering the flight manual produced. But thanks for all the help provided here, it is appreciated.. just a bit confusing for a new mission builder. |
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:
/**** |
Ataros - http://www.barmans.co.uk/productimg/19450.jpg
Thanks for all the info here.. i'll try and get my head around this over the weekend, your help is very much appreciated. |
The above script runs on Repka DS #1 server ATM loading 5 smaller missions into main mission with various time-cycles. Check it out.
|
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. |
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..:confused: |
Quote:
Runs on Repka server. I think it works (not 100% sure though of cause :grin: ) . |
All times are GMT. The time now is 02:27 PM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.