-
Posts
386 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Kanelbolle
-
Choose a side script
Kanelbolle replied to Shadeslayers09's topic in Scripting Tips, Tricks & Issues
Made one some time ago: -
SPGG - Simple Persistent Ground Groups Script
Kanelbolle replied to Kanelbolle's topic in Mission Editor
Depends if you are aiming to keep the saved Units from the last mission. (If it's the same map). If you don't want units from the last mission you can just clear the save file with : spgg.clearSavefile()- 89 replies
-
- 1
-
-
- save
- save groups
-
(and 2 more)
Tagged with:
-
SPGG - Simple Persistent Ground Groups Script
Kanelbolle replied to Kanelbolle's topic in Mission Editor
Yes, this is defined by "outpost" in the config section already (If you are talking about FOB's in CTLD) : -- All Static Objects with type names in this array will be included when saveing. (Not all types objects are able to be saved!) -- See list of types here: https://github.com/mrSkortch/DCS-miscScripts/tree/master/ObjectDB spgg.includeStaticObjectTypeTbl = { "outpost", "house2arm", "WindTurbine" }- 89 replies
-
- save
- save groups
-
(and 2 more)
Tagged with:
-
As far as i know you can not do this in multiplayer. The client group always have to be active. You can use slot blocking instead to block them from using the slot.
-
Reslot player on server
Kanelbolle replied to prestonflying's topic in Scripting Tips, Tricks & Issues
You can do this with a hook script using: net.force_player_slot(number playerID, number sideId, number slotId ) DCS func force player slot - DCS World Wiki - Hoggitworld.com You can have a look at the script "DCS-SimpleSlotBlock - Multiplayer Slot Blocking Script" to see how to work with slots : https://forum.dcs.world/topic/156844-dcs-simpleslotblock-multiplayer-slot-blocking-script -
Adjustable VR zoom levels ?
Kanelbolle replied to CougarFFW04's topic in Scripting Tips, Tricks & Issues
Might want to post this in the main forum https://forum.dcs.world/forum/119-dcs-world-28/ instead of in the Scripting part of the forum..... -
Might help: DCS server gameGUI - DCS World Wiki - Hoggitworld.com
- 1 reply
-
- 1
-
-
Update land.SurfaceType API function, to handle areas with trees
Kanelbolle replied to HC_Official's topic in Wish List
Yea, smart way of doing it... but should not be necessary... is amassing how little ED care about this issue.... -
Update land.SurfaceType API function, to handle areas with trees
Kanelbolle replied to HC_Official's topic in Wish List
And even SurfaceTypeScenery to avoid spawning inside buildings. -
You can do that to. But yea, the command is for Late Activation: https://wiki.hoggitworld.com/view/DCS_func_isActive Mission Scripting Function: isActive Added with: 1.2.0 Member Of: Unit Syntax: boolean Unit.isActive(Class Self ) Description: Returns a boolean value if the unit is activated. Units set to late activation would return false if checked by this function.
-
Save variables for After Server Restart
Kanelbolle replied to DarK_FeneR996's topic in Scripting Tips, Tricks & Issues
Here is a part of the Readme from my SPGG script: 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') anitizeModule('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 -
You can check a unit if it is active: if (Group.getByName(_GpName):getUnit(1):isActive() == false) then -- do stuff end
-
There is no way to add kneeboard for only a group. It is for all or a aircraft type. Easy way to add one:
-
Help with writing to a file.
Kanelbolle replied to AKA_Clutter's topic in Scripting Tips, Tricks & Issues
Look here how to write to files: Not sure if this works at all. : if io.open("C:\\Users\\Nathan\\Saved Games\\DCS.openbeta\\AKA_Test_File.txt","w") ~= nil then Should maybe be: if Test_File_Handle == nil then The file is not open at this point, so why are you checking if it is open and opening it again in the code below ? and you should have this at the end of the write. Test_File_Handle:close() Test_File_Handle = nil You can also see here for a lua example for checking if the file is open or not: https://stackoverflow.com/questions/28867248/lua-check-if-a-file-is-open -
SPGG - Simple Persistent Ground Groups Script
Kanelbolle replied to Kanelbolle's topic in Mission Editor
Update v024 : - Added various LateActivated options for save and spawn.- 89 replies
-
- save
- save groups
-
(and 2 more)
Tagged with:
-
Save variables for After Server Restart
Kanelbolle replied to DarK_FeneR996's topic in Scripting Tips, Tricks & Issues
Here is an example how to save and load a variable to/from files. LFS and IO need to be remove from sanitization , do this at your own risk and always sanitize them after you don't need it anymore. This is security risk if left desanitized ! test = {} test.workDir = = lfs.writedir() .. [[Scripts\]] test.saveFilename = "mysavefile.lua" test.saveFilePath = test.workDir .. test.saveFilename -- Writing the path to the save file used above to dcs.log env.info('-- TEST : SAVE Dir: ' .. test.saveFilePath) -- My variables test.myVariable = 0 test.myOtherVariable = 0 function test.load() -- Load the save file: (file must exist) assert(loadfile(test.saveFilePath))() end -- Call to change the variables or for testing! function test.changeVariables() test.myVariable = 1 test.myOtherVariable = 1 end -- call this function to save to file function test.save() wFile = io.open(test.saveFilePath, 'w') wFile:write('test = test or {}\n') wFile:write('test.myVariable = ' ..test.myVariable.. '\n') wFile:write('test.myOtherVariable = ' ..test.myOtherVariable.. '\n') wFile:close() wFile = nil end -
SPGG - Simple Persistent Ground Groups Script
Kanelbolle replied to Kanelbolle's topic in Mission Editor
Update v023 - Hotfix 1: Fixed: SPGG.lua"]:3492: attempt to index field 'wFile' (a nil value)- 89 replies
-
- save
- save groups
-
(and 2 more)
Tagged with:
-
My experience with trying to make dynamic missions and spawning units and objects on the map during the mission has it's limitations with the current functions available in DCS today. getClosestPointOnRoads is a good function for avoiding spawning on roads, but it would be very beneficial to have the same type of function for getting range from taxiways, ramps, and other airbase features. (even from the edge of scenery if possible) If you use "getSurfaceType" you might still have half of the unit/static object on the runway, taxiways or ramps. This has several benefits: 1. If you want to avoid units or static objects spawning halfway on runways, taxiways and ramps. 2. A lot easier for a mission creator to check this compared to trying to use trigger zones that are manually placed on the map. This functionality would be very welcome and beneficial to mission makers
-
My experience with trying to make dynamic missions and spawning units and objects on the map during the mission has it's limitations with the current functions available in DCS today. getSurfaceType should return if the spawn point is in/on a building/scenery. This has several benefits: 1. If you want to avoid units or static objects spawning inside buildings. (Big problem in city's when spawning units with scripts) 2. If you want infantry to spawn on top of a building. 3. A lot easier for a mission creator to check this compared to trying to use world.searchObjects for this purpus. world.searchObjects is not suitable for this task since it many times does not return the scenery in a zone at all and not reliable. This functionality would be very welcome and beneficial to mission makers
-
- getsurfacetype
- land.getsurfacetype
-
(and 1 more)
Tagged with:
-
SPGG - Simple Persistent Ground Groups Script
Kanelbolle replied to Kanelbolle's topic in Mission Editor
Update v023: Added spawning with selected type of livery's for ground units- 89 replies
-
- 1
-
-
- save
- save groups
-
(and 2 more)
Tagged with:
-
SPGG - Simple Persistent Ground Groups Script
Kanelbolle replied to Kanelbolle's topic in Mission Editor
Update v022: Added saving of Group and Unit Id of units. You can now spawn them back with the same ID. (See: spgg.ReuseID) (WARNING : Do not turn on if you have a old save file. Start the mission first with "false", let spgg save. Then change this to "true") Included the Natural groups in saving process. See readme for commands. Changes to save function to use less code.- 89 replies
-
- save
- save groups
-
(and 2 more)
Tagged with:
-
Mist already stores this in : mist.DBs.drawingByName["nameofdrawing"] Points seam to be stored as .points[u] If you open MIST and go to line 138, you will see how it stores all the info on drawings.
-
Glad i can help. If you open the .miz file as a .ZIP file you can open the "mission" file inside. It will contain all your drawings and it's id's. Don't have an example to find it, but they are in there somewhere. Or you can open the MIST script and find the function "mist.marker.getNextId()" and see how it checks for the next id. But this is hard if you don't know scripting. But think you can get them all out with : for key,value in pairs(mist.DBs.markList) do trigger.action.outText('- Mark ID: ' .. key , 120) -- To text window env.info('- Mark ID: ' .. key ) --To LOG file end
-
I might have an error in the code, have not tested it or am able to now. But you can download my example mission here, it should work: