Jump to content

Grimes

ED Beta Testers
  • Posts

    9613
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Grimes

  1. It is limitation programmed into the mission editor that doesn't reflect how the game actually handles things. There is no great way around it. You can use the scripting engine to spawn an infinite number of aircraft throughout the mission runtime, but that is a little complex for some. However it gives you control of specifying to re-use a specific parking spot or to rely on the automatic assignment. If it is a multiplayer mission you can use "takeoff from runway" which, when the mission is run in MP, will place the units at the nearest parking spot to the runway. 

  2. Patterns are not something I find to be all that fun. I assume you are wanting to use it as a command of sorts where a player enters it via chat or F10 mark and it uses the inputs to call a function? I use this to get each word added to a table, then I use the table itself to manipulate or check the data. commands[1] is the command being issued and commands[2] could be an optional value, if it doesn't exist then use some default value. 

    	local commands = {}
    	for w in string.gmatch(event.text, "%w+") do
    		table.insert(commands, w)	
    	end



    I suppose you could make a pattern for each of the 3 cases and use if string.match(obj, pattern1) or string.match(obj, pattern2) or string.match(obj, pattern3) then print("good") end 

     

  3. The server API has finer detail on it via the onPlayerChangeSlot callback. The net functions are accessible in the server API and mission scripting, which you can use net.get_player_list and net.get_slot to get the slot, and therefore seat the players are in. You'd have to constantly be calling it unfortunately to get up to date information. The slot id is the unit id for a given unit with a _x to define the seat a player is in. For example in a F-15E, F-14, and AH-64 it would be unitId_2 for the WSO/CPG. unitId_3 and unitId_4 would be left gunner and right gunner in the Huey. There is no information currently on who initiated a given action. For stats in slmod I attribute it to everyone in the aircraft. 

    • Thanks 1
  4. Its related to how events are used. This specific event will not be addressed, I hope they create a new one, but alas scripting priorities seem to exist in peaks and valleys and we seem to be in Kansas. It is not a new issue.


    I believe I've explained it in some of the other threads, so I will be brief. All of the events are used by the game to tell other parts of the game something happened. You can think of most events as a "global" event that occurs for every single player in the mission. shot, dead, crash, birth, etc. There are some events that are "local" to your game and only occur when you do something. Other clients, and the server, don't get told about it via the events. Your friend should have the player_enter_unit event in their debrief.log while you won't see it. The fact that some are local was not clearly indicated. 

    • Thanks 1
  5. Try the latest version of development branch: https://github.com/mrSkortch/MissionScriptingTools/tree/development

    If you were using that function to teleport the group, rather than clone or respawn, then it wasn't inheriting all of the possible variables for the group. If you were cloning or respawning it should have been respecting the hiddentOnMFD value in the editor. There is no specific option built into the function to set that hiddenOnMFD. It wouldn't take much to add one, but at the same time I should probably make a function that generates the group table without actually spawning the group. That way you can get the table, add what might be needed, and then spawn the group yourself. 

  6. IT

    IS

    A

    WIKI!

    They have disabled account creation because it is often a target of spam, but accounts can still be done by someone with admin access on it. All you have to do is ask. People make comments about this or that being missing*, very few of them actually ask for an account to contribute to the greater good, and even fewer actually make edits. 
     

    * 95% of the time it is generalities of things missing and not specific examples. If someone links to a wiki page when asking a question or I myself am doing something with scripting and notice the page could use more details then I try to fix it. 

    • Like 4
  7. Me being weird I don't like using world.searchObjects for getting a list of objects in an area, especially if that area is larger than a few km radius. However that mostly stems from the very noticeable hitch that can occur when searching for world objects over a densely populated area if the search area is large enough. 

    The other way would be to iterate a table of known units, see if they exist, and get the distance from a given point. Depending on your needs you can vary the speed. For example the bubble script on Grayflag has a curated list of units and weapons that it tracks. Objects get added and removed via event handler. It only runs getPosition on each object every few seconds, which means its not ultra precise, but it is precise enough. Each bubble, think of it like a trigger zone typically around sams, will check its distance against the known object list. Depending on that distance it'll reschedule the check to occur slower or faster because the point is to allow a sam to "exist" in the mission by only spawning it in when aircraft are near. Anyway if the bubble is spawning in a short range sam and the nearest unit is 100km away it doesn't exactly need to update at a faster rate just to know the nearest unit is now 99.4 km away.

     

    But no I haven't benchmarked it. I suppose it is a question of the distances involved and what information you care about. world.searchObjects on units will return all units, you'd have to sort for coalition and category if that mattered. Whereas if you only want to know which of 10 helicopters are in a zone it'll probably be faster to check the distance with a for loop and adding them to an table of in zone units. 

    • Thanks 1
  8. mist.teleportInZone("carrierGroup" , "newZone" , false , 1 , { offsetRoute = true} )

    Should do the trick. It'll teleport to the zone with the name "newZone". The radius is 1 so basically it'll be exactly on the center of the zone. It passes a table with the value offsetRoute = true which means it will grab the route from the mission, including any tasks assigned, and will offset the position of the points. If WP2 is straight east from WP 1 for 50km then it'll be offset 50km east from newZone. It doesn't check for any terrain issues, that'll be on you to make sure the offset waypoints are on land all a sudden. 

  9. 13 hours ago, Lekaa said:

    Hello, I have never used the Teleport function in mist and I wonder if I could run a teleport script function where i Teleport the carrier (where people spawn) to another Zone or a specific location in a zone if that zone is blue.

    Teleport should keep the unitId value for each unit, that is the main thing that matters when "teleporting" a ship or other objects that people spawn on. Just know that anyone on the ship when it spawns somewhere else will probably fall into the water. Unknown what'll happen to any static objects you have on the deck. 

  10. The annoying feature of datalink being locked to the group now no longer exists thanks to the datalink setting. Granted you'd have to set them up one by one if you were to limit aircraft to one per group. 

    Carrier recovery is weird as is anyway due to it occasionally being bugged and it always assumes that aircraft in a group are recovering together. Each player should still be able to do their own comms with the boat and you should still get correct grades if all contact the boat, do a case 1 as a group, and talk to the LSO. 

     

     

    • Like 1
  11. Ran it 100 times and got the following outputs. Left is the number and right is how many times it got selected.

     image.png

    nullJust showing to indicate that it is kind of random and the first selected item was always different for me. You could try increasing the range, random 0-100 with the flag ranges appropriately scaled might yield sufficiently random results. In the past the lua version of math.random had a tendency to randomly choose the first and last possible value much less often. Keep in mind I'm talking about running math.random 10000 times and see what the results were. Which doesn't quite jive with what you were experiencing here. 

    • Like 1
  12. Somewhere in the terrain files, probably in the AirfieldsTaxiways folder, defines all of the parking spots at each airbase. Parking availability is dependent on the length, width, and height of the parking spot and of the aircraft selected. 

    There is a https://wiki.hoggitworld.com/view/DCS_func_getParking function but it doesn't return the dimensions and the "term type" returned isn't exactly reliable to know the size of parking. 

  13. The condition wouldn't become true because the flag is back to 0 and therefor "off."

    I guess the question is if you want to know a flag has been true. If so then you could set an additional flag, or increase its value by 1, each time that the flag you care about was set. 

     

    set flag 1 true and flag increase "flag1WasSet" by 1. 

     

    Alternatively you can use scripting to exploit it further...

     

    do script: flagWasSet = timer.getTime()

    Would give the precise time the flag was set, you can then use that value for whatever purposes you want. 

    • Thanks 1
  14. 8 hours ago, Gunfreak said:

    So how do I limit range in ground to ground. Its not very realistic that they open fire at 2km with heavy machine guns in the middle of the night. When they don't have night optics

    You can change ROE or alarm state, then toggle whatever you set back to default. Problem being they won't engage anything else until triggered to do so. 

  15. As long as you are using pushTask and also not pushing a new mission task to the unit it *should* return to its orbit point once all pushed tasks it has is complete. If it was setTask then that task will overwrite any other task it has and I would expect the AI to return to base if they weren't given any other tasks. If you were giving it a new mission task then I would append a waypoint with the orbit task to the original orbit points so that it is part of the route. 

    • Like 1
×
×
  • Create New...