Grimes Posted November 6, 2013 Posted November 6, 2013 Eno, the transport.dll issues seem to be a larger crash within the sim. There is a substantial bug report on it already and I've added the relevant details of dynamical spawned units causing crashes when given orders to the report. I'm not sure if there is anything I can do to lower the chances of it crashing on dynamically added groups. David, as long as the aircraft are given their task, then yes they should engage one another. respawnGroup('whatever', true) The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
m9matt Posted November 6, 2013 Posted November 6, 2013 Hi Grimes, Can you explain how they are given this task. I've been looking at this respawning. I've managed to respawn an aircraft, but he just lands.
Grimes Posted November 6, 2013 Posted November 6, 2013 It grabs the waypoints set for the group in the mission editor and then gives the group a new mission task with that route information. The second variable with the function is the most important as it defines whether or not to assign the route. If the variable is a number it assigns the route after X seconds, otherwise it will immediately assign the route. http://wiki.hoggit.us/view/RespawnGroup The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
ENO Posted November 6, 2013 Posted November 6, 2013 Thanks Grimes... all that's left is to hope they fix it soon. Welcome back, by the way! "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
St3v3f Posted November 6, 2013 Posted November 6, 2013 do "respawned" planes now finally attack enemy planes?or are they still only following their assigned waypoints, ignoring other threats? i tried to build a mission a few days ago, but the respawning plane seemed to ignore me totally...im just wondering, if ive done something wrong, or if its still a bug/missing feature, with mist 3.2 Try assigning them tasks like CAP or Fighter Sweep after you've spawned them with aka: Baron [sIGPIC][/sIGPIC]
9.JG27 DavidRed Posted November 6, 2013 Posted November 6, 2013 well, how do i assign them tasks after they have respawned? i did give the first plane a task...start on route task-engage for example...and the first plane actually does engage me,...but once its shot down, and it respawns, it will follow the waypoints i gave it, and ignore me completely...
m9matt Posted November 6, 2013 Posted November 6, 2013 (edited) Thank you Grimes. Does it have to be 120 seconds, can it be 2 seconds for example, or does it need time to settle down? if not Group.getByName('groupName') then mist.respawnGroup('groupName', 120) end I'm assuming it is only taking the Waypoint tasking that is getting assigned after 120 seconds, and not the aircraft task, such as CAP, CAS or Ground Attack, for example? Like DavidRed said, how do you assign the task (if this is waypoint task or aircraft task), if you wanted to change? The respawning script interests me, as DCS World can seem quite an empty world. If there is a constant stream of aircraft at different times during a mission, then it may make it look more like real life, and thus more interesting for the clients entering the server. I must say your work on Mist and the Lua scripting is in invaluable. Edited November 6, 2013 by m9matt
Grimes Posted November 7, 2013 Posted November 7, 2013 Follow the guide... Items in blue are required variables, green are optional. mist.respawnGroup('groupName') -- simply respawns the group with no task info. If its ground forces they will engage stuff, but if its aircraft they will ignore targets. mist.respawnGroup('groupName', true) -- embeds the route information to the group so that once the group spawns it will immediately do the route. This includes all task data with each waypoint. mist.respawnGroup('groupName', 5) -- if the 2nd variable is a number, then the default route will be assigned to the group after however many seconds you put in there. The number value has to be any number greater than 0. For instance 0.1 would work... but if you want to assign it right away anyways, just set the value to true. I tested it out in singleplayer and respawning AI do attack one another and myself providing the task information is there. David, the get the controller you simply need the groups name... local con = Group.getByName('whatever'):getController() From there you can create a mission task which is basically a table that shares most of the same formatting as a route in the mission file. From there you can set or push the task to the controller. con:pushTask(newTask) The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Fishbreath Posted November 7, 2013 Posted November 7, 2013 Is there any way to combine the cloneGroup(group, boolean task) and cloneInZone(group, randomZoneTable...) mechanisms for aircraft? I tried cloneGroup first and passing the spawned group name to teleportInZone, but the AI pilots uniformly ejected after they were teleported. Black Shark, Harrier, and Hornet pilot Many Words - Serial Fiction | Ka-50 Employment Guide | Ka-50 Avionics Cheat Sheet | Multiplayer Shooting Range Mission
Grimes Posted November 7, 2013 Posted November 7, 2013 Teleporting aircraft isn't really supported due to what is available within the scripting engine. For starters "teleportation" in the game doesn't exist. My script takes data on the group and spawns a new group best matching the old groups properties. If its done on AI ground forces then they will be automatically resupplied and start out at max HP, but dead units from the group will not be spawned. Unfortunately for aircraft there is a rather bothersome issue concerning fuel and weapons currently onboard the aircraft. The scripting engine has access to the current fuel load, but it is defined as 0.0 to 1.0 with any value over 1.0 indicating that fuel tanks are used and fuel is present in those tanks. Weapons return a simplified data for the number of each weapon type on board, the problem with that is it lacks pylon information. The overall issue with that is that in order to spawn aircraft the fuel value given is in liters (or kilograms) and the "live" payload data isn't in the same format as what is required "mission editor" format. The reason clone and respawn functions work with aircraft is because it grabs the data from the mission file itself, thus it has all of the "right data" to start off with. You should be able to use mist.cloneInZone and then use mist.getGroupRoute and mist.goRoute to achieve what you desire... http://wiki.hoggit.us/view/GetGroupRoute local newGroup = mist.cloneInZone('gp1', 'zone1') mist.goRoute(newGroup.name, mist.getGroupRoute('gp1')) I thought of adding "task" data to the 'inZone' functions but ultimately decided against it in favor of future functions for manipulating route data or a more specialized functions for aircraft. 1 The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Cougar Posted November 7, 2013 Posted November 7, 2013 (edited) Taking your example code of teleport in zone and schedule function from the wiki....is there any way to keep the initoal heading of the units when its teleported? Units change heading if I teleport it to different zone every 5 seconds for example. Edit got workarround using respawninzone instead... Edited November 7, 2013 by Cougar
Fishbreath Posted November 7, 2013 Posted November 7, 2013 <snip> The reason clone and respawn functions work with aircraft is because it grabs the data from the mission file itself, thus it has all of the "right data" to start off with. You should be able to use mist.cloneInZone and then use mist.getGroupRoute and mist.goRoute to achieve what you desire... http://wiki.hoggit.us/view/GetGroupRoute local newGroup = mist.cloneInZone('gp1', 'zone1') mist.goRoute(newGroup.name, mist.getGroupRoute('gp1')) I thought of adding "task" data to the 'inZone' functions but ultimately decided against it in favor of future functions for manipulating route data or a more specialized functions for aircraft. Okay, thanks. That's the last piece I needed for the fighter range component of my most recent project—it's a little dull if the targets all come from exactly the same place every time. Black Shark, Harrier, and Hornet pilot Many Words - Serial Fiction | Ka-50 Employment Guide | Ka-50 Avionics Cheat Sheet | Multiplayer Shooting Range Mission
ENO Posted November 26, 2013 Posted November 26, 2013 I have vehicles getting bound up on bridges- and the groups they're affiliated with are stopping at the end of their routes instead of doubling back. If a vehicle gets killed, I imagine that the group continues... but are they holding at the end of their routes- waiting for the ensnarled vehicles to catch up? Just curious if that's the logic of it... "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Grimes Posted November 27, 2013 Posted November 27, 2013 I have vehicles getting bound up on bridges- and the groups they're affiliated with are stopping at the end of their routes instead of doubling back. If a vehicle gets killed, I imagine that the group continues... but are they holding at the end of their routes- waiting for the ensnarled vehicles to catch up? Possibly. AI tend to leave a unit for dead whenever it gets stuck on a bridge, but I've also seen them wait for the unit to catch up. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
m9matt Posted November 27, 2013 Posted November 27, 2013 (edited) Hi Grimes, when respawning a group of vehicles, is there a way to broadcast the vehicles lat/long coordinates via a message? I see there is mist.getLeadingLLString and mist.msgLL but I'm unsure how it should be scripted. I'm respawning the groups randomly in a zone, and would like the message to go out to all players. Edited November 27, 2013 by m9matt
Zayets Posted November 27, 2013 Posted November 27, 2013 getLeadingLLString gets as argument a unit and precision. You can do something like that (I don't have the reference with me so it may be a bit incomplete) Once spawned do this script: trigger.action.outtext(mist.getLeadingLLString(unit.getByName('myUnit'),3)) [sIGPIC]OK[/sIGPIC]
m9matt Posted November 27, 2013 Posted November 27, 2013 Thankyou for the reply Zayets. I tried the following Do Scripts in the trigger action and neither worked for me, what am I doing wrong? 1.trigger.action.outtext(mist.getLeadingLLString(unit.getByName('Group Name'),3)) then 2. mist.getLeadingLLString(unit.getByName('Group Name'),3
Grimes Posted November 27, 2013 Posted November 27, 2013 I think you'd want mist.getLLString and not mist.getLeadingLLString. The difference is that the leadingLLString function takes selection of units, then narrows it down based on the radius and heading variables, and then returns the average position of the remaining units. mist.getLLString just returns the average position of the selection of units. trigger.action.outText(mist.getLLString({units = mist.makeUnitTable({'[g]theGroupNameHere'}), acc = 3}), 50) This reminds me that I need to add examples for these functions on the wiki. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Zayets Posted November 27, 2013 Posted November 27, 2013 This reminds me that I need to add examples for these functions on the wiki. I'll buy you some beers (even if virtual ones) if you do that. :pilotfly: [sIGPIC]OK[/sIGPIC]
Zayets Posted December 4, 2013 Posted December 4, 2013 Browsed through the scripting wiki and came across this function. Wonder (in case it's correct) how does it works array of Unit function coalition.getGroups(enum coalition.side coalition, enum Group.Category groupCategory or nil) returns list of groups belong to the coalition. It returns all groups or groups of specified type. coalition - coalition identifier groupCategory - group category. If nil the function will return list of groups of all categories. I noticed that the return type is array of Units. Which means that if I call this one like that redGroups = coalition.getGroups(coalition.side.RED, Group.Category.GROUND) will return an array like this one : {Unit humvee1, Unit humvee2, Unit humvee 3} Assuming that humvee1 and humvee2 are part of group called ScoutOne it means that in order to get the real group list from this coalition means to check each unit in this array for the group they belong to. Now, assuming that the result is in this form : {{Unit humvee1,Unit humvee2},{Unit humvee3}} it makes things a bit more complicated to get the group names for example. [sIGPIC]OK[/sIGPIC]
9.JG27 DavidRed Posted December 15, 2013 Posted December 15, 2013 Follow the guide... Items in blue are required variables, green are optional. mist.respawnGroup('groupName') -- simply respawns the group with no task info. If its ground forces they will engage stuff, but if its aircraft they will ignore targets. mist.respawnGroup('groupName', true) -- embeds the route information to the group so that once the group spawns it will immediately do the route. This includes all task data with each waypoint. mist.respawnGroup('groupName', 5) -- if the 2nd variable is a number, then the default route will be assigned to the group after however many seconds you put in there. The number value has to be any number greater than 0. For instance 0.1 would work... but if you want to assign it right away anyways, just set the value to true. I tested it out in singleplayer and respawning AI do attack one another and myself providing the task information is there. David, the get the controller you simply need the groups name... local con = Group.getByName('whatever'):getController() From there you can create a mission task which is basically a table that shares most of the same formatting as a route in the mission file. From there you can set or push the task to the controller. con:pushTask(newTask) i dont know, i still cannot get the respawned ai to attack me...respawn.zip
chromium Posted December 16, 2013 Posted December 16, 2013 Hi all, I need support for a script, that could be a little modification of a MIST function. I need to do 2 script that should do the following: One that script that add a route to a pre-existent and parked (uncontrolled) AI flight (defined by group name), that will randomly choose one zone from a table zone (defined by name). than the flight should fly to the zone point, land for 15 minutes and route back to homeplate. Another script that add a route to a ground troops (defined by name) that will randomly choose one zone from a zone table (defined by name)... and this already exist in MIST. But, the adding part, after 15 minutes the troops should route back to the starting point. Can anyone could be so kind to write at least an example or similar? Thanks Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
HiJack Posted December 16, 2013 Posted December 16, 2013 In one of my mission projects I use AI helicopters and making then do circular holding patterns. The idea is rather to have the helicopters hover as AFAC’s just behind a hill or building. Is there a way to make an AI helicopter hover at a set height and forced to face a set heading? I think it should be in ME for AI helicopters.
ED Team NineLine Posted December 16, 2013 ED Team Posted December 16, 2013 In one of my mission projects I use AI helicopters and making then do circular holding patterns. The idea is rather to have the helicopters hover as AFAC’s just behind a hill or building. Is there a way to make an AI helicopter hover at a set height and forced to face a set heading? I think it should be in ME for AI helicopters. Honestly I havent tried, but cant you set speed to 0, altitude to whatever and set heading? 1 Forum Rules • My YouTube • My Discord - NineLine#0440• **How to Report a Bug**
HiJack Posted December 16, 2013 Posted December 16, 2013 (edited) Honestly I havent tried, but cant you set speed to 0, altitude to whatever and set heading? Good call. No I have not tried that, testing..... EDIT: That works perfect! Just set speed 0 and add one waypoint in the heading you want and set the height. The speed on the first waypoint can’t be set under 1 so with this you will not be able to change position. Thanks to SiThSpAwN, rep inbound. Edited December 16, 2013 by HiJack
Recommended Posts