Stonehouse Posted October 2, 2014 Posted October 2, 2014 Yes you are 100% correct. Found this post from about 12 months ago that relates directly to the issue. http://forums.eagle.ru/showthread.php?t=101399 Good one less bug to hunt, thank you. I will note this in the readme of the script with the reference.
Stonehouse Posted October 2, 2014 Posted October 2, 2014 Ok Grimes's Mist fix this morning has sorted out the country issue I was having. So going to tidy up my wip version and then test it for a couple of days to make sure I'm not releasing something blatantly broken on you blokes and try to write up a proper piece of doco for using the script (although I might put that out later) and then upload it here. Probably Saturday night or Sunday during the day my time for the script unless I find a problem. Changes in the upcoming version are: Airbases now picked up from the map so no editing of the script for that Countries now picked up from the template aircraft so no editing of the script for that Added helos to the intercept processing so CAPs and GCI will be sent to attack helicopters should they be detected. @Hijack, started work on your safezone script, got a prototype coded except for the group name recognition bit but not unit tested yet. Cheers, Stonehouse
Rivvern Posted October 2, 2014 Posted October 2, 2014 Lovely improvements! [sIGPIC][/sIGPIC] We are looking for Swedish members! http://www.masterarms.se
Stonehouse Posted October 3, 2014 Posted October 3, 2014 Test runs show that the script is generally working but I'm getting problems after the first wave or so of CAPs or perhaps after the first GCI flight. Anyway about 30-40 mins into things. No sure but the symptoms are that flights stop spawning so obviously there is a bug to chase down. Sorry guys looks like it may not be as soon as hoped.
LFCChameleon_Silk Posted October 3, 2014 Posted October 3, 2014 never is with scripting! always something broken to fix up. take your time Stonehouse don't get burnt out.
HiJack Posted October 3, 2014 Posted October 3, 2014 Test runs show that the script is generally working but I'm getting problems after the first wave or so of CAPs or perhaps after the first GCI flight. Anyway about 30-40 mins into things. No sure but the symptoms are that flights stop spawning so obviously there is a bug to chase down. Sorry guys looks like it may not be as soon as hoped. Make sure you dont do the same blunder as me then Stonehouse! Check and recheck red and blue airfield and also the zone names. Your explanation looks like the same trouble I had. :music_whistling:
Sauerkraut Posted October 3, 2014 Posted October 3, 2014 You can take a look at the script and mission I attached below. There I defined an area in which all SAM missiles are destroyed if they are getting to close to an player aircraft. The script checks every launched SAM if it gets close to a player and lets the missile explode. At the same time it marks a hit with a smoke in the air. So basically the function is the same, you just need to create an table with the AirToAir missiles and define the area with waypoints of the group. You also need to take out the text messages. I don´t know if this works with guns also, but at least Air To Air missiles would be just smoke and sound in this area. Just an idea. :book: Many thanks. This is very good for my trainingsmission.
dooom Posted October 5, 2014 Posted October 5, 2014 im looking forward to this one Stonehouse! the DoW group owes a debt to you for the scripts we use. Thanks! ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 "This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL
Stonehouse Posted October 7, 2014 Posted October 7, 2014 just an fyi that I'm still trying to debug the problem. Thought I'd found it but it still didn't fix the issue. Sorry Dooom haven't gone further with your safezone script as when I get time I'm trying to get the GCI script sorted. 1
Stonehouse Posted October 13, 2014 Posted October 13, 2014 Unfortunately still not version with updated functionality for airbases and countries that remains wip but uboats found a typo bug today in the last released version that impacted planes being RTB'd by the script. It's a very small fix so I have done the change and below is a new interim version until I can get the one I've been working on done and bug free. Cheers, StoneyGCICAP20141013.lua
SNAFU Posted October 13, 2014 Author Posted October 13, 2014 (edited) Thank you. :) I edited the first post and uploaded this version. Edited October 13, 2014 by SNAFU [sIGPIC][/sIGPIC] Unsere Facebook-Seite
Stonehouse Posted October 17, 2014 Posted October 17, 2014 (edited) Finally ! Ok I hope I've sorted all the known bugs out in this new version. MIST 3.5.37 or later is required. Main new features: No longer need to edit script to change countries. Countries will now be picked up from template aircraft for CAP and GCI. Therefore within the limits of the countries chosen for the mission this gives 8 possible countries a side. No longer need to edit script for airbases. Simply select the coalition of the airbase and place a trigger zone over the airbase just big enough to encompass it's runways etc and name the zone exactly as per the name of the airbase on the mission editor map. NOTE DO NOT TURN ON AN AIRBASE UNLESS YOU ALSO ADD A TRIGGER ZONE FOR IT AS IT BREAKS THE SCRIPT. Helicopters are now interception targets. Corrected some issues including the RTB typo bug, bug which prevented player aircraft being interception targets (thanks uboats) and as part of this correction removed player aircraft from the list of available interceptors from the scripts viewpoint (mucks up the accounting for number of active intercepts) Also investigated AWACs usage. The isTargetDetected function does not work for AWACs only ground and ship based radars so AWACS do not work as radars for the script as now. As a result I removed comments re: AWACs but did leave some commented out code for future enhancements in this area. Did a little bit of work moving the script towards making it easier to select additional radar units but essentially you won't really notice this. By the way the bug causing my headaches was one in the mission NOT the script after all. It was caused by me accidently having a space after one of the GCI template aircraft pilot (unit) names ie instead of "__GCI__blue1" I had "__GCI__blue1 " and this caused the blue side of things to fail after the initial CAPs were spawned. Please be careful that you don't copy my mistake as it is exceptionally hard to find this is the cause of your problems. So future enhancements on my list are: using a parameter to make the script GCI only rather than CAP & GCI might look at a parameter to make the players not be interception targets if people think this is useful for their mission design needs. Revisit the radar side of things so that ship, ground and AWACs can be used/ Eventually hopefully change things so radar types are dynamically picked up from the mission rather than having to edit the scripts. Investigate whether carriers could be set up as airbases for the purposes of this script. Not sure if the US one is functional but believe that the Russian one is. Adding the recon and CAS/anti ship flight functionality so that flights are launched against ground/naval targets picked up by recon Seeing if I can get CAP and GCI flights to refrain from crossing borders if their target goes back into friendly territory Improve error handling simple logistics to limit the number of CAP/GCI spawns available. ie allocation of unit pools, decrement on t/o and increment on landing. No safe landing = reduction of pool permanently. Fix airbase logic so it's possible to have an airbase assigned to a coalition but not assigned for GCI CAP script use. ie a Human only base. GCICAP20141017.luaGCI CAP script demo.miz Edited October 19, 2014 by Stonehouse spelling; airbase note, forgot one of my enhancements, airbase fix 1
Rivvern Posted October 17, 2014 Posted October 17, 2014 Great Stonehouse! Looking forward to test it. [sIGPIC][/sIGPIC] We are looking for Swedish members! http://www.masterarms.se
HiJack Posted October 17, 2014 Posted October 17, 2014 I will start updating my mission projects today also! Great work Stonehouse :thumbup:
Stonehouse Posted October 17, 2014 Posted October 17, 2014 Hijack, going to have a break from scripting for a day or so but then I'll go back to your safezone script m8. Hadn't forgotten you. Cheers, Stoney
SNAFU Posted October 17, 2014 Author Posted October 17, 2014 I updated the first post and added your latest files Stonehouse, so it doesn´t get lost in the length of this thread. If you want something to be changed there or have new files, just sent me a PM and I include this in the overview. [sIGPIC][/sIGPIC] Unsere Facebook-Seite
uboats Posted October 17, 2014 Posted October 17, 2014 (edited) Ok I hope I've sorted all the known bugs out in this new version. MIST 3.5.37 or later is required. Main new features: No longer need to edit script to change countries. Countries will now be picked up from template aircraft for CAP and GCI. Therefore within the limits of the countries chosen for the mission this gives 8 possible countries a side. No longer need to edit script for airbases. Simply select the coalition of the airbase and place a trigger zone over the airbase just big enough to encompass it's runways etc and name the zone exactly as per the name of the airbase on the mission editor map. Helicopters are now interception targets. Corrected some issues including the RTB typo bug, bug which prevented player aircraft being interception targets (thanks uboats) and as part of this correction removed player aircraft from the list of available interceptors from the scripts viewpoint (mucks up the accounting for number of active intercepts) Also investigated AWACs usage. The isTargetDetected function does not work for AWACs only ground and ship based radars so AWACS do not work as radars for the script as now. As a result I removed comments re: AWACs but did leave some commented out code for future enhancements in this area. Did a little bit of work moving the script towards making it easier to select additional radar units but essentially you won't really notice this. By the way the bug causing my headaches was one in the mission NOT the script after all. It was caused by me accidently having a space after one of the GCI template aircraft pilot (unit) names ie instead of "__GCI__blue1" I had "__GCI__blue1 " and this caused the blue side of things to fail after the initial CAPs were spawned. It's weird that this latest ver failed to create GCI in my mission in which prev ver worked fine. I just replace the script and change capgroup number, no other changes. The GCI warning text can be shown, but no GCI AC was generated.GCI Test uboats.miz Edited October 17, 2014 by uboats [sIGPIC][/sIGPIC] My DCS Mods, Skins, Utilities and Scripts | Windows 10 | i7-4790K | GTX 980Ti Hybrid | 32GB RAM | 3TB SSD | | TM Warthog Stick | CH Pro Throttle + Pro Pedal | TIR5 Pro | TM MFD Cougar | Gun Camera: PrtScn |
Grimes Posted October 17, 2014 Posted October 17, 2014 By the way the bug causing my headaches was one in the mission NOT the script after all. It was caused by me accidently having a space after one of the GCI template aircraft pilot (unit) names ie instead of "__GCI__blue1" I had "__GCI__blue1 " and this caused the blue side of things to fail after the initial CAPs were spawned. Been there done that one to many times. Its why mist.stringMatch removes a bunch of characters, removes spaces, and can compare it all lower case. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Stonehouse Posted October 17, 2014 Posted October 17, 2014 (edited) It's weird that this latest ver failed to create GCI in my mission in which prev ver worked fine. I just replace the script and change capgroup number, no other changes. The GCI warning text can be shown, but no GCI AC was generated. Hi uboats, Ok gone through your mission and have the following observations: You have used a once trigger to load the GCICAP script with a time more. I strongly recommend that you use a mission start trigger with no conditions and have mist and then the GCICAP script as actions in that order. This guarantees MIST and GCICAP script is loaded prior to anything else taking place as a mission start trigger will execute before else happens. I assume it's a simple oversight but the mission I downloaded from your link doesn't actually load mist so doesn't work as is - note you need 3.5.37 or later. You have used ground vehicles to mark the borders but these borders cross large bodies of water which I believe will give DCS problems. You also don't have them set to be late activation without an activation trigger so these units are actually present in the mission from the start. I've adopted the practice of always using helicopters for borders as it sidesteps the issue of water crossings. They should always be late activation units that never get activated. You also have units like __CAP__red31 as template units in addition to the normal 8 red and 8 blue template aircraft. I believe this could cause you issues and would either not work with the stock script (knowing you've been doing customisations for yourself) or could be problematic as the script will try to find a __CAP__red3 unit and I'm unsure of how lua will treat finding a __CAP__red3 and a __CAP__red31. I hope and suspect it would ignore __CAP__red31 but am not sure. You started red units inside the blue border - this might work but my experience from developing the flak script is that unless the script specifically caters for this situation (GCICAP does not) then this is a bad idea and suggest you ensure that red starts in red territory and blue in blue territory even if they cross the border seconds after the mission starts. One thing you have discovered for me is that you cannot select a base for a coalition without also adding the airbase trigger zone. You had several bases activated for both coalitions but without a trigger zone. This seems to give the script problems so I will go back and amend my release post to note this rule and when time permits update the documentation in the script and release a new version. I really need to put together a proper guide or document for people but always run out of spare time. So turn off the bases you don't have trigger zones on or add trigger zones to the ones that don't have them. That is the specific points for GCICAP but one other thing I feel I should mention to you is that you have one huge amount of objects spawned and present in the mission from the start. This is a massive overhead that will make your mission rapidly unplayable. My suggestion to you is to make as many of these as you can late activation or otherwise inactive and use triggers and conditions to turn these units on when players get near them. It will make things much better for you in regard of load times and just general MP playability. eg things like SAM units that are not moving don't need to be active until a enemy unit enters their area. Attached is a cut down version of your mission. I've stripped it down to the bare bones for CAP GCI so you can compare it to your original and see my changes. CAP flights and GCI flights launch without issue. Hope the above helps. Cheers, StoneyGCI Test uboatsnew.miz Edited October 17, 2014 by Stonehouse
Stonehouse Posted October 17, 2014 Posted October 17, 2014 Been there done that one to many times. Its why mist.stringMatch removes a bunch of characters, removes spaces, and can compare it all lower case. Thank you Grimes, I will work this into the script in the next version as it makes life much more predictable. It really needs a stack more error handling as it's quite fragile. Just need to figure out how to do it. Funny it's so easy to do at work but then again maybe that's because I've worked in that particular environment for so long. Cheers, Stoney
uboats Posted October 17, 2014 Posted October 17, 2014 Hi uboats, Ok gone through your mission and have the following observations: You have used a once trigger to load the GCICAP script with a time more. I strongly recommend that you use a mission start trigger with no conditions and have mist and then the GCICAP script as actions in that order. This guarantees MIST and GCICAP script is loaded prior to anything else taking place as a mission start trigger will execute before else happens. I assume it's a simple oversight but the mission I downloaded from your link doesn't actually load mist so doesn't work as is - note you need 3.5.37 or later. You have used ground vehicles to mark the borders but these borders cross large bodies of water which I believe will give DCS problems. You also don't have them set to be late activation without an activation trigger so these units are actually present in the mission from the start. I've adopted the practice of always using helicopters for borders as it sidesteps the issue of water crossings. They should always be late activation units that never get activated. You also have units like __CAP__red31 as template units in addition to the normal 8 red and 8 blue template aircraft. I believe this could cause you issues and would either not work with the stock script (knowing you've been doing customisations for yourself) or could be problematic as the script will try to find a __CAP__red3 unit and I'm unsure of how lua will treat finding a __CAP__red3 and a __CAP__red31. I hope and suspect it would ignore __CAP__red31 but am not sure. You started red units inside the blue border - this might work but my experience from developing the flak script is that unless the script specifically caters for this situation (GCICAP does not) then this is a bad idea and suggest you ensure that red starts in red territory and blue in blue territory even if they cross the border seconds after the mission starts. One thing you have discovered for me is that you cannot select a base for a coalition without also adding the airbase trigger zone. You had several bases activated for both coalitions but without a trigger zone. This seems to give the script problems so I will go back and amend my release post to note this rule and when time permits update the documentation in the script and release a new version. I really need to put together a proper guide or document for people but always run out of spare time. So turn off the bases you don't have trigger zones on or add trigger zones to the ones that don't have them. That is the specific points for GCICAP but one other thing I feel I should mention to you is that you have one huge amount of objects spawned and present in the mission from the start. This is a massive overhead that will make your mission rapidly unplayable. My suggestion to you is to make as many of these as you can late activation or otherwise inactive and use triggers and conditions to turn these units on when players get near them. It will make things much better for you in regard of load times and just general MP playability. eg things like SAM units that are not moving don't need to be active until a enemy unit enters their area. Attached is a cut down version of your mission. I've stripped it down to the bare bones for CAP GCI so you can compare it to your original and see my changes. CAP flights and GCI flights launch without issue. Hope the above helps. Cheers, Stoney Thanks so much. I thought it could give easy support to large campaign. [sIGPIC][/sIGPIC] My DCS Mods, Skins, Utilities and Scripts | Windows 10 | i7-4790K | GTX 980Ti Hybrid | 32GB RAM | 3TB SSD | | TM Warthog Stick | CH Pro Throttle + Pro Pedal | TIR5 Pro | TM MFD Cougar | Gun Camera: PrtScn |
HiJack Posted October 19, 2014 Posted October 19, 2014 I really like your last update Stonehouse! Once I just changed my mission project to add zone for blue and red activated airports then it works also :thumbup:. I would still suggest one change, could you again add some sort of selection for the take-off airport and also the landing airport? Take-off and landing can be at the same airport but I would really like the option to select what airports the GCI&CAP script uses. :)
uboats Posted October 19, 2014 Posted October 19, 2014 (edited) @SNAFU @Stonehouse I think if the script can manage GCI AC with matched generation, that would be more playable. Here is how I implement the generation matching: Create a table, (western standard) 1 for 1st generation, .... Since no 4th generation, so 4 for WWII. 1. Here is list for all flyable ACs, users can add more as they wish ACGenDict = {} ACGenDict[1] = {'MiG-15bis','F-86F Sabre'} ACGenDict[2] = {'F-4E','MiG-21Bis','F-5E','MiG-31','Su-25','Su-25T','A-10C','A-10A'} ACGenDict[3] = {'Su-27','Su-33','MiG-29S','F-15C','F-16A'} ACGenDict[4] = {'P-51D','TF-51D','FW-190D9'} 2. define number of sub templates for each generation --e.g.: if k, then templates of 2nd gen on either coaltion must have at least: __GCI__red2 (fundamental one), __GCI__red2.1, ..., __GCI__red2.k (at least to k), .... -- and can be even more, so total template (fund & sub) on either side for that gen should be at least k+1, including the fundamental one which does not have sub index numgentemplate = 3 3. Then in function 'spawninterceptor', inside the for loop: for a = 1, #intruder[interceptorside]--for every detected intruder do start the loop do local targetalreadyintercepted = false local Interceptorgroupname = "GCI-> "..intruder[interceptorside][a].name write down (e.g. for 'red'): if interceptorside == 'red' then local intrudergen = 1 for kk = 1, #ACGenDict -- since table is small, so use this straight way do for kkk = 1, #ACGenDict[kk] do if(ACGenDict[kk][kkk] == Unit.getTypeName(Unit.getByName(intruder[interceptorside][a].name)) ) then intrudergen = kk end end end local gcitempext = math.random(0,numgentemplate) --XX7 template logic >> if gcitempext == 0 then redgcitemplate = "__GCI__"..interceptorside..intrudergen elseif gcitempext > 0 then redgcitemplate = "__GCI__"..interceptorside..intrudergen.."."..gcitempext end .... .... payload, country, etc... elseif interceptorside == 'red' then .... Then, in ME, for both sides, place at least (numgentemplate+1) templates for each generation, in which there must be __GCI__$side$gen, then __GCI__$side$gen.$subidx, ... After adding above code, once you fly F-86 as a blue, the red coalition will send MiG-15 or other user-defined 1st generation GCI AC. TODO: Since for different generations, number of template candidates can be different. Therefore a global 'numgentemplate' is a limitation which can cause error once number of template does not match the value. What I want to add is to parse all template and record the number for each gen, therefore, user can freely add as many template as they wish without any worry. Hope SNAFU and Stone can consider it and add this as an extension. Edited October 19, 2014 by uboats [sIGPIC][/sIGPIC] My DCS Mods, Skins, Utilities and Scripts | Windows 10 | i7-4790K | GTX 980Ti Hybrid | 32GB RAM | 3TB SSD | | TM Warthog Stick | CH Pro Throttle + Pro Pedal | TIR5 Pro | TM MFD Cougar | Gun Camera: PrtScn |
Stonehouse Posted October 19, 2014 Posted October 19, 2014 Ok it's getting very late here so maybe I'm being thicker than normal. So apologies in advance if the comments below seem off target or stupid. @Hijack, not sure what you mean but I'm guessing that you are talking about a certain CAP or GCI unit being based at a particular airbase? So they always take off and land there? If so that's probably a pretty big change as the current logic Snafu created was to use the closest base to the situation needing an aircraft spawned. It would mean that you would need a lot more tracking to see if a unit was already tasked and if it was busy go to the next airfield etc. Not impossible probably but a big change to the core logic. Please clarify. @uboats, I think I see what you want ie a matched response to whatever unit the player is flying or unit that is intruding over the border so that P51s are met by FW190s, F16s by Su27s, F86s by Mig15s etc. Possibly also some sort of plane set validation?? So F86s only go against Mig15s??? I'm not necessarily adverse to the above ideas as such but believe you can already do most of it by how you design your mission. For example if I was building a WW2 mission then that's the only plane types I would include. Ditto Korea or later. IE My player aircraft selections suit the situation of the mission and I don't have a collection of player slots that span chronological eras but instead have a WW2 mission using a generic GCI CAP script or a Korea mission using the generic script to drive stuff or a 1980s mission etc etc. So unless you are after a generic instant mission maker of sorts I'm not really understanding your final goal with what you are trying to do. Cheers, Stoney
HiJack Posted October 19, 2014 Posted October 19, 2014 @Hijack, not sure what you mean but I'm guessing that you are talking about a certain CAP or GCI unit being based at a particular airbase? So they always take off and land there? If so that's probably a pretty big change as the current logic Snafu created was to use the closest base to the situation needing an aircraft spawned. It would mean that you would need a lot more tracking to see if a unit was already tasked and if it was busy go to the next airfield etc. Not impossible probably but a big change to the core logic. Please clarify. OK, in the previous versions of the script you marked two airports with a zone named the same as the airport and these were then used by the script regardless of all the other "activated" red or blue airports for human pilots. As it is in this version you must declare all "activated" airports even if you plan to just use them as human pilot bases. I would like to restrict the script to just using the airports in the same way as the previous versions.
Recommended Posts