Jump to content

Zayets

Members
  • Posts

    312
  • Joined

  • Last visited

Everything posted by Zayets

  1. Yep, that worked a treat. Good to know that first point in the route table is not actually the initial point, at least on spawning. All is working as expected, even with On Road option. Many thanks again, drinks on me next time!
  2. Thanks Grimes for your time. Did the necessary change and a slight difference in units behavior occurred. Group is not stopping and it looks like it goes to point 1 in route. Unfortunately it does not spawn in point 1 as I wanted, it acts like the group receives a go to route command from the point in which is spawned (which is not point 1). Well, i guess I will have to go for other approach, I am thinking to use clone in zone and then assign a go to route command. Maybe this will work better in this case. As for the function being called twice, I got lazy when testing and leave it that way. Again, thanks for the check. It looks like I modified the script but not reloaded in the mission, that's why you ended up with the wrong file.
  3. You simply can't pass info between two separate missions directly in DCS. You can do a sort of save file from which a next mission would pick some details though but it won't be a walk in the park.
  4. S_EVENT_LAND https://wiki.hoggitworld.com/view/DCS_singleton_world
  5. Route is given by using group.route = table route at the time the the table needed to dynAdd the group is created. Basically I am passing before dynAdd is created. Basically, this is the function local groupPrefix = 'XGRP' local unitPrefix = 'XUNI' function DeepPrintTable(e) -- if e is a table, we should iterate over its elements if type(e) == "table" then for k,v in pairs(e) do -- for every element in the table print(k) DeepPrintTable(v) -- recursively repeat the same procedure end else -- if not, we can just print it env.info(e) end end function generateVehiclesRoute() local startPoint = {} local endPoint = {} -- Decide if they will move off(0) or on(1) road local routeChoiceRandom = mist.utils.round(mist.random(0,1)) -- Pick one zone to spawn the group local pickedZone = 'SpawnGround_' .. mist.utils.round(mist.random(1,6)) if routeChoiceRandom == 0 then startPoint = mist.getRandomPointInZone(pickedZone) endPoint = mist.getRandomPointInZone(pickedZone) routeChoice = "Off Road" else local nearestRoadStart_x, nearestRoadStart_y = land.getClosestPointOnRoads('roads',mist.getRandomPointInZone(pickedZone).x, mist.getRandomPointInZone(pickedZone).y) local nearestRoadEnd_x, nearestRoadEnd_y = land.getClosestPointOnRoads('roads',mist.getRandomPointInZone(pickedZone).x, mist.getRandomPointInZone(pickedZone).y) startPoint = {nearestRoadStart_x, nearestRoadStart_y} endPoint = {nearestRoadEnd_x, nearestRoadEnd_y} routeChoice = "On Road" end local vehiclesRoute = { [1] = { ["alt"] = 66, ["type"] = "Turning Point", ["ETA"] = 0, ["alt_type"] = "BARO", ["formation_template"] = "", ["y"] = startPoint.y, ["x"] = startPoint.x, ["name"] = "STA", ["ETA_locked"] = true, ["speed"] = 5.5555555555556, ["action"] = routeChoice, ["task"] = { ["id"] = "ComboTask", ["params"] = { ["tasks"] = { }, -- end of ["tasks"] }, -- end of ["params"] }, -- end of ["task"] ["speed_locked"] = true, }, -- end of [1] [2] = { ["alt"] = 64, ["type"] = "Turning Point", ["ETA"] = 164.7057218182, ["alt_type"] = "BARO", ["formation_template"] = "", ["y"] = endPoint.y, ["x"] = endPoint.x, ["name"] = "END", ["ETA_locked"] = false, ["speed"] = 5.5555555555556, ["action"] = routeChoice, ["task"] = { ["id"] = "ComboTask", ["params"] = { ["tasks"] = { [1] = { ["enabled"] = true, ["auto"] = false, ["id"] = "GoToWaypoint", ["number"] = 1, ["params"] = { ["fromWaypointIndex"] = 2, ["nWaypointIndx"] = 1, }, -- end of ["params"] }, -- end of [1] }, -- end of ["tasks"] }, -- end of ["params"] }, -- end of ["task"] ["speed_locked"] = true, }, -- end of [2] } return vehiclesRoute end function generateVehiclesModel(modelType) local vehiclesGroupId = mist.getNextGroupId() local vehiclesGroupName = groupPrefix .. '-' .. vehiclesGroupId if modelType == 'easy' then groundModel = mist.getGroupData('easyGroundModel') env.info('Easy Ground:' .. #groundModel.units) elseif modelType == 'medium' then groundModel = mist.getGroupData('mediumGroundModel') env.info('Medium Ground:' .. #groundModel.units) elseif modelType == 'hard' then groundModel = mist.getGroupData('hardGroundModel') env.info('Hard Ground:' .. #groundModel.units) end groundModel["clone"] = true groundModel["route"] = generateVehiclesRoute() groundModel.groupId = vehiclesGroupId groundModel["groupName"] = vehiclesGroupName local vehiclesUnitId = mist.getNextUnitId() for i = 1,#groundModel.units do groundModel["units"][i]["name"] = unitPrefix .. '-' .. vehiclesUnitId groundModel["units"][i]["groupId"] = vehiclesGroupId groundModel["units"][i]["groupName"] = vehiclesGroupName vehiclesUnitId = vehiclesUnitId + 1 end return groundModel end
  6. If you add the units manually in ME this should not be a problem as you can avoid placing them in the forest areas. If you want to spawn them automatically, your best bet would be to create some spawn zones which are not in forest areas (or building areas).
  7. Hi Grimes,attached the mission for test. I am having one group with late activation and getting the group model from it. Then I assign the route on the fly and modifying the route points in the process. Group spawns alright but at the initial location of the group I take the model from even if the route points is different. Group just spawns , moves for about one minute and then stops, mind you from the initial location not the one I gave it in the route table. tst.miz
  8. None will work at this time.
  9. Not in ME. You can, in theory merge .miz files after you set some rules and then make sure files such as warehouse or i10 folders are modified accordingly. Quite some work but maybe someone can see a great deal in it. Personally, I prefer to plan carefully before starting Sent from my iPhone using Tapatalk
  10. Or you can clone it on the fly with cloneGroup https://wiki.hoggitworld.com/view/MIST_cloneGroup
  11. There's a significant impact when using addGroup function of the SSE especially if you want to create new route points within the group table. Most notably with ground units. If you just spawn the group and after that you assign a route there's no visible impact. On the other hand, if you use spawn functions from MIST (and I assume MOOSE as well) these already take into consideration this aspect.
  12. you can get around adding a tail number by creating a skin for the static object but I believe there's too much trouble for such a small feature
  13. Unfortunately you can't make it hidden, only invisible to AI. I could not access hidden property of an object already spawned. Yes, thousand thanks to Grimes/Speed for MIST. I would like to repay them somehow, maybe enhancing the documentation which is really brief, maybe adding some working examples for the functions and so on. MIST saved me writing many lines of code as well, many functions I wanted to create were already there.
  14. Thanks Grimes. Figured it out myself through many tries that clone gives a new name and a real new group in the mission. Basically that was what I missed from my function call. While we are at it, assigning a route to a newly created group is possible only through goRoute() function? WHich means that the group must be spawned?
  15. Right, I see there's no answer to my question above which probably is my fault being too specific. I have played more with dynAdd function and noticed that if I add a new group based on a model = getGroupData('MyGroup') model and then dumping the mist.DBs to the log both mist_DBs_groupsByName.lua and mist_DBs_MEgroupsByName.lua I notice they are identical. Moreover, mist_DBs_dynGroupsAdded.lua is empty. That despite the fact that I see the new groups on the F10 map and funny enough they have the new group name I have assigned them using model["groupName"] = 'NewGroup'. Which brings me to my question: what does clone supposed to do in the function call? Is this what I need to see the new group being created in the mist.DBs.groupsByName? mist.dynAdd{ units = table unitsTable, country = string/number countryName/countryIndex, category = string/number categoryName/categoryIndex, name or groupName = string groupsName, groupId = number groupId, clone = anything clone, } If so, how do I do that? Simply by assigning model["clone"] = true? I am asking because there's no example in the mist.DBs.groupByName Thanks in advance!
  16. You can achieve this very easily with MIST function mist.flagFunc.units_in_moving_zones(table vars ). When you pass units table parameters just give it [blue] or [red] and you are set. https://wiki.hoggitworld.com/view/MIST_units_in_moving_zones
  17. Here's a question for Grimes, hope you have time to check if is true or not. I am writing the next sequence: local groupData = mist.getGroupData('MyGroup') groupData.groupID = newGID groupData.groupName = 'New Name' groupData.units[1].unitId = newUID groupData.units[1].unitName = 'New Unit' groupData.units[1].groupName= 'New Unit' groupData.units[1].groupId=newGID mist.dynAdd(groupData ) Everything works beautiful, checking on F10 map group name is the new name. I can't see the unit name but I can extract it and it looks ok. Problem comes when I want to pick up the group coming from the unit itself local findGroupName = Unit.getGroup(myUnit):getName() This returns the name of the initial group MyGroup and not New Name. Is there something I missed here? Ta
  18. Speed will depend on what type of measurement units you have set in the game (Kts, kmh). Altitude is meters apparently but I am not 100% sure about it. I know it was speed m/s and meters before.
  19. Note that setting the invisible tag will not make it hidden on the map. It will just make it invisible to the AI units. If that's what you want, then you are set. If not then you will have to manipulate the hidden property on a new object. Is not working on active groups/units. https://wiki.hoggitworld.com/view/DCS_command_setInvisible Description: Sets the controlled group to be invisible to other AI forces. Note they can still be hit through sheer luck, AI will not actively target this group.
  20. invisible tag makes them hidden to AI. Hidden tag (hidden on map) makes it invisible on the map. I am not sure you can alter the later outside ME. You can read it but I haven't seen any function which can alter it. You can however alter this parameter when you spawn a new group/unit but once you set it, you can't modify the property
  21. I agree with the fact that briefing for campaign and missions can include more elements such as video briefing or at least a different format for the mission map and objective. Personally, I still struggle with the logic of how campaign missions are advancing or going back to stages.
  22. I don't think that will stop LDT running MOOSE, intellisense is working just fine. Played last night with framework config as per Youtube or documentation (btw, I believe MOOSE needs a refresh of the framework install and setup as there are couple of different ones, doc, youtube etc) and noticed that launching first example mission failed with error it could not find EVENT (basically first line) something did not loaded. I can of course continue but just realized how easier to work with MIST is.
  23. Yeah, that's the problem with Moose, installing the framework is sometimes prone to little inconveniences. For example, once I created the initial project and added Moose Development as project path it gave me 5 Build module errors. Hope is nothing serious.
  24. You can also try with event dead but this will return which unit is dead (that's because Group class is not a child of Object) so you will still have to cycle through group units. The advantage, if there is one, is that you can get the group having that unit destroyed without any doubt. However, you will have to keep somewhere the information that one unit from that group was destroyed and make the calculations to see if other units are still alive or not. My little script (as long as you pass the correct group name) will tell you without a doubt if the group is dead or not. I can make you a mission to prove it but right now I try to install moose framework to give it a whirl, see how it goes.
  25. I'm afraid there's no function IsAlive() in the scripting engine. Funny stuff, I was convinced there's one but could not find it in the whole documentation. As for the dynamically spawned groups, most probably you pass the function an invalid name because all my groups are spawned dynamically and function works perfectly. I am not sure how you pick the spawned group name to be fair though. EDIT: by scripting engine I mean, of course, DCS scripting engine library. There are functions in MIST (mostly flag checking ones where a group health is evaluated). Not sure about other scripting tools though.
×
×
  • Create New...