Jump to content

ajax

Members
  • Posts

    491
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ajax

  1. If using a group name instead of a unit name, I would change your modification slightly: [font=Courier New]function getCountry(groupName) local i,j,k if env.mission.coalition then for coa,coaTable in pairs(env.mission.coalition) do if type(coaTable) == 'table' and coaTable.country then for i=1,#coaTable.country do local country = coaTable.country[i] for uType,uTable in pairs(country) do if uType == 'helicopter' or uType == 'ship' or uType == 'vehicle' or uType == 'plane' then if type(uTable)=='table' and uTable.group then for j=1,#uTable.group do local group = uTable.group[j] [color=Blue] if group and group.name == groupName then return country.name end [/color][color=Red]-- if group.units then -- for k=1,#group.units do -- local unit = group.units[k] -- -- if unit.name and unit.name == groupName then -- -- return group.name--country.name -- -- end -- if group.name and group.name == groupName then -- return country.name -- end -- end -- end [/color] end end end end end end end end return nil end[/font]
  2. Spinter, I saw your question in the other forum topic but I will answer it here. Yes, feel free to use the function in your scripts and to modify it however you want to. Mist does not need to be loaded.
  3. Your conversion is correct, but it is not necessary. The PVI-800 requires input in the form DDMM.M, where DD is degrees and MM.M is decimal minutes. Edit: In your example you would enter 41202
  4. I'm still leaning towards meters per second based on this statement in the referenced Mist function: [font=Courier New][font=Courier New] if not speed then wp.speed = mist.utils.[color=Red]kmphToMps[/color](500) else wp.speed = speed end [/font][/font]
  5. Speed is meters per second in the mission file. I don't know what it is here.
  6. I believe infantry are classified as 'vehicle'. That doesn't address the issue of them not being stored, though.
  7. It is confusing because he explicitly says to name them 'AF1', 'AF2', and 'AF3' although it seems that wasn't really his intent.:)
  8. I appreciate it, Eno, but I should have read the whole thread. It seems Highwayman-Ed came up with the solution back in post #27. I should point out that the fix (his and mine) may not be doing things the way Snafu intended. I believe it would work without the changes if you named your zones exactly like the strings assigned to the variables AF1, AF2, and AF3. For example, instead of naming the zones 'AF1', 'AF2', and 'AF3', name them like this: Whatever you define your airfield names to be: AF1 = 'XXXXXX' AF2 = 'YYYYYY' AF3 = 'ZZZZZZ' In the mission editor, name your zones the same thing: Zone 1 name = 'XXXXXX' Zone 2 name = 'YYYYYY' Zone 3 name = 'ZZZZZZ' If you do this, then the script should work as written.
  9. I think I see the problem. From the script: --Following trigger zones need to be placed in the ME: --1: Zone called 'AF1', which defines location of airfield 1 --2: Zone called 'AF2', which defines location of airfield 2 --3: Zone called 'AF3', which defines location of airfield 3 --4: Zone called 'airlanehub1', which defines the entry/exit point of the airfield the planes are set to land or takeoff Variable names AF1, AF2, and AF3 are also used for different purposes. The zone names are strings, so the code need to be changed from _spawnairplane = trigger.misc.getZone(AF1) to _spawnairplane = trigger.misc.getZone('AF1') at line 2356. Likewise AF2 and AF3 need to be changed to 'AF2' and 'AF3' at lines 2368 and 2380, respectively. (Also, AF1 is mistakenly used at line 2368 -- it should be 'AF2'). They need to be changed at lines 2573, 2580, and 2587, too, where _destination is set.
  10. -- returns name of unit's country if found or nil if not found function getCountry(unitName) local i,j,k if env.mission.coalition then for coa,coaTable in pairs(env.mission.coalition) do if type(coaTable) == 'table' and coaTable.country then for i=1,#coaTable.country do local country = coaTable.country[i] for uType,uTable in pairs(country) do if uType == 'helicopter' or uType == 'ship' or uType == 'vehicle' or uType == 'plane' then if type(uTable)=='table' and uTable.group then for j=1,#uTable.group do local group = uTable.group[j] if group.units then for k=1,#group.units do local unit = group.units[k] if unit.name and unit.name == unitName then return country.name end end end end end end end end end end end return nil end
  11. Yes, you could iterate through the env.mission table to find it. Take a look at the Mist code to see how it's done.
  12. Everything in the mission file is available to your script by reading the Lua table: env.mission. Since the start date is stored in the mission file, it has to be there somewhere. It might be stored as the number of days since XXX, where XXX is some arbitrary start date. (I can't remember what it is, though.)
  13. I'm not sure what you mean. There is a non-ME-generated oil field south of Krasnodar, NE quadrant of grid EK04.
  14. It looks like south of Krasnodar.
  15. This ^^^:thumbup:
  16. Ahh. I misread his post. The faces of MDF do paint beautifully. But the edges IMO should be trimmed with wood strips before painting (or hidden in a rabbit/rebate). They can be filled as you say, but I don't think it's worth the extra work. The top has a 30" span and it will sag with 3/4" MDF unless he supports it with solid trim (wood or metal) on the front and back edges. (There are other ways, of course -- corner blocks up underneath, for example.) I don't see anything to keep it from racking side-to-side, either. A simple 1/4" panel on the back will solve that. (Alternately, small plywood gussets at the top back corners will work -- or the corner blocks mentioned earlier.) I still don't like MDF for anything structural. Even using pilot holes, regular screws do not hold well in MDF. (There are special screws for MDF but the you are taking a chance that your local big-box store will have them.)
  17. I wouldn't recommend mdf -- it doesn't take regular screws well, the edges don't take paint or other finish well, and if it gets wet (spilt beer) it will start to fall apart. Solid wood is the way to go. You only have an 8 inch span, so you can get by with something fairly thin, 1/2 inch or so. You didn't say if appearance is important or not. Home Desperate has spf (spruce, pine, fir), select pine, red oak, and poplar (in my locale). If painted, use poplar. Natural finish, use oak. I don't think they offer thin stock of these, so just use 3/4 inch. I'd also think about making your own slides out of wood. Drawer slides are not cheap (for good ones, that is).
  18. It depends on the 'view' settings in the mission options -- all, allies only, fog of war, or none. Edit: Forgot one option -- own aircraft.
  19. I looked at that Slmod function, and it is specifically only for unzipped mission files. I suppose you can do the same -- read it in from the DCS temp folder.
  20. You're welcome. Let me know if you have any more problems.
  21. Okay, found the problem. I don't know how this can happen -- I didn't think the Mission Editor would allow it -- but there is a group defined with no name. Look at the very top of the list of groups. If you delete that group, then everything seems to work the way it's supposed to. Also, I noticed in the version of the TroopDrop script you're using, I had forgotten to comment out the lines that allow Ka-50s to transport troops. :doh: (I do that for testing, since that's what I fly.) Anyway, you should remark out those lines for the validHeloTypes table.
  22. Yeah, go ahead and send it to me. I'll check it out.
  23. I don't know what it could be, then; that certainly looks like a DCS system error. You're not loading the script more than once, are you?
  24. I used Mist. In it are debugging functions, one of which will dump a table to your log folder. I temporarily hardcoded the _G table name in the code then called the function.
  25. I have no idea. You should be able to change values. Try it and let us know.:) Edit: I guess it depends on how the game uses the table data. If it reads it in only once at mission start then it wouldn't do any good to change the values. If, however, the game reads the table on a periodic basis, then I see no reason you couldn't alter the resources dynamically.
×
×
  • Create New...