-
Posts
21 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by johnboy
-
Oops! Trashed my A-10C II Macro_sequencies.lua file. Got a copy I grab?
johnboy replied to johnboy's topic in Mission Editor
Outstanding! Thanks jonsky. And thanks for your reply too, Rudel. Cheers, John -
Curses! While experimenting with some changes to the default Macro_sequencies.lua for the A-10C II, I stupidly saved over the original file instead of my working copy. Would someone mind grabbing a copy of their default A-10C II Macro_sequencies.lua file and attaching a copy to a reply? The file location file is: ...\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\A-10C_2\Cockpit\Scripts Thanks in advance, John
-
Okay, we have a solution. By removing the function: function timedExplosionNear(args) ExplodeNearUnit(args[1]) end ...the script ran perfectly, producing a nice volume of random bursts around and above the unit. See pic below. Because I'm a mere lua apprentice, I don't fully understand why the 'args' function was a problem. But, it works. The Group name is Unit1 and the unit name is Unit1-1, but the unit name doesn't matter it seems. The modified/working script is also below. Thanks all for your interest and assistance! John
-
Still puzzled. In case the naming convention was the problem, I tried changing the name of the Group and Unit so that the Group was "Convoy1" and the unit was "Unit1", and also tried the Group name as "Unit1" and the unit as "Unit1-1". Both arrangements crashed to errors. I also made sure the script was being freshly injected into the mission file, in case there was an older script still embedded. No joy. When I run the mission with only the short script I posted above originally, the script works fine and I get one explosion in a random location, as expected. If it's any help, I've attached the mission file (that works) with just my simple first version embedded. Once again, I really appreciate any help that's offered! John FlakTesting-1.miz
-
Hi Chris, thanks very much for taking a look at this for me. I'm afraid I'm getting errors when I run the script in DCS (see below). I've double-checked spelling etc but I don't really know enough to troubleshoot the problem. Is there something I'm supposed to add to the script, perhaps? Sorry to bother you with this. John
-
Perhaps my post was in the tldr category? Here's what I have been able to come up with so far, with help from a scripting video by Ditch3r (highly recommended). This creates a single airburst explosion, offset from a unit on the x, y, and z axes. What I need to do next is find a way to produce a bunch of similar offsets, then detonate an explosion in each point, at a random time interval, for a period of time (say, 60 seconds). Can anyone help? John --Create an explosion offset in x,y and z space from a unit function ExplodeNearUnit(GroupName) ExplodeNearUnit = Group.getByName( GroupName ):getUnits() ExplodeVec3 = ExplodeNearUnit[1]:getPoint() ExplodeVec3.x = ExplodeVec3.x + math.random(-100,100) ExplodeVec3.z = ExplodeVec3.z + math.random(-100,100) ExplodeVec3.y = ExplodeVec3.y + math.random(0,200) trigger.action.explosion(ExplodeVec3, 100) -- Vec3 position, power end ExplodeNearUnit("Unit1")
-
Greetings! What I'm trying to achieve: ---------------------------- To create a volume of airburst explosions, to simulate flak dispersed horizontally and vertically around a point, with random (short) delays between explosions. What I did using standard triggers: ------------------------------------ 1. As a test, I spread nine small trigger zones around an airfield, named Explosion-1, -2 etc. 2. In ME, I made an action to spit out random values for FLAG 2 between 2-9. 3. Then I made a SWITCHED CONDITION for each of the random values. Each line checks the value of FLAG 2, fires the explosion, then re-sets the flag to value 1 to continue the loop. 4. In the ACTIONS panel, I changed the altitude of the explosion in each line, so that the flak bursts are spread vertically and well as horizontally. 5. I kept the altitude low (<200) so I could observe it more easily from a parked plane. 6. I kept the volume (power) of the explosions low (100) in my test but this could be set to 1 if the effect desired was visual rather than destructive. 7. Here are some screenshots of the map and triggers panel, if that's helpful: The above set-up works well. However, I'd love to be able to do all triggering processes in a script. It seems to me (still learning lua) that the script might do the following things: ---------------------------------------------------------------------------------- 1. Get the vec3 coordinates for Point X in the middle of the area (perhaps the coordinates of a suitably placed vehicle) using a .getPoint thingie. 2. Create a number of new points (say, Points A-J for a ten-point field) scattered randomly (horizontally and vertically) around Point X, by making ten new x,y and z vec3 coordinates for each Point A-J. I think this could be done using a math.random thingie for x,y,z values? Perhaps then all the new coordinates could be stored in a table using a local BurstPoints_Table thingie? 3. Then create some code to detonate an EXPLOSION event at each of the randomly generated Points A-J at random (short, say 1-3 seconds) time intervals. For more timing randomness, perhaps one explosive array could be superimposed on top of another, running from a different mission time start point? 4. Continue this process until another trigger stops the loop, such as after a defined time or when a unit leaves the area. I have no idea how that could be done! In summary, the script would: ------------------------------- 1. Get a starting point. 2. Create randomly scattered points around it. 3. When triggered, randomly detonate explosions at those points. 4. Stop when required. Taking it to the next level: --------------------------- A next-level version of such a script might take the coordinates of a moving aircraft every few seconds and create the array of explosions in a pattern ahead and to the sides of the aircraft. Kind of a moving flak field, as though the AA gunners were tracking the aircraft/group. That might be difficult to script? My request: ------------ I'd be *super-grateful* if one of the community scripting wizards could give the main concept some thought (the next-level stuff can wait maybe). I am still on the lua learning pathway so I am yet to make the jump from know roughly what the script needs to do, to actually writing the code. My attempts so far produced errors or nothing. Previously cfrag and veteran66 helped me with some scripting, so I'm hoping they or others might be willing to continue to teach this stuff. Thanks and best wishes from Australia, John
-
I've just found this thread (late to the party, as always). Thank you to the contributors, especially nomdeplume and Weta43! This was a great help to me to set up random explosions in an area. Cheers, johnboy
-
Hi again cfrag, I would have let you know sooner how your script worked but rather than sitting on a train, I spent time today catching and relocating a cranky 1.8 metre snake who had set up shop on our patio. The joys of living in Australia! Pic is here if you'd like to see the handsome fellow (the snake, I mean). The snake (a mature Scrub Python) is a powerful constrictor and he's busy trying to break the bones in my wrist as I posed for the photos! I've tried your script and it works great; that is say, the visual messages for each firing unit and missile type worked flawlessly but I had trouble getting the sound files to play from the script. I changed the sound file names to match the script, as suggested. After searching through the DCS forum I learned that a DO SCRIPT FILE called by an entry in an ME trigger alone wouldn't be able find where the referenced sound files should be. Following some advice from Grimes (posted way back in 2016) I included an entry in the ME editor to point to the sound files via line that reads MISSION START -> FLAG IS TRUE 999 -> SOUND TO COALITION... "Colt 11-Fox1.ogg" and all the other sound files. FLAG 999 is never called but it seems to 'enliven' the sound files for some reason. I also tried another Grimes suggestion, namely to add the sound files to the .miz file separately using Winzip but that didn't help. The only way I could find to get the sound files to fire was to use the uncalled flag method described above. It would be nice if one could somehow point DCS to the sounds via a script entry, but it's not a deal-breaker. The workaround is certainly easier than writing nine ME entries to run the sound files and messages! Incidentally, I would like to try to get my head around loops and arrays - would you have time to show me how it might be done based on your script? if not, no problem, you've already been a tremendous help. Many thanks again for your guidance and clever script, I'm very grateful. Cheers, John
-
Wow! If you can write stuff this good sitting on a train, you could probably produce Shakespeare seated at your desk! Thanks very much for taking the time to help out. It's early morning here in Australia so I've just started studying your script. I *think* I understand it! I like the way the script dispenses with irrelevant conditions ("-- nope, bye!" and "-- not interesting, bye!") to focus on the real deal; I'll use that in other scripts. Your 'common code' section is also very cool; it's clean and compact. I will fiddle with the sound files today to rename them as suggested; the idea of dynamically built sound files is intriguing. I've recently looked at a couple of examples of an iterated array and it made my head hurt, but trying to follow the logic is fascinating so I'll keep at it. I can't wait to try this out; I'll report back on progress. Thanks again, CH, very much appreciated! Cheers, John
-
Script to Make Flag Value Increase by 1
johnboy replied to Sedlo's topic in Scripting Tips, Tricks & Issues
Very late to this party (in 2023!) but this is GOLD! Thanks Hardcard! -
Hi all, I've be trying to get my head around scripting but it isn't coming easily. I hope someone can look at the scripts below and work some magic for me? Here's the setup: I wanted a script that would monitor all three aircraft in a group (comprising Colt 11, Colt 12 and Colt 13) and set a flag each time one of them fires a missile. Each plane has at least two AIM-9 and two AIM-120 missiles. With help from Veteran66, I worked out a script that checks what guidance type the fired missile is, then sets a discrete flag according to the missile type and firing aircraft. That script works very well. I have used SWITCHED CONDITION triggers in the mission editor to play a matching sound file (such as "Colt 32 Fox 2!") then reset the flag to false so that subsequent firing are also reported. Here's that script: At the moment I have to write nine 'SWITCHED CONDITION' triggers matched to all nine possible unit + missile types combinations (three units, three fox possibilities), which isn't hard but a bit of a nuisance when I use the same set-up in a different mission. Each trigger is a variation of this line: SWITCHED CONDITION >FLAG IS TRUE ("11-Fox1") > SOUND TO COALITION (BLUE, Colt 11 - Fox 1.ogg, 0) > MESSAGE TO COALITION (BLUE, Colt 11, Fox 1,2,true) > FLAG OFF "11-Fox1" I'd like to convert those triggers into script form that I can re-use. I thought I could place the UserFlag output into an if-then function to play the appropriate sound file and then reset the flag to false to await subsequent missile firing. I found a small 'switched condition' script by DeadlyFishes that I thought I could use but I can't work out how to incorporate it into my larger script. I've also tried running the smaller script after the larger one but I'm doing something wrong, it seems. Here is the small script I've been playing with: I suspect the solution is pretty simple but my equally simple brain can't figure it out. Any suggestions would be greatly appreciated. Cheers, John
-
Thanks guys, especially Cibit. The JTAC guide is excellent, and solved the problem. Thanks! JC
-
Hi Guys, How can I add a TACAN to a (KC-135) tanker in the mission editor? I simply want to provide the ability for the player to find the tanker by vectoring on a TACAN signal, but I can't find any way of installing/adding a TACAN radio (with a designated frequency) to the tanker. Any ideas? JC
-
TM HOTAS WARTHOG & DCA A10-C button mapping - HELP!
johnboy replied to johnboy's topic in PC Hardware and Related Software
SOLVED: TM HOTAS WARTHOG & DCA A10-C button mapping Thanks to both ilikepie and phill for the replies. The button I was referring to is the one below the NWS button phill, with the vertical 'paddle' over it. But the problem is now SOLVED! I was using the Wheel Brake entry in the Axis Commands list. ilikepie's comment that he mapped it to the Wheel Brakes On/Off function prompted me to look under the All Commands list, and sure enough there was the Wheel Brakes On/Off entry. As soon as I went through the re-mapping sequence on that entry, it all worked perfectly. Don't ask me why the Axis Commands entry doesn't work... Anyway, I'm now added a few more new assignments (including the trim switches) and I'm officially a Happy Hog Pilot. Morale is restored! :thumbup: Johnboy -
[sOLVED] See my reply three posts below. Hey guys, I'm new to DCS A-10C and I need help assigning a key to a joystick button. I'm sure this should be easy but I've drilled into every post on every forum I could find that might clarify things, but no joy. I'm using a TM HOTAS WARTHOG setup, which works great. Plug-n-play, as advertised. What I want to do is make one simple change to the mapping of the joystick: I want to assign the Wheel Brake command (W) to the unused button under the 'paddle' at the front base of the stick. Trouble is that when I go into Options>Controls>Axis Commands and try to map the button/key I get stuck. I've set the Wheels Brakes line to DEFAULT, than clicked on the relevant spot next to Wheel Brakes in the column under HOTAS JOYSTICK. Then the dialogue box opens with Wheel Brakes correctly in the top slot. According to another post I found, I should be able to simply press the required button which assigns the new command. However, nothing happens when I press the button on the joystick (or any othr button). I've tried clicking on the drop-down arrow in the button slot, which gives a list of 32 assignments, such as JOY_ARX, JOY_ASLIDER1, JOY_FRX, JOY_RX, etc etc. I've searched the web for the list of which of these arcane descriptors is matched to which button on the TM HOTAS controllers but without success. Can anybody put me out of my misery? This simple task has consumed HOURS of frustration. Is there a list of the assignments of JOY_ARX, JOY_ASLIDER1, etc? Does anyone know what the code for the unused button under the 'paddle' is? Why doesn't pressing the button itself just make the assignment? Any assistance would be gratefully received. Johnboy