Fishbreath Posted May 30, 2017 Share Posted May 30, 2017 http://wiki.hoggit.us/view/RespawnGroup mist.respawnGroup('groupName', 120) Why does my group reborn at once? The delay parameter in that function doesn't delay the respawn, it delays assignment of the group's original task. The group will respawn instantly, then, after the delay has passed, will begin to follow its original task again. Edit: wow, this thread moves fast. Black Shark, Harrier, and Hornet pilot Many Words - Serial Fiction | Ka-50 Employment Guide | Ka-50 Avionics Cheat Sheet | Multiplayer Shooting Range Mission Link to comment Share on other sites More sharing options...
Grimes Posted May 30, 2017 Share Posted May 30, 2017 Is MIST working in 2.1 ATM? Yes Are respawnInZone and teleportInZone working for player groups? I can respawn the player using the basic respawnGroup, but when I try to use respawnInZone I get "Err: Can't execute trigger. Err: "mist.respawnInZone('PlayerGroup', 'SpawnZone', false)" Substituting a non-player group works fine with no other changes to the syntax Never tried it with player groups. If it is a client aircraft it won't work since client aircraft cannot be spawned, changed position, or modified in any way. The scripting function used, coalition.addGroup() by the mist functions is supposed to work if the skill is set to player and only in single player. 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 Link to comment Share on other sites More sharing options...
Acefighterpilot Posted May 30, 2017 Share Posted May 30, 2017 Yes Never tried it with player groups. If it is a client aircraft it won't work since client aircraft cannot be spawned, changed position, or modified in any way. The scripting function used, coalition.addGroup() by the mist functions is supposed to work if the skill is set to player and only in single player. Ah ok, was just curious as GCI CAP doesn't work and I thought it relied on that, sounds like something pertaining to GCI cap. Although Automan is dead too but that I don't think relies on MIST, I could be wrong I don't know too much about the coding side of things. [sIGPIC][/sIGPIC] Asus Z97-A/ i7-4790K/ Hyper 212 EVO/ 16GB RAM/ GTX1080 Strix OC/ Supernova 750/ X-55/ TiR Link to comment Share on other sites More sharing options...
Subferro Posted May 31, 2017 Share Posted May 31, 2017 Never tried it with player groups. If it is a client aircraft it won't work since client aircraft cannot be spawned, changed position, or modified in any way. The scripting function used, coalition.addGroup() by the mist functions is supposed to work if the skill is set to player and only in single player. Yeah learned by trial and error that you can't respawn clients. Player groups work great for respawnGroup functions, but teleporting and respawnInZone seem to be a no-go. Link to comment Share on other sites More sharing options...
ESAc_matador Posted June 7, 2017 Share Posted June 7, 2017 Hello. i have a problem here with mist.removeFunction. I have a function that display a message periodically every 4 seconds via... local func = mist.scheduleFunction(aircraftposition, {"Mago 33"}, timer.getTime() , 4) but then I use mist.removeFunction(func) and it does not stop. Any suggestion? Link to comment Share on other sites More sharing options...
Grimes Posted June 7, 2017 Share Posted June 7, 2017 Best guess is it is a locality issue. A good test would be to print out the value of func right after you call scheduleFunction and then again right before you call removeFunction. 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 Link to comment Share on other sites More sharing options...
ESAc_matador Posted June 7, 2017 Share Posted June 7, 2017 (edited) I am not very good at this. Sorry, what do you mean for print out? Edit> the question is, I want to practice "rejoinings" in a holding point. I set an AI aircraft doing orbits. So, when he is in certain positions he will say "I am in sector 1, 2, 3 or 4". The script works, but I dont know how to stop it. I am using the formula. function message() bla bla bla mist.schedulefunction(message,{},.....,4) so each 4 seconds the loop starts. But i dont know how to stop it. I am trying different formulas, but any help is welcomed. Edited June 7, 2017 by ESAc_matador Link to comment Share on other sites More sharing options...
doodenkoff Posted June 7, 2017 Share Posted June 7, 2017 Finally. I got mist.ground.patrol working. A switched condition with a trigger zone around the last WP did the trick. I tried so many different combinations; At Mission Start with a Time More > 10; Once with the same Time More value, as a group triggered action, etc. I chose that particular MIST function because I happened to see an example of it and it looked basic enough to start experimenting and learning how to use MIST. 3 hours later, it worked. However, (and there's always a 'however') I watched my 2-unit group run the route through 3 round trips and then it simply stopped at its starting point. The second test, I got tired of watching when it started its ninth round trip. I've attached the tiny test mission if you're interested in seeing a successful use of mist.ground.patrol. Question; can slmod and MIST run concurrently?MIST_test.miz Win 10 | i7 4770 @ 3.5GHz | 32GB DDR3 | 6 GB GTX1060 Link to comment Share on other sites More sharing options...
feefifofum Posted June 7, 2017 Share Posted June 7, 2017 Yes. We run both on our server. THE GEORGIAN WAR - OFFICIAL F-15C DLC Link to comment Share on other sites More sharing options...
Grimes Posted June 8, 2017 Share Posted June 8, 2017 I am not very good at this. Sorry, what do you mean for print out? Using either mist.Logger or the scripting function env.info() to add entries to your DCS.log so you can get a better idea of what values are being passed. For example I added some logging directly to mist.removeFunction and the code I created to test this out real fast. do local function display() trigger.action.outText(Unit.getByName('u'):getPosition().p.x, 5, true) end fId = mist.scheduleFunction(display, {}, timer.getTime() +1, 1) env.info(fId) end 01459.011 INFO SCRIPTING: Mist version 4.4.81 loaded. 01462.740 INFO SCRIPTING: 1 01464.596 INFO SCRIPTING: removeFunction 01464.596 INFO SCRIPTING: 1 01464.596 INFO SCRIPTING: loop 01464.596 INFO SCRIPTING: remove The first '1' is from the env.info(fId) and the rest of the lines are displayed as mist.removeFunction goes line by line. Finally. I got mist.ground.patrol working. I've attached the tiny test mission if you're interested in seeing a successful use of mist.ground.patrol. Question; can slmod and MIST run concurrently? Yeah slmod and mist work fine together. Though you should probably be using mist for any scripting functionality and leave server admin stuff to slmod. I've actually been thinking of changing how the ground patrol works now that you can do it directly with the AI tasking using the goToWaypoint task. I'm waiting for the next 1.5 patch though so it is available on all DCS versions. 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 Link to comment Share on other sites More sharing options...
ESAc_matador Posted June 8, 2017 Share Posted June 8, 2017 I was able to solve the problem by using loops with some true and false. Works great, but it took me a while to solve it. Fixing the removescheduleFuction would be better:) Link to comment Share on other sites More sharing options...
Grimes Posted June 8, 2017 Share Posted June 8, 2017 I was able to solve the problem by using loops with some true and false. Works great, but it took me a while to solve it. Fixing the removescheduleFuction would be better:) Can you post a mission from where you were having the issue? With my quick test it worked fine, I'm curious about your circumstances in which it didn't. 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 Link to comment Share on other sites More sharing options...
ESAc_matador Posted June 8, 2017 Share Posted June 8, 2017 Can you post a mission from where you were having the issue? With my quick test it worked fine, I'm curious about your circumstances in which it didn't. I ll do asap. Link to comment Share on other sites More sharing options...
ESAc_matador Posted June 9, 2017 Share Posted June 9, 2017 (edited) Can you post a mission from where you were having the issue? With my quick test it worked fine, I'm curious about your circumstances in which it didn't. Again, my lack of experience in .lua programming, made me loose my precious time... ahahha. Problem solved. I was using "local" where I shouldn´t. Just to remind other newbs at this I ll expalin my problem and the solution. This is the problem.... function start() [color="Red"]local [/color]myFunc = mist.scheduleFunction(message, {}, timer.getTime()+5,5) end start() mist.scheduleFunction(removeFunction, {myFunc}, timer.getTime()+60) Since I was calling the function "start()" from outside the "local myFunc" function... When I called mist.removeFunction(myFunc) it did not find such "local" variable. For everynewby!! remember where and why you put locals!!! so proper code is: function start() myFunc = mist.scheduleFunction(message, {}, timer.getTime()+5,5) [color="red"]-- wiithout "local"!!!![/color] end start() mist.scheduleFunction(removeFunction, {myFunc}, timer.getTime()+60) PS: I have lots of small scripts for the AI to do something... And this is a great tool to switch on, off without using triggers in ME, and is veriy automated. For instance... I want to update my "recon aircraft" script, to switch On/off the camera. Or my EW Jamming... so now we can start and stop making emissions (that affects also our own missiles). Also, if you want to make a function until certain conditions are met. Edited June 9, 2017 by ESAc_matador Link to comment Share on other sites More sharing options...
doodenkoff Posted June 9, 2017 Share Posted June 9, 2017 I would be pleased to see a short tutorial in the use of mist.msgBR to display bearing and range in response to a pilot using an F10 menu choice. Specifically, how do I pass the values for vec2/vec3, and recipient to the script? Example: The player presses F1 to see his/her bearing and range to EnemyArmor1. As a result of a flag being set, do script: mist.msgBR('EnemyArmor1', 'vec2/vec3', '30', 'recipient') I think I'm on the right track for doing what I want. What might be most useful is a tutorial on how to pass the values. If I can find them, I can use them. And if I can find them for this example, that opens the door to sussing damned near anything. I think I'm close...and it's driving me crazy. It's like that word you're trying to think of and it keeps flitting around the edge of your brain. Win 10 | i7 4770 @ 3.5GHz | 32GB DDR3 | 6 GB GTX1060 Link to comment Share on other sites More sharing options...
ESAc_matador Posted June 9, 2017 Share Posted June 9, 2017 (edited) I would be pleased to see a short tutorial in the use of mist.msgBR to display bearing and range in response to a pilot using an F10 menu choice. Specifically, how do I pass the values for vec2/vec3, and recipient to the script? Example: The player presses F1 to see his/her bearing and range to EnemyArmor1. As a result of a flag being set, do script: mist.msgBR('EnemyArmor1', vec2/vec3', '30', 'recipient') I think I'm on the right track for doing what I want. What might be most useful is a tutorial on how to pass the values. If I can find them, I can use them. And if I can find them for this example, that opens the door to sussing damned near anything. I think I'm close...and it's driving me crazy. It's like that word you're trying to think of and it keeps flitting around the edge of your brain. try this local unitPosition = Unit.getByName("yourunit"):getPosition().p -- return a Vec3 local point = { y = unitPosition.z , x =unitPosition.x } -- THis is to put a vec2, if you want vec3 just add " z = unitPosition.y " [i]mist.msgBR('EnemyArmor1', [b]point[/b], '30', [b]recipient[/b])[/i]-- recipient should be a table, so no " ' " needed. I approach this problem with mist.getBRString and then I do myself the snippet for display the message. Try what I told you... it will probably work. however, can you put all relevant code?? Edited June 9, 2017 by ESAc_matador Link to comment Share on other sites More sharing options...
Grimes Posted June 10, 2017 Share Posted June 10, 2017 Problem solved. I was using "local" where I shouldn´t. Just to remind other newbs at this I ll expalin my problem and the solution. Will not confirm nor deny I made the same mistake on making my quick test mission simply out of habit. Realized it sooner though. :smartass: I would be pleased to see a short tutorial in the use of mist.msgBR to display bearing and range in response to a pilot using an F10 menu choice. Specifically, how do I pass the values for vec2/vec3, and recipient to the script? Example: The player presses F1 to see his/her bearing and range to EnemyArmor1. As a result of a flag being set, do script: mist.msgBR('EnemyArmor1', 'vec2/vec3', '30', 'recipient') I think I'm on the right track for doing what I want. What might be most useful is a tutorial on how to pass the values. If I can find them, I can use them. And if I can find them for this example, that opens the door to sussing damned near anything. I think I'm close...and it's driving me crazy. It's like that word you're trying to think of and it keeps flitting around the edge of your brain. Here is the wiki page on it: http://wiki.hoggit.us/view/MsgBR It uses a single table for all the input values instead of multiple entries. So your syntax is incorrect. The units value is a unitNameTable which is basically just a list of unit names. It can be created with mist.makeUnitTable and its multitude of input values. The vec2/vec3 is a coordinate in the form of a table. Vec2 = {x,y} and Vec3 = {x,y,z} so it is a difference of 2d vs 3d. Keep in mind that the vec2 Y coordinate is the Z coordinate in vec3. The function will end up using a vec3 coordinate but it will convert it from a vec2 if needed. displayTime accepts a number value. So from your sample just change it from '30' to 30. With the quote it makes it a string. The recipient is really the msgFor entry and its a table in itself. You can see some examples on it here: http://wiki.hoggit.us/view/MessageAdd The wiki has the basic syntax for all the functions in mist, so it should be enough to work out how to use the function. Not all of them have sample code though. 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 Link to comment Share on other sites More sharing options...
doodenkoff Posted June 10, 2017 Share Posted June 10, 2017 Gonna pull my hair out. do mist.msgBR({ units = mist.makeUnitTable('EA1'), -- A single red armor unit named as such ref = Unit.getByName('Doodenkoff'):getPosition().p, -- an L-39 I'm sitting in displayTime = 20, msgFor = {units = {'Doodenkoff'}}, --send the message to me, Doodenkoff. }) end I checked and doublechecked the unit names in the mission editor. No matter what I change in the above script, I get the identical error message in DCS.log: DCS: Mission script error: : [string "C:\Users\micha\AppData\Local\Temp\DCS\/~mis0000647F"]:2141: attempt to index local 'unit' (a nil value) stack traceback: [C]: ? [string "C:\Users\micha\AppData\Local\Temp\DCS\/~mis0000647F"]:2141: in function 'makeUnitTable' [string "do..."]:3: in main chunk Win 10 | i7 4770 @ 3.5GHz | 32GB DDR3 | 6 GB GTX1060 Link to comment Share on other sites More sharing options...
Grimes Posted June 10, 2017 Share Posted June 10, 2017 Two things. 1. Since it is just a single unit you are testing it with then you can simply change it to units = {'EA1'}. The makeUnitTable is only really needed if you don't directly know the names of the units or want to assemble a table based on your needs. Since It is just a single unit you can just skip that step, but it still needs a table. 2. If Doodenkoff is the name of your player unit that will work. All scripting use of units and groups goes off of the names of the units/groups as defined in the mission editor. Everything else looks right. 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 Link to comment Share on other sites More sharing options...
doodenkoff Posted June 10, 2017 Share Posted June 10, 2017 Yay me. Thanks for the assistance. I don't know why the bearing returned appears to be off by about 6 degrees, but it's a start. Win 10 | i7 4770 @ 3.5GHz | 32GB DDR3 | 6 GB GTX1060 Link to comment Share on other sites More sharing options...
doodenkoff Posted June 11, 2017 Share Posted June 11, 2017 (edited) 'Sup? Edited June 16, 2017 by doodenkoff Win 10 | i7 4770 @ 3.5GHz | 32GB DDR3 | 6 GB GTX1060 Link to comment Share on other sites More sharing options...
Wrecking Crew Posted June 13, 2017 Share Posted June 13, 2017 I am loading Mist at Time More (4), with more scripts at (4+n). I'd like to load Mist, first, and all my scripts and script files with separate MISSION START events, in the desired order. Is that good? Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site. Link to comment Share on other sites More sharing options...
Wrecking Crew Posted June 13, 2017 Share Posted June 13, 2017 mist.DBs.humansByName includes coalition, and type Can I also get plane, helicopter, ship, and vehicle as info? Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site. Link to comment Share on other sites More sharing options...
Grimes Posted June 13, 2017 Share Posted June 13, 2017 I am loading Mist at Time More (4), with more scripts at (4+n). I'd like to load Mist, first, and all my scripts and script files with separate MISSION START events, in the desired order. Is that good? Yeah that will work. mist.DBs.humansByName includes coalition, and type Can I also get plane, helicopter, ship, and vehicle as info? Yeah that information is there under 'category'. It will only ever be plane or helicopters though since that whole table is defined by units set to the skill of "client" or "player" in the mission editor. 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 Link to comment Share on other sites More sharing options...
ESAc_matador Posted June 26, 2017 Share Posted June 26, 2017 local altitude =30000 local unitzonename = "chaffunit" local targetname = "aircraft" local unitsinzone = mist.getUnitsInPolygon(targetname, mist.getGroupPoints(unitzonename), altitude) trigger.action.outText(mist.utils.tableShow(unitsinzone),20) It is saying I am attepting to index global to "unitNames"(a nil value). I just want to see if a detected target (I have the name of it...) is in a poligon zone. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now