Jump to content

Kanelbolle

Members
  • Posts

    386
  • Joined

  • Last visited

Everything posted by Kanelbolle

  1. @DD_Friar The symbol in the column is a infinite symbol. It's for making single aircraft Unlimited, instead of using the the global unlimited checkbox. You can test this by setting all aircraft to 0 and check the infinite checkbox on 1 (keep the number at 0 on this aircraft as well) aircraft and run it as local server.. (if you are using dynamic slots)
  2. Hi, just tested if i can block players from joining a side with the a HOOK script using the Dynamic slots. The function "function sideCall.onPlayerTryChangeSlot(playerId, side, slotId)" does not seam to trigger if you select a dynamic slot, but does if i use regular slots. Is this a known issue and is it going to be fixed soon ? This hinders any PVE server from using the new slot system as is.
  3. Can't even block players with a hook script from joining RED, dynamic slots does not trigger the hook.onPlayerTryChangeSlot(number playerId, number side, string slotId ) Would be nice if this got fixed ASAP...
  4. Might also just try this as Grimes posted above: local groupName = 'tic1' if not Group.getByName(groupName) then mist.respawnGroup(groupName, true) end
  5. hehe, no worris im not an advanced coder, i try and fail a lot No idea if this even works, have no way of testing it, but might try this. local groupName = 'tic1' local groupData = mist.getGroupData(groupName) if not Group.getByName(groupName) then local _spawnedGroup = Group.getByName(mist.dynAdd(groupData).name) local _spawnedGroupName = _spawnedGroup:getName() mist.goRoute(_spawnedGroupName , mist.getGroupRoute(groupName, true)) end
  6. Not sure if immortal is preserved, but you can take a look at MIST getGroupRoute - DCS World Wiki - Hoggitworld.com There is a "task" parameter that can be set to True. Have not tested if this works.
  7. Hi! Mission start happens on mission start, it can not be combined with "time more". Something can't happen on mission start AND time more 30, they contradict each other. Use : Trigger1: Once Condition: Time More (30) Event: Message to all ("Event triggered") On the second part: If you want to check if the player has been within the condition you set, you can set a flag with action "FLAG ON", and check how long since it was set with Condition "TIME SINCE FLAG". Hope this helps
  8. Nah, its easiest way.. or you can learn DML, no scripting needed Never tried it tho..
  9. Yes, you can use scripting for this. Example is found here with MIST : https://wiki.hoggitworld.com/view/MIST_respawnGroup
  10. Think you are looking for any of the below: https://wiki.hoggitworld.com/view/MIST_cloneInZone https://wiki.hoggitworld.com/view/MIST_respawnInZone
  11. MOOSE version has a built in save and load function: flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Ops.CTLD.html If you don't want to use MOOSE, i made a script to save all ground and sea units including ctld units and the troop/units tables some time ago:
  12. I do not know the condition the script is launched so i do not presume what condition the code is executed. Only gave an example of how to schedule a function. What condition this code is launched under is up to OP. But yes, it will if just launched in a loop or in a way that do not take this in to account.
  13. Just use the schedule function: https://wiki.hoggitworld.com/view/MIST_scheduleFunction local respawnGroup = "RUS-T72B-6" if not Group.getByName(respawnGroup) then mist.scheduleFunction(mist.respawnGroup, {respawnGroup}, timer.getTime() + 120) end EDIT: See you posted it 2 places and you got the solution.
  14. From the DCS manual: CONDITION. The condition for the random spawning of a group in a mission. For this, LUA expressions used in the Simulator Scripting Engine Documentation are entered into the field. First, the initialization script should be loaded in the trigger panel. The script is executed before the mission is loaded and its result is used to set the conditions for the random group spawn. Page 190 DCS user manual (digitalcombatsimulator.com)
  15. Please take a look at the example mission. Most people trying the script don't realize how the script works. Example if you place units in the editor, they will always be there if you don't set them up correctly to only spawn the first time you load the mission. If you can't make it work, post your.miz file and I'll take a look at it.
  16. SPGG saves FOB's if you set it up to do so. But if you want static choppers you need to script that in to spawn. (If you are thinking of player choppers, then no, DCS does not allow this.) See the top of the script, you can find this: spgg.includeStaticObjectTypeTbl = { "outpost", -- THis is A FOB in CTLD "house2arm", "WindTurbine", "FARP Ammo Dump Coating", "FARP CP Blindage", "FARP Fuel Depot", }
  17. We are to used to not getting things like this until years and years are past, if at all. Posted a bug about the native airbase capture in multiplayer and took years for them to fix it. And they only fixed it after i informed a different script maker that there was a bug effecting his script.. .and magically the fix was introduced the next patch. Seam to be a priority if the right people complain. At least that is what it seam like in that case. At least it got fixed and that is good I just let others report bugs now.... i can't be bothered anymore.
  18. You can delete it your self by pressing Hide in the "Moderation Action" meny on top of this post.
  19. Here is an example that does the following: 1. Checks all airfields what coalition it is 2. Draws a circle at the airbase according to the coalition color 3. Changes the color if it changes coalition between Blue and Red. It does not, change if the airfields go Natural after it has been captured. You need a scheduled function to check this in a loop. Added a example mission and the script. Here is it raw. It's messy and old, but it an working example. ebc = ebc or {} -- do not remove function ebc.loadStartingBases() local baseCheckLoadeed = world.getAirbases() local myBaseLoadedTbl = {} for i = 1, #baseCheckLoadeed do local infoLoaded = {} infoLoaded.id = Airbase.getID(baseCheckLoadeed[i]) infoLoaded.desc = Airbase.getDesc(baseCheckLoadeed[i]) infoLoaded.point = Airbase.getPoint(baseCheckLoadeed[i]) infoLoaded.callsign = Airbase.getCallsign(baseCheckLoadeed[i]) infoLoaded.afcoa = Airbase.getCoalition(baseCheckLoadeed[i]) infoLoaded.afbase = baseCheckLoadeed[i] if (Object.getCategory(baseCheckLoadeed[i]) == 4) and (infoLoaded.desc.category == 0 ) then -- Creates circle on map with same id as Airfiled ID (If you have other drawings on map, you should change what id the drawing gets if (infoLoaded.afcoa == 0 ) then trigger.action.circleToAll(-1 , infoLoaded.id , infoLoaded.point , 6000 , {1,1,1,1} , {0,0,0,0} , 5) elseif (infoLoaded.afcoa == 1 ) then -- RED AIRBASE trigger.action.circleToAll(-1 , infoLoaded.id , infoLoaded.point , 6000 , {1,0,0,1} , {0,0,0,0} , 5) elseif (infoLoaded.afcoa == 2 ) then -- BLUE AIRBASE trigger.action.circleToAll(-1 , infoLoaded.id , infoLoaded.point , 6000 , {0,0,1,1} , {0,0,0,0} , 5) end end -- of if (Object.getCategory(baseCheckLoadeed[i]) == 4) and (infoLoaded.desc.category == 0 ) then end -- of for i = 1, #baseCheckLoadeed do end -- of function ebc.loadStartingBases() ebc.captureHandler = {}; function ebc.captureHandler:onEvent(event) if (world.event.S_EVENT_BASE_CAPTURED == event.id) then if event.place ~= nil then --trigger.action.outText("event not nil radiocargo!",20) local CapPlaceDesc =Airbase.getDesc(event.place) local CapPlaceId = Airbase.getID(event.place) local CapPlaceName = Airbase.getName(event.place) local CapAirbaseName if (CapPlaceDesc.category == 1) then CapAirbaseName = CapPlaceName else CapAirbaseName = CapPlaceDesc.displayName end local targetCoord = Airbase.getByName(CapAirbaseName):getPoint() -- Red Capped base if (CapPlaceDesc.category == 0 ) and (Object.getCategory(event.place) == 4) and (Airbase.getCoalition(event.place) == 1) then trigger.action.outText("Airbase was captured by Red coalition: " ..CapAirbaseName,20) -- local msg = string.format("Airbase ID : %i", CapPlaceId) --trigger.action.outText(msg , 10) -- Smoke trigger.action.smoke(targetCoord, trigger.smokeColor.Red) --Change Color of circle trigger.action.setMarkupColor(CapPlaceId , {1,0,0,1} ) -- Logg _airbaseIDString = string.format("%i", CapPlaceId) env.info('- Airbase was captured by Red coalition: ' .. CapAirbaseName .. ' - AirbaseID: ' .. _airbaseIDString) end -- of if (CapPlaceDesc.category == 0 ) and (Object.getCategory(event.place) == 4) and (Airbase.getCoalition(event.place) == 1) then -- Blue capped airbase if (CapPlaceDesc.category == 0 ) and (Object.getCategory(event.place) == 4) and (Airbase.getCoalition(event.place) == 2) then --CapAirbaseName = CapPlaceDesc.displayName trigger.action.outText("Airbase was captured by Blue coalition: " ..CapAirbaseName,20) -- local msg = string.format("Airbase ID : %i", CapPlaceId) --trigger.action.outText(msg , 10) -- Smoke trigger.action.smoke(targetCoord, trigger.smokeColor.Blue) --Change Color of circle trigger.action.setMarkupColor(CapPlaceId , {0,0,1,1} ) -- Logg _airbaseIDString = string.format("%i", CapPlaceId) env.info('- Airbase was captured by Blue coalition: ' .. CapAirbaseName .. ' - AirbaseID: ' .. _airbaseIDString) end -- of if (CapPlaceDesc.category == 0 ) and (Object.getCategory(event.place) == 4) and (Airbase.getCoalition(event.place) == 2) then -- Does not work since there is no event running on neutral -- Need to check this with a schedual or something if (CapPlaceDesc.category == 0 ) and (Object.getCategory(event.place) == 4) and (Airbase.getCoalition(event.place) == 0) then trigger.action.outText("Airbase is Neutral: " ..CapAirbaseName,20) env.info("Airbase is Neutral: " ..CapAirbaseName) end -- of if (CapPlaceDesc.category == 0 ) and (Object.getCategory(event.place) == 4) and (Airbase.getCoalition(event.place) == 0) then end --if event.place ~= nil end --if (world.event.S_EVENT_BASE_CAPTURED == event.id) then end --end ebc.captureHandler -- Run the first function to make the markers ebc.loadStartingBases() -- Start the monitoring of the event world.addEventHandler(ebc.captureHandler) env.info('EBC loaded!') test_ebc_v001.miz ebc-Example_001.lua
  20. Can see if i can get one of my scripts cleaned up to post this weekend
  21. To do Color you just use the color variable for the command: https://wiki.hoggitworld.com/view/MIST_markerAdd Example: vd.color = {1,1,1,1}
  22. Not that i know of, maybe look at all the available commands: https://wiki.hoggitworld.com/view/Simulator_Scripting_Engine_Documentation You have to keep track of the id's you crate if you want to delete them, as i showed you before, but you can put them all in a table instead of individual strings. See here: https://www.tutorialspoint.com/lua/lua_tables.htm I would highly recommend you start taking a LUA tutorial if you are going to code for DCS
  23. This is the getGroupPoints that gets this points from the waypoints of the group. It only seam to make polygons, not lines. Here is a quick and dirty example to make a drawing using a loop that gets a units route : function makeLineFromUnitRoute(_unitName) local test = {} local posTbl = {} local _last = nil test.pos = mist.getGroupPoints(_unitName) for k,v in pairs(test.pos) do env.info(v) if (k == 1) then _last = test.pos[k] env.info("Adding First off all pos: " .. test.pos[k].x) elseif (k ~= _last) then env.info("Pos: " .. k) env.info("Adding new pos: " .. test.pos[k].x) posTbl = { [1] = _last, [2] = { ["x"] = test.pos[k].x, ["y"] = test.pos[k].y, }, } local vd = {} vd.id = mist.marker.getNextId() vd.pos = posTbl vd.lineType = 1 vd.mType = 'line' mist.marker.add(vd) env.info("Made Line from point " .. k .. posTbl[1].x .. " to " .. posTbl[2].x) trigger.action.outText("Made Line to point " .. k , 10) _last = test.pos[k] end posTbl = {} end end makeLineFromUnitRoute('Ground-1')
  24. Ah.. your still trying to use the markers in the ME with code. As i said already, it seam to be bugged.. Just do it with code as i showed before.. See attached mission test-DrawingLines-.miz
  25. Can't seam to open your mission file. But do you have a unique id for all the markers ? Example if you do this: _mId1 =mist.marker.getNextId() _mId2 =mist.marker.getNextId() They will both get the same id. The getNextId() actively gets the existing id's and gets the next, so you have to create a drawing before calling it again.... You have to do it like this: -- Create Trigger Zones and get them by name here local _tZone1 = trigger.misc.getZone("L1Start") local _tZone2 = trigger.misc.getZone("L1End") local _tZone3 = trigger.misc.getZone("L2") -- Save the marker id to a variable for later _mId1 =mist.marker.getNextId() -- Create the line trigger.action.lineToAll(-1 , _mId1 , _tZone1.point , _tZone2.point , {1,0,0,1} , 1 , false) -- Save the marker id to a variable for later _mId2 =mist.marker.getNextId() -- Create the line trigger.action.lineToAll(-1 , _mId2 , _tZone2.point , _tZone3.point , {1,0,0,1} , 1 , false) You could also just put the ID's manually: -- Create Trigger Zones and get them by name here local _tZone1 = trigger.misc.getZone("L1Start") local _tZone2 = trigger.misc.getZone("L1End") local _tZone3 = trigger.misc.getZone("L2") -- Save the marker id to a variable for later _mId1 = 90001 -- Create the line trigger.action.lineToAll(-1 , _mId1 , _tZone1.point , _tZone2.point , {1,0,0,1} , 1 , false) -- Save the marker id to a variable for later _mId2 = 90002 -- Create the line trigger.action.lineToAll(-1 , _mId2 , _tZone2.point , _tZone3.point , {1,0,0,1} , 1 , false) But i would just do a integer variable that you count up every time. _midCounter = 90000 _midCounter = _midCounter + 1 _mId1 = _midCounter _midCounter = _midCounter + 1 _mId2 = _midCounter
×
×
  • Create New...