DragonShadow Posted February 9, 2014 Posted February 9, 2014 Thats great! I am happy that you made that mission with it and that you improved the script! I will recommend that mission for my squad weekly flights, because it looks very good. Would you mind maybe posting your improved script too? Glad to hear you like the ideas :) Not at all, here's the modified script. The community is free to use it in the spirit of the original script. I've functionalized most of the new code, but there are of course places where I've needed to modify existing functions as well. I've marked the places with comments beginning with '-- DS:'. Feel free to integrate them into the main script too. Do let me know how you liked the mission itself :) Always curious to get feedback on my work.Medevac_SAR v3-DSMod.lua
RagnarDa Posted February 11, 2014 Author Posted February 11, 2014 So I took the liberty to merge DragonShadow and Shagrats changes into my latest. Haven't checked if it even compiles, so please let me know! @DragonShadow and @Shagrat, is this OK with you?Medevac_SAR v5.lua DCS AJS37 HACKERMAN There will always be bugs. If everything is a priority nothing is.
ENO Posted February 11, 2014 Posted February 11, 2014 Eh Ragnarda just curious was there a known issue when you have multiple pilots requiring rescue that you lose 1? It's fine if that's just the way it is I just need to pass it on to my regulars. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
RagnarDa Posted February 11, 2014 Author Posted February 11, 2014 Eh Ragnarda just curious was there a known issue when you have multiple pilots requiring rescue that you lose 1? It's fine if that's just the way it is I just need to pass it on to my regulars. No, thats new to me. It would help enormously if you could either provide a dcs.log - file or some way to replicate the issue. Whitout it its very difficult to pinpoint the problem... :( DCS AJS37 HACKERMAN There will always be bugs. If everything is a priority nothing is.
ENO Posted February 11, 2014 Posted February 11, 2014 K I can definitely do that. It's pretty common when we have two guys shot down, the first guy basically becomes unresponsive and the second guy gets picked up as usual. I'll see if I have that log saved- I may have submitted it to Grimes for some SLMOD / MIST stuff. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
ENO Posted February 12, 2014 Posted February 12, 2014 Hey Eno, I've noticed something odd in a couple of missions over the past few days. It seems with certain groups, when we kill an armored vehicle a group of three infantry spawn by its corpse. It think this is supposed to simulate the crew bailing out. The problem is that the crew is always BLUFOR and invincible, while the vehicles killed are OPFOR. This usually results in a slightly comical firefight as the OPFOR encampment tries in vain to kill the infantry, revealing their position explosions and copious tracer fire. Some more good feedback- I'd seen this too and since the opfor in this case is Georgia I imagine the country association is US / Russia. I went in to see if it was something easy to change and made it to this line- around 666- and thought it may have something to do with it... local _country = 0 local _infantry = "Infantry AK" if (_woundcoal == 2) then _country = 2 _infantry = "Soldier M4" end I'm not sure if this is the right spot but if folks wanted to change the affiliation of the red force... how would that be done? Is it something that can be set to automatically figure out which country the opfor is or make it something configured at the start of the script with the country number from the mission scripting documentation? Thanks.logs medvac.zip "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
DragonShadow Posted February 12, 2014 Posted February 12, 2014 So I took the liberty to merge DragonShadow and Shagrats changes into my latest. Haven't checked if it even compiles, so please let me know! @DragonShadow and @Shagrat, is this OK with you? Sure, it's fine on my behalf. Thanks for adding me to the credits. My modifications won't work directly with the latest version of the script though since it's not set up yet to handle multiple MASH units. I'm working on solving this by calculating the distance to the closest MASH. Right now though I'm running into weird issues like variables I'm passing to functions suddenly turning into 'nil'. It's pretty tiresome debugging with DCS, but at least my Huey landings are improving alongside each attempt. I've also unified my coding style a bit more with yours and cleaned up some of the indenting, etc in the merge.
ENO Posted February 12, 2014 Posted February 12, 2014 It's pretty tiresome debugging with DCS This is what makes learning any of this stuff so challenging- everything's always changing. :helpsmilie: I'm working on solving this by calculating the distance to the closest MASH. Any way to integrate the script for this measurement towards calculating distance to the nearest enemy / opfor "recovery" unit that would use the vec point from the SAR call as a waypoint? "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
shagrat Posted February 13, 2014 Posted February 13, 2014 So I took the liberty to merge DragonShadow and Shagrats changes into my latest. Haven't checked if it even compiles, so please let me know! @DragonShadow and @Shagrat, is this OK with you? Absolutely yes! Open source spirit... you made the base and we contribute. I'll try the new merged version this weekend and let you know. Shagrat - Flying Sims since 1984 - Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)
DragonShadow Posted February 14, 2014 Posted February 14, 2014 Yes, seems like we have something in the spirit of an open source project :) I spent an evening working on it and was able to integrate the modifications into the newest script. I also wrote up a function to get the distance to the closest MASH, which was required for calculating the fair bleed time. I've not had the time to test it properly, but it runs and I was able to complete a CSAR flight too. Consider it beta until better tested, but want to give this one a try Shagrat? I made a few small suggestions to the messages that tell you how critical the patient is, too. I think at the point we have to re-animate a patient it might be a tiny bit too late :)Medevac_SAR v5-beta.lua 2
shagrat Posted February 15, 2014 Posted February 15, 2014 Yes, seems like we have something in the spirit of an open source project :) I spent an evening working on it and was able to integrate the modifications into the newest script. I also wrote up a function to get the distance to the closest MASH, which was required for calculating the fair bleed time. I've not had the time to test it properly, but it runs and I was able to complete a CSAR flight too. Consider it beta until better tested, but want to give this one a try Shagrat? I made a few small suggestions to the messages that tell you how critical the patient is, too. I think at the point we have to re-animate a patient it might be a tiny bit too late :) Yeah! Reanimating was to point out he is close to dying and I couldn't come up with something serious I didn't use, yet. I'll give it a try after the weekend. We want to introduce a friend to DCS tomorrow so no time for playtesting, more öearning course in basic flying with the SU-25T :smilewink: I'll definitely check on the bleed timer function! This is much better than my manual "improvements"... if the multiple MASH issue is fixed, this will be awesome.:thumbup: Shagrat - Flying Sims since 1984 - Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)
Guest Posted February 16, 2014 Posted February 16, 2014 (edited) Fantastic script! This script and the CTTS script makes the UH-1H module go from very good to fantastic. Do you guys get survivors from crashing AI helicopters? I have been fiddling about with it since yesterday and I get survivors and smoke etc from ground units but whatever I do I can't get any from AI helicopters. I have tried by setting explode triggers of various strength on AI helicopters, some burning & crashing, others make emergency landings without fire but nothing works. "I get the Bullseye, airman down @ ..... No chute" message. Edited February 16, 2014 by ArturDCS
Robin_Hood Posted February 16, 2014 Posted February 16, 2014 It probably considers there is no survivors since they are taken as air units and there was no bailing out. That is more suited to planes, however. 2nd French Fighter Squadron
shagrat Posted February 16, 2014 Posted February 16, 2014 It probably considers there is no survivors since they are taken as air units and there was no bailing out. That is more suited to planes, however. Not exactly, the root cause is that most Helo crashes from a certain speed and height will kill the crew (when it explodes, they definitely die). And I'm not sure if the AI actually triggers a bail out/eject for choppers, that do an emergency landing. When using the script in MP, though! and you land a damaged chopper, bail out manually (ctrl+E three times), you get a perfect CSAR call! Unfortunately the MEDEVACUNIT as by the script is still present (the damaged Helo) and it will be recognised as a pick up. So we may need a way to recognize if a _rescuegroup is actually the MEDEVACUNIT that is doing the pick up and prevent this? Shagrat - Flying Sims since 1984 - Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)
shagrat Posted February 16, 2014 Posted February 16, 2014 Yes, seems like we have something in the spirit of an open source project :) I spent an evening working on it and was able to integrate the modifications into the newest script. I also wrote up a function to get the distance to the closest MASH, which was required for calculating the fair bleed time. I've not had the time to test it properly, but it runs and I was able to complete a CSAR flight too. Consider it beta until better tested, but want to give this one a try Shagrat? I made a few small suggestions to the messages that tell you how critical the patient is, too. I think at the point we have to re-animate a patient it might be a tiny bit too late :) Hi DragonShadow, so I did test the Beta script. Seems to work as expected. No problems or difficulties so far, triggered MEDEVACS as expected on all relevant occasions. The calculation and distance comparison for multiple MASHes seems to work perfectly. For my personal taste, I'll try to add a little more padding to the flight time, or may be even better a dynamic padding (min 30 sec. max. 15 minutes). I got quite used to have a stable patient and if so, take the chance to pick up an additional group of survivors on the way home. :D Good work so far... I think this is getting better with each iteration! With dynamically triggered patrols and ambushers this makes a very interesting mission with high replayability! I think I speak for a lot of Huey pilots to say thanks again to RagnarDa for the nice idea and script :thumbup: Shagrat - Flying Sims since 1984 - Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)
Guest Posted February 16, 2014 Posted February 16, 2014 (edited) I have had some initial success. The problem for me is the extremely slow process of testing changes, my lack of LUA knowledge. Anyways, I have done this for testing purposes: if ((vnt.id == 8 and vnt.initiator ~= nil) or (vnt.id == 6 and medevac.sar_pilots == true)) then to if ((vnt.id == 8 and vnt.initiator ~= nil) or (vnt.id == 6 and medevac.sar_pilots == true) or (vnt.id == 5 and medevac.sar_pilots == true)) thenaccording to world.event = { 1 S_EVENT_SHOT, 2 S_EVENT_HIT, 3 S_EVENT_TAKEOFF, 4 S_EVENT_LAND, 5 S_EVENT_CRASH, 6 S_EVENT_EJECTION, 7 S_EVENT_REFUELING, 8 S_EVENT_DEAD, 9 S_EVENT_PILOT_DEAD, 10 S_EVENT_BASE_CAPTURED, 11 S_EVENT_MISSION_START, 12 S_EVENT_MISSION_END, 13 S_EVENT_TOOK_CONTROL, 14 S_EVENT_REFUELING_STOP, 15 S_EVENT_BIRTH, 16 S_EVENT_HUMAN_FAILURE, 17 S_EVENT_ENGINE_STARTUP, 18 S_EVENT_ENGINE_SHUTDOWN, 19 S_EVENT_PLAYER_ENTER_UNIT, 20 S_EVENT_PLAYER_LEAVE_UNIT } so that the main body of the event handler executes also for S_EVENT_CRASH events. I found out that pilots spawned were way to close to the helicopter and when the ship explodes it kills the pilot. So I added this: if Unit.getTypeName(_unit) == 'UH-1H' then _tarpos.z = _tarpos.z + 40 _tarpos.x = _tarpos.x + 40 endand it works. Pilot survives. Although always only one? These are very crude alterations, I will try and make it better and also change the number of survivors based on standard crew depending on helicopter type. I'll try and change the behaviour of the script for these vehicles: AB-212ASW AH-1W AH-64A AH-64D CH-47D CH-53E OH-58D SH-3W SH-60B UH-60A UH-1H KA-27 KA-50 KA-52 MI-24V MI-26 MI-28N MI-8MT Edited February 16, 2014 by ArturDCS
Guest Posted February 17, 2014 Posted February 17, 2014 I have a working version. I have tried to test all aspects but as I am new to this script (new to LUA, new to DCS) I have most likely missed something. I'll attach it here for those that would like to test it. My modification enables survivors from crashing AI helicopters. Quite crude handling but it works. All messages have been modified to include helicopters. The scripts spawns random survivors up to the number of crew members the helicopter type normally have. I tested by crashing an A10 and an F15-E. The spawned survivors jumped into the ship but the real pilot which was standing by his chute on the ground did not. Anyone know how to get him on board? Please give feedback if you find broken features of the script or some new features not working. Thanks!Medevac_SAR v4_2_C6_MODDED_V1.0.lua
RagnarDa Posted February 17, 2014 Author Posted February 17, 2014 I think this is awesome! Keep the improvements coming! I just need some time to test them out... DCS AJS37 HACKERMAN There will always be bugs. If everything is a priority nothing is.
ENO Posted February 17, 2014 Posted February 17, 2014 Can someone give me a heads up on how to make the red side survivors be red side infantry? Where do we set the coalition? "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Guest Posted February 17, 2014 Posted February 17, 2014 Can someone give me a heads up on how to make the red side survivors be red side infantry? Where do we set the coalition? local _woundcoal = Group.getCoalition(Group.getByName(_grp)) I think this is the line that sets the coalition and it should be automatic. I honestly didn't test that. I was just testing as USA.
ENO Posted February 18, 2014 Posted February 18, 2014 As mentioned currently red survivors spawn as blue (red is Georgia) so any hint as to how I can bring that around would be appreciated. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Guest Posted February 18, 2014 Posted February 18, 2014 As mentioned currently red survivors spawn as blue (red is Georgia) so any hint as to how I can bring that around would be appreciated. But Georgia is Blue according to ME and the game engine AFAIK. Changing the script would make their own comrades fire at the the red survivors. For example a convoy of Georgian vehicles where one is hit and spawns red infantry.
RagnarDa Posted February 18, 2014 Author Posted February 18, 2014 Yes Georgia is normally on blue side. You can only change the coalition side of countries when you press New in the ME and not again. You can however change the 3D model of they infantry unit to make them look like Georgian soldiers instead of US soldiers, and I think the name is "Infantry_AK" IIRC. You change it on the line you suggested. Sorry Eno I thought I responded to you earlier. DCS AJS37 HACKERMAN There will always be bugs. If everything is a priority nothing is.
ENO Posted February 18, 2014 Posted February 18, 2014 Sorry guys- I think I've confused you with what the problem is... I know that Georgia is normally blue- but for this series of missions I have them as Red. I don't need to change them in the ME- they're already configured like that for the mission template. This option exists when you create a new mission (to artur) as you know... I guess what I was asking was whether or not the script can force the survivors of the red vehicles (by whatever coalition) to be of the red alliance as per the mission parameters as opposed to the stock ME parameters. And again, RagnaDa- I love the script and it's fine the way it is and I'll work around it if it's not possible... but if it's something that could be done as it currently exists (doesn't sound like it) or something that could be changed then I wanted to put it out there. Currently I have resolved it by not having red force survivors which works since there are no red client slots. As it was, however, I was having trouble because guys would go and kill a red vehicle, then the infantry nearby (blue survivors) and get kicked by slmod for team killing. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Guest Posted February 18, 2014 Posted February 18, 2014 (edited) I found an error in my version of the script. I had it working but had other problems and tried this and that and it the process broke an already functioning feature. As a side note , the problem was a LUA pitfall, you cannot declare a variable like _isBlueSide = 0 and then treat it like a boolean if _isBlueSide then ... and this almost made me crazy until I found this page. OK to the point, when spawning survivors for helicopters the correct code is (I have tweaked the positions of the spawned soldiers): elseif (_ispilot and _isHelicopter) then --Spawn a number of survivors based on RANDOM & crew member size local survivorUnits = {} --Have to have one survivor?? script won't work otherwise, has to do with table.insert(medevac.woundedgroups,_groupname) which is before this code?? local numberOfSurvivors = mist.random(0, _helicopterCrewCount) if numberOfSurvivors > 0 then env.info("_", false) env.info("C6MOD Will spawn " .. numberOfSurvivors .. " survivors from helicopter " .. _groupname .. ". Crew member count is " .. _helicopterCrewCount, false) env.info("_", false) for i = 1, numberOfSurvivors do local spawnUnitName = string.format("%s crew #", _groupname) .. i env.info("C6MOD Spawning survivor " .. i .. " of " .. numberOfSurvivors .. " with name " .. spawnUnitName, false) survivorUnits[i] = { ["y"] = _tarpos.z + 8 - i, ["type"] = _infantry, ["name"] = spawnUnitName, ["unitId"] = _idroot + 1 + i, ["heading"] = 3, ["playerCanDrive"] = true, ["skill"] = "Excellent", ["x"] = _tarpos.x - 4.6 - i, } end coalition.addGroup(_country, Group.Category.GROUND, { Edited February 18, 2014 by ArturDCS pilot -> crew
Recommended Posts