Jump to content

JedimasterLu

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks! I find a function called, LoGetModelTime() -- returns current model time (args - 0, results - 1 (sec)) and it do return the actual time!
  2. I'm trying to export data through Export.lua file. I read the example but couldn't find a function returning the velocity of all the units. Therefore, I wonder if I can manually calculate the velocity base on the difference between the position in each frame. In order to calculate the velocity, I have got to know the time between each simulation frames. Is it a constant value like 60? Or is it the actual FPS of the game? And are there other ways to get velocity of an object by its ID in Export.lua? Thanks for all the help!
  3. local gp = mist.getGroupTable("USAF") gp.clone = true local rndAlt = math.random(4, 10) * 1000 for i = 1, #gp.route.points do gp.route.points[i].alt = rndAlt end mist.dynAdd(gp) Thank you for your help. But I tried the script and it still didn't work. The game run without error message but the objects just keep on spawning at their original altitude. This is my settings in the trigger. The items in activation column are: do script file (mist_4_5_107.lua), do script file (a file of the code you offered), message to all (mark the begin of test), activate group ("USAF") and ("RUSAF"). At first I assume that 'activate group' is not needed since in the instruction of MIST, dynAdd() can directly spawn the group. But no group is spawned after I delete 'activate group'.
  4. I'm editing a BFM mission that require both sides to spawn at random altitude in order to simulate different situation. I found setAltitude() function from hoggitworld. However, the aircrafts keep on spawning at the altitude I set when placing them. It seems that I fail to use setAltitude() in the right way. The script is as follows and it shall activate once the mission start. So where am I wrong? And is there a better way to spawn objects at random altitude? By the way, I just name the groups after the countries they're from. Not intended.
  5. Thanks a lot! It finally works! I see. Haven't think of that in security aspect before lol.
  6. Recently I've been in a project using deep learning in air combat. And as a crazy player of DCS, it undoubtfully became my choice for simulation. In order to get mission records automatically, the mission needs to unpause itself when started, and I'm stuck on this step. I check the trigger in mission editor carefully and there is no action to unpause mission. So I try to write a lua script and I checked the official api file in \DCSWorld\API. To my pleasure, I found DCS.setPause() function. However, when I enter it in mission editor and start the mission, an error pop up, saying "attempt to index global 'DCS' (a nil value)". I have tried other functions in DCS api and some lua official api, for example io, and the error still occur (when using io api, the error become "attempt to index global 'io (a nil value)"). It seems that the mission script environment in DCS doesn't contain such api, so lua script cannot use those functions. But in "DCS_ControlAPI" file, it is clearly stated that those api are contained and ready for usage. How can I solve this error? Or are their other ways to automatically skip pause when mission starts?
×
×
  • Create New...