Jump to content

Kanelbolle

Members
  • Posts

    386
  • Joined

  • Last visited

Everything posted by Kanelbolle

  1. There are many ways to solve this. You can example make a table of all your zones and ID's. zonesTbl = {} -- global table local myzoneid = 1005 -- unique id local myzonename = "CYPRUS NORTH" -- Zone name local tmpzoneTbl = {} -- temporary table to store values tmpzoneTbl.zonename = myzonename tmpzoneTbl.markid = myzoneid tmpzoneTbl.someotherinfo = "something" local dzvars = { id = myzoneid, ignoreColor = true, markForCoa = "all", color = {1,1,0,1}, fillColor = {255,255,0,.2}, lineType = 2, readOnly = true, } mist.marker.drawZone(tmpzoneTbl.zonename, dzvars) zonesTbl[tmpzoneTbl.zonename] = tmpzoneTbl Then if you want to change that marker for the zone later: if (zonesTbl["CYPRUS NORTH"]) then -- check if the table has the KEY before trying to use a value from it. trigger.action.setMarkupColor(zonesTbl["CYPRUS NORTH"].markid , {0, 128, 255, .2} ) end This is just an example how you can do it.
  2. Probably the the ID of the shape you are trying to change that is not correct. Try to Hard code it: local myzoneid = 1005 local dzvars = { id = myzoneid, ignoreColor = true, markForCoa = "all", color = {1,1,0,1}, fillColor = {255,255,0,.2}, lineType = 2, readOnly = true, } mist.marker.drawZone("zonename", dzvars) trigger.action.setMarkupColor(myzoneid , {0, 128, 255, .2} ) Not sure you can use the 12 in "{0, 128, 255, 12}" As far as i know it is a value between 0 and 1 Edit: There is also a bug in DCS that sometimes you need to zoom on the map to get the updated color. Also sometimes the shapes disrepair, then you need to leave the slot and select it again. At least in multiplayer.
  3. lua is Case sensetive. should be "trigger.action.setMarkupColor(number id , table color )" You don't need "local" in front of it. I would recommend starting with a Lua beginners guide if you are going to script in DCS. There are many if you google it. You will avoid a lot of headache if you know the basics
  4. I have successfully reproduced it in a new fresh mission. 1. Started a Fresh Chaucasus mission. 2. Placed 1 Blue Aircraft on a Airfield (Tested in air to, same result). 3. Copy the aircraft, and past it until i get to Callsign Tusk 9 - 1. And it stops responding. Have tried this several times now and gives the same result. The game does not close or seam to give any reason in the log file. Just stops responding and you can click in on the DCS window and you get the option to Wait or Close by Windows. I have included a test mission here that stops right before Tusk 9 - 1. Just open it and copy 1 of the aircraft, and start to past it and DCS should crash. I do not get this crash if i copy past RED aircraft. test_copy_past.miz
  5. You copied it before i cud fix it. it should be id = myzoneid,
  6. Here is a example: local myzoneid = mist.marker.getNextId() local dzvars = { id = myzoneid, ignoreColor = true, markForCoa = "all", color = {1,1,0,1}, fillColor = {255,255,0,.2}, lineType = 2, readOnly = true, } mist.marker.drawZone("zonename", dzvars)
  7. You don't find it. You just put one in that is unique. Exampel if you don't any in the mission you can start on 1. If you have others, you can example start as 2000. Or you can get the next available one with mist.marker.getNextId()
  8. Look here for an example. Main thing i see you are putting a name to the ID, it should be a unique number. (not "CYPRUS NORTH") I have a example in the post aswell how to do a simple circle and change the color.
  9. IF you don't want to remove the marker and just change the color with: trigger.action.setMarkupColor trigger.action.setMarkupColorFill (Just search for the commands on the same page) No need to remove them if it's not what you want to do. Only thing you need to store what ID the shapes have, so you can change the correct one.
  10. no, it draws the type you are using. see the description on the page: Description Function will use a zone as defined in the editor as a basis for a shape drawn on the map. By default it will inherit the color the user chooses for the zone. Any valid entry for mist.marker.add will be inherited by the shape.
  11. If you use MIST, you can draw a trigger zone with : mist.marker.drawZone MIST markerDrawZone - DCS World Wiki - Hoggitworld.com
  12. Hi! First off, this is the wrong section of the forum for this question. I only run DCS in Full screen Window mode / Borderless Window mode. Works just fine. jackd : If you are running "Borderless Window mode" you need to have a different window open also simultaneously, like the Windows explorer or a Web browser to use ALT+TAB. If you don't you need to use the "Windows" (Between CTRL and ALT on the left side) button to get the Start-Menu open and then start a different program to ALT+TAB to.
  13. This makes sense since i have A LOT of Aircraft units in the mission. And every player group is just 1 aircraft since, DCS does not support Radio menus for each separate plane. Just weird that it is not a problem in the previous OB builds.
  14. No, was copying everything from a Huey to a F-16. No Warbirds. But it works perfectly fine if i start a NEW fresh mission and place units. Then copy them. Seam to be only missions i had before the update. I will do some more testing later. There are a lot of units in my missions, so want to test with a old mission with less units, to see if its the amount of units that crash it.
  15. After the last update the game stops responding many times when trying to copy and past units (Mainly Aircraft). Seam random at best. Sometimes i can copy a unit and sometimes i can't. Was not a issue before "DCS 2.8.5.40170 Open Beta" Can not see any relevant info in the LOG file but have included it. Tried MT and regular DCS. Tried Repair (Slow) and clenup. Also tried a fresh DCS profil folder. Does not help. Changed back to version "2.8.4.39731" and it does not crash anymore when copy and pasting. dcs.log
  16. If you want it to the log file: local base = world.getAirbases() local myBaseTbl = {} for i = 1, #base do local info = {} info.desc = Airbase.getDesc(base[i]) info.callsign = Airbase.getCallsign(base[i]) info.id = Airbase.getID(base[i]) info.cat = Airbase.getCategory(base[i]) info.point = Airbase.getPoint(base[i]) if Airbase.getUnit(base[i]) then info.unitId = Airbase.getUnit(base[i]):getID() end -- Write Airbase name to DCS logfile env.info(info.callsign) -- See it in the text window in DCS trigger.action.outText(info.callsign , 10 , false) myBaseTbl[info.callsign] = info end If you want it to a separate file you can use LUA IO local mypath = [[C:\Log\]] local myfilename = "logout.txt" -- Open file wFile = io.open(mypath .. myfilename, 'w') local base = world.getAirbases() local myBaseTbl = {} for i = 1, #base do local info = {} info.desc = Airbase.getDesc(base[i]) info.callsign = Airbase.getCallsign(base[i]) info.id = Airbase.getID(base[i]) info.cat = Airbase.getCategory(base[i]) info.point = Airbase.getPoint(base[i]) if Airbase.getUnit(base[i]) then info.unitId = Airbase.getUnit(base[i]):getID() end -- Write Airbase name to file and a new line (\n) wFile:write(info.callsign .. '\n') myBaseTbl[info.callsign] = info end -- Close the file wFile:close() wFile = nil How to remove sanitizeing of LFS and IO Step 1 - Removing LFS and IO sanitation It is not recommended to use this script if you are not aware of the risks of using “lfs” and “io” in DCS lua scripts. Scripts can access your filesystem if you enable LFS! This functionality is off by default in DCS to protect the players from malicious code. Use at your own risk! Enable “lfs” and “io” in DCS Game Folder -> disk:\DCS World OpenBeta\Scripts\MissionScripting.lua Change from: do sanitizeModule('os') sanitizeModule('io') sanitizeModule('lfs') _G['require'] = nil _G['loadlib'] = nil _G['package'] = nil end Change to: do sanitizeModule('os') --sanitizeModule('io') --sanitizeModule('lfs') _G['require'] = nil _G['loadlib'] = nil _G['package'] = nil end Remember to change this back when you are not using this to get out data. You should never join a Multiplayer server or missions you did not make your self with sanitizeModules!
  17. Look here for functions and script examples: https://wiki.hoggitworld.com/view/DCS_func_getRunways https://wiki.hoggitworld.com/view/DCS_func_getAirbases
  18. If the audio files are implemented in to the .miz file (not running from a folder on the disk), they are in the .miz file under path: \l10n\DEFAULT\
  19. Hi! FARP's can not be retrived with the function "coalition.getStaticObjects". DCS does not support the retrial of this object if it is spawned mid game. FARPS only show up in "env." and this can not be modified after mission start. This is also the same reason i can not save the routs and tasks of units after spawning a unit mid game, it is just not supported by DCS. You can place out Static objects on the map in ME and get the list of objects with the below code and see if the object you placed is possible to save. Just put it in a Trigger in the ME with a action "DO SCRIPT" with a "TiME MORE" condition. -- 1 = RED, 2 = Blue local coa = 2 for i, so in pairs(coalition.getStaticObjects(coa)) do if so ~= nil then local _SoName = StaticObject.getName(so) if (StaticObject.getByName(_SoName)) and (StaticObject.isExist(so)) then env.info('-- Found Static Object: ' .. _SoName) trigger.action.outText("Found Static Object: " .. _SoName, 20) end end end
  20. Update v021: Changed the script from 3 files to 1 file. (Installation is changed, please see the installation part in the readme!) Updated example mission files with drawings and briefing text. Made Backup saving optional. (Default off) Added check if save file is present or not. You can now just delete the save file if you want to reset the save file.
  21. You can do the exlude names way or you can just not spawn the red units back.. Example if you want to spawn back all units you run this at the start of the mission: spgg.spawnBlueGroundGroup() spgg.spawnRedGroundGroup() spgg.spawnBlueStaticObject() spgg.spawnRedStaticObject() spgg.spawnBlueSeaGroup() spgg.spawnRedSeaGroup() spgg.findAndAddSamSystems() If you want only Blue units you just do this instead: spgg.spawnBlueGroundGroup() spgg.spawnBlueStaticObject() spgg.spawnBlueSeaGroup() spgg.findAndAddSamSystems() Or just: spgg.spawnBlueGroundGroup() spgg.findAndAddSamSystems()
  22. Hi! Yes this is possible. You can name all other units with a starting name that is exuded from the saving function. See SPGG.lua for this table: -- All groups names beginning with strings in this array will be excluded from saveing. _tblExcludeGroupName = { "AF_", "StandAlone_", "SA_Convoy_", "Clone_", "Build_", } All you have to do is add a starting string you want to exlude, like one of the examples already in the list and name your Groups according to it. Example if you use the list above and add a group named "Clone_12345_Group-1", the group will be exuded from being saved.
×
×
  • Create New...