-
Posts
90 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by Kolyma
-
Note: clearly I see a lot of functions and stuff defined in the DCA world directory in *.lua files for items like weapons definitions, coalition lists, and such. But what I'm looking for is the actual definition of the Object class, and the inherited stuff like Unit class, Airbase class, Group class, etc. Maybe those classes are not defined in a publicly-accessible way and only contained in the compiled binary (closed source) DCS application executables and libraries?
-
Just rename the *.miz to *.zip, unzip the script file you're looking for, and edit that. I think you can also put the edited/updated script back into the zip file (overwriting the original version of that script file), rename the zip back to miz, and play it in DCS without having to go into the ME at all.
-
coalition.addGroup aircraft do not spawn on designated parking stand
Kolyma replied to MBot's topic in Mission Editor Issues
LOL Mbot, looks like we asked just about the same question within a couple of days... http://forums.eagle.ru/showthread.php?t=135811 -
If I put this into witchcraft on a running DCS mission: for key,value in pairs(Object) do env.info('key: ' .. key); end return I get helpful results like: 07160.439 INFO SCRIPTING: key: isExist 07160.439 INFO SCRIPTING: key: className_ 07160.439 INFO SCRIPTING: key: parentClass_ 07160.439 INFO SCRIPTING: key: getCategory 07160.439 INFO SCRIPTING: key: cancelChoosingCargo 07160.439 INFO SCRIPTING: key: database_ 07160.439 INFO SCRIPTING: key: Category 07160.439 INFO SCRIPTING: key: hasAttribute 07160.439 INFO SCRIPTING: key: __index 07160.439 INFO SCRIPTING: key: destroy 07160.439 INFO SCRIPTING: key: tonumber 07160.439 INFO SCRIPTING: key: __le 07160.439 INFO SCRIPTING: key: getName 07160.439 INFO SCRIPTING: key: __tonumber 07160.439 INFO SCRIPTING: key: __lt 07160.439 INFO SCRIPTING: key: __eq 07160.439 INFO SCRIPTING: key: getPoint 07160.439 INFO SCRIPTING: key: __newindex 07160.439 INFO SCRIPTING: key: getPosition 07160.439 INFO SCRIPTING: key: getVelocity 07160.439 INFO SCRIPTING: key: inAir 07160.439 INFO SCRIPTING: key: getTypeName And for something useful like Group: for key,value in pairs(Group) do env.info('key: ' .. key); end return Provides: 07360.402 INFO SCRIPTING: key: activate 07360.402 INFO SCRIPTING: key: isExist 07360.402 INFO SCRIPTING: key: className_ 07360.402 INFO SCRIPTING: key: parentClass_ 07360.402 INFO SCRIPTING: key: getCategory 07360.402 INFO SCRIPTING: key: Category 07360.402 INFO SCRIPTING: key: __index 07360.402 INFO SCRIPTING: key: getInitialSize 07360.402 INFO SCRIPTING: key: tonumber 07360.402 INFO SCRIPTING: key: __tonumber 07360.402 INFO SCRIPTING: key: __newindex 07360.402 INFO SCRIPTING: key: __le 07360.402 INFO SCRIPTING: key: __eq 07360.402 INFO SCRIPTING: key: getName 07360.402 INFO SCRIPTING: key: getController 07360.402 INFO SCRIPTING: key: __lt 07360.402 INFO SCRIPTING: key: getSize 07360.402 INFO SCRIPTING: key: getID 07360.402 INFO SCRIPTING: key: getCoalition 07360.402 INFO SCRIPTING: key: destroy 07360.402 INFO SCRIPTING: key: getUnits 07360.402 INFO SCRIPTING: key: getByName 07360.402 INFO SCRIPTING: key: getUnit Now I know some of this is documented in the standard DCS scripting info link http://en.wiki.eagle.ru/wiki/Simulator_Scripting_Engine/DCS:_World/Part_1 But does anyone know if there's any FULL documentation or information on ALL the function, methods, and values available to a lua script in DCS? I kind of poked around in the game files and didn't find anything.
-
Any way to set parking spot when adding planes with coalition.addGroup ?
Kolyma replied to Kolyma's topic in Mission Editor
Its not working no matter what I try. Seems setting the AI parking spot from the ME is totally possible, but not possible from within a script with a dynamic add. In testing a few AI placements in the ME and then opening the *.miz file, I see something odd about the parking spot numbering. The number you choose in the ME is not the number stored in the *.miz file ["parking"] parameter. For example, the top 4 and lower 4 parking spots for these 3 airbases are: Kobuleti: Kutaisi: Vaziani: ME - MIZ ME - MIZ ME - MIZ 1 48 1 1 1 11 2 47 2 23 2 13 3 58 3 25 3 15 4 63 4 27 4 17 ... ... ... 39 44 55 16 89 133 40 37 56 20 90 130 41 26 57 22 91 132 42 25 58 18 92 157 So there's an organization with the parking spot numbering and it's not globally unique to the map, since in just this small sample, I've got 2 #25's on different airbases. I gather from other sources these numbers are part of the *.rn *.rn3 files for the airbase description...But don't seem to find documentation for those or anyway to decode the *.rn *.rn3 files themselves. But it seems pointless because the sim engine appears to ignore the ["parking"] value when dynamically spawning AI units. Bummer dude. -
Any way to set parking spot when adding planes with coalition.addGroup ?
Kolyma replied to Kolyma's topic in Mission Editor
That looks very organized. What version of MIST are you using with that code? If I read it correctly, the line FLT_waypoints[#FLT_waypoints+1] = LAND Is adding the LAND variable which was built from the function (somewhere else in your code because here it appears as a comment with code) mist.fixedWing.buildWP(LAND, 'turningpoint', 500, 0) Based on the LAND point structure you posted earlier, with the sections ["type"] = "Land", ["action"] = "Landing", So somewhere else, you're doing something like this? LAND = mist.fixedWing.buildWP(LAND, 'turningpoint', 500, 0) If that's true then I believe most of what you've pre-defined in LAND gets dropped from the MIST function and you just end up with a "Turning Point" of altitude 0. Maybe that's why the plane is landing, because of the 0 altitude. Thanks for the help. Let me know what version of MIST you're using and I kindly ask you to look at the MIST source and review what the mist.fixedWing.buildWP actually does. I'm going to test some 0 altitude waypoints over an airport and see if that causes a landing. -
Any way to set parking spot when adding planes with coalition.addGroup ?
Kolyma replied to Kolyma's topic in Mission Editor
Minus the "properties" and "formation" part, that's pretty much what I have. And I saw that link originally, but there wasn't enough info to fully explore my dynamic parking spot query. Interestingly, I think I'm seeing dynamic parking spot working now. Maybe it's a recent patch? Or maybe not; I've been working this landing waypoint thing for a few days... Regardling wour script snippet, what are you using to make the waypoints and insert the route into the dynamically created group? Because like I said, the "LAND" waypoint type is NOT in MIST. Do you run witchcraft? If so, would you check your group's route after you think it's been set? return mist.getGroupRoute('groupname') And if your paste your route building snippet, you can also use this to confirm the created route is not what you would expect (there's no "LAND" "LANDING" waypoint in the route) return mist.fixedWing.buildWP(_landingpoint, "LAND", 200, 8000, "RADIO") -
Any way to set parking spot when adding planes with coalition.addGroup ?
Kolyma replied to Kolyma's topic in Mission Editor
That seems reasonable and I can see the additional scheduled processes for routes and radio messages in the other script I'm using as a reference.... MIST3_2_RandAirtraffic_r6.lua But I seem to have found something else that doesn't make any sense: There's a line in MIST3_2_RandAirtraffic_r6.lua - waypoints[#waypoints+1] = mist.fixedWing.buildWP(landingpoint, "LAND", 200, 8000, "RADIO") But in the MIST I'm using... MissionScriptingTools-3.5.37 , there's no "LAND" waypoint type in the mist.fixedWing.buildWP function: mist.fixedWing.buildWP = function(point, WPtype, speed, alt, altType) local wp = {} wp.x = point.x if point.z then wp.y = point.z else wp.y = point.y end if alt and type(alt) == 'number' then wp.alt = alt else wp.alt = 2000 end if altType then altType = string.lower(altType) if altType == 'radio' or altType == 'agl' then wp.alt_type = 'RADIO' elseif altType == 'baro' or altType == 'asl' then wp.alt_type = 'BARO' end else wp.alt_type = 'RADIO' end if point.speed then speed = point.speed end if point.type then WPtype = point.type end if not speed then wp.speed = mist.utils.kmphToMps(500) else wp.speed = speed end if not WPtype then wp.action = 'Turning Point' else WPtype = string.lower(WPtype) if WPtype == 'flyover' or WPtype == 'fly over' or WPtype == 'fly_over' then wp.action = 'Fly Over Point' elseif WPtype == 'turningpoint' or WPtype == 'turning point' or WPtype == 'turning_point' then wp.action = 'Turning Point' else wp.action = 'Turning Point' end end wp.type = 'Turning Point' return wp end What??? -
Any way to set parking spot when adding planes with coalition.addGroup ?
Kolyma replied to Kolyma's topic in Mission Editor
Ok to that. Again being new, I can see the benefit of the target zones for making the ME part manage the script instead of directly editing the script. For my simple, random traffic script, I just elected to pull the list of Red/Blue airbases that the user designated in the ME... BTW, have any quick thoughts on why my spawned AI never land at their one-and-only waypoint after taking off? They fly to the destination airbase, report RTB, and fly back to the start to land. -
Any way to set parking spot when adding planes with coalition.addGroup ?
Kolyma replied to Kolyma's topic in Mission Editor
Originally I was thinking I wasn't doing anything wrong in the script and it's just not possible to designate parking spots dynamically (or even statically) from within a script, although it is possible to do so from the ME. I knew I couldn't be the first person to try this, but didn't find any thread here saying it couldn't be done. Just found one talking about how you can only spawn an AI on the runway in single player mode; in MP it forces all AI to spawn off-runway due to unknown client interactions... Otherwise, I'm still curious as to why people are using "target zones over runways" to spawn AI units on the airbase instead of just pulling x/y info from the runway object itself? Anyone? -
Any way to set parking spot when adding planes with coalition.addGroup ?
Kolyma replied to Kolyma's topic in Mission Editor
149 views and zzzzzzzzzzzzzzzzzzzz... -
Any way to set parking spot when adding planes with coalition.addGroup ?
Kolyma replied to Kolyma's topic in Mission Editor
There was similar behavior. After each successive, randomly time-delayed, spawning of a new group, they would spawn into a slightly different, but predictable parking spot. So if one group had spawned in the starting parking spot (not the one I thought I'd chosen) and not launched yet, then the next would spawn in the spot next to it, but again, not the one I'd chosen. Here's the full script. Now this is just my first real attempt to make a lua/dcs script and I used a lot of the existing code from GCICAP20141017.lua and MIST3_2_RandAirtraffic_r6.lua The full text of those scripts was pretty hard to understand at all at once, so I just pulled out the parts I needed to start. All I wanted for now was a script that would randomly spawn a different aircraft at different times for each coalition from a random airbase. And then have that aircraft fly to and land at another random friendly airbase. Most of that works, but right now, the planes just fly to the destination, not land, and turn around back to the starting airbase to land. :( I tried to optimize and "collapse" some of the code I pulled from others into more reusable functions, arrays of parameters, and such. I'm still trying to get a grip on the proper use of Lua local and global variables... And from what I could tell, in those scripts of others I used, they were all using "zones over airbases" to define airbases. But I found that I could just pull the airbase x/y info from _spawnairbaseloc = Object.getPoint({id_=spawnIndex.id_}) Where _spawnairbaseloc is originally from a construct like the AF in: function getAFBases (coalitionIndex) local AFids = {} local AF = {} AFids = coalition.getAirbases(coalitionIndex) for i = 1, #AFids do AF[i] = { name = AFids[i]:getName(), id_ = AFids[i].id_, id = AFids[i]:getID() } end return AF end And for now, I omitted the random x/y offsets in those starting scripts from others. Attached is the full script. Thanks for the help! This is all very exciting. We've been playing DCS here a while with just the ME part. Using the scripts and witchcraft communicator is a lot of fun. :) Random_Flight_Plan_Traffic.lua -
Any way to set parking spot when adding planes with coalition.addGroup ?
Kolyma replied to Kolyma's topic in Mission Editor
Yeah, in the ME, it's real easy to set this before and of course, it works for me. What I'm asking about in the OP is if it's possible to set this value when I use a scheduled script (using mist) to spawn a new group like: ["points"] = { [1] = { ["alt"] = _alt, ["type"] = _waypointtype, ["action"] = _waypointaction, ["parking"] = _spawnairplaneparking, ["alt_type"] = "RADIO", ["formation_template"] = "", ["ETA"] = 0, ["airdromeId"] = _spawnairdromeId, ["y"] = _spawnairplanepos.z, ["x"] = _spawnairplanepos.x, ["speed"] = _speed, ["ETA_locked"] = true, ["task"] = { ["id"] = "ComboTask", ["params"] = { ["tasks"] = { }, }, }, ["speed_locked"] = true, }, When ["type"] = "TakeOffParking", ["action"] = "From Parking Area", ["parking"] = 30 It always spawns the first plane on the same spot and then if more than one spawns, they spawn nearby but never in the parking spot I assign. Help? -
I'm just starting scripting with mission building. I can't seem to find a definitive answer for this so I'll post a question. Is it possible to set the parking spot dynamic aircraft spawn into when using coalition.addGroup ? I see some of the sticky'd scripts here use the ["parking"] = setting but when I try to use it in my scripts, the planes seem to always spawn in the same location on an airport. And then successive, simultaneous planes spawn in another nearby location. TIA