Highlander Posted November 7, 2015 Posted November 7, 2015 So has anyone come up with a work around for re-spawning ground units? I tried with no luck or I'm using it wrong. if (Group.getByName(groupName) and Group.getByName(groupName):isExist() == false) or (Group.getByName(groupName) and #Group.getByName(groupName):getUnits() < 1) or not Group.getByName(groupName) then return true end return false end
MTrenda Posted November 8, 2015 Posted November 8, 2015 Grimes, I put the 57 build in one of my scripts and now when I try to use the RespawnGroup function I get a global value is nil error. is this a known issue right now or something new. thanks Falcon MSI Creator X299 - INTEL i9 - 10900X 3.7 GHZ - 32 GB Corsair Dominator DDR4 - EVGA GTX 1080 FTW AC2
dissignator Posted November 8, 2015 Posted November 8, 2015 (edited) Hi Guys! Is it possible to get the Coordinates of the SPI? Greetings! Edited November 8, 2015 by dissignator
Grimes Posted November 10, 2015 Posted November 10, 2015 I put the 57 build in one of my scripts and now when I try to use the RespawnGroup function I get a global value is nil error. is this a known issue right now or something new. Whats the global variable? respawning is working for me. Hi Guys! Is it possible to get the Coordinates of the SPI? Unfortunately avionics data like that is not accessible to the scripting engine. redunits = Group.getSize (mist.getUnitsInZones('[figthers][red]' , zone1)) blueunits = Group.getSize (mist.getUnitsInZones('[figthers][blue]' , zone1)) If blueunits <= 1/2×redunits then trigger.action.setAITask(blueunits, number taskIndex ) number taskIndex= this would be return to base.... i dont know how to put this. End I know that my code its a mess but... i guess you get my point. And the idea is interesting for me. Group.getSize() doesn't work like that since mist.getUnitsInZones doesnt return a group object, it returns a list of units that are within the zone. You can check the size of the tables with something like : redUnits = #mist.getUnitsInZones('[figthers][red]' , zone1) So has anyone come up with a work around for re-spawning ground units? I tried with no luck or I'm using it wrong. if (Group.getByName(groupName) and Group.getByName(groupName):isExist() == false) or (Group.getByName(groupName) and #Group.getByName(groupName):getUnits() < 1) or not Group.getByName(groupName) then return true end return false end Should be working without issue. 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
MTrenda Posted November 10, 2015 Posted November 10, 2015 Grimes I had the function call like mist.respawn('groupName',True) then I tried mist.respawn('groupName') both failed so I assumed it can not get the groupname for some reason. I will have to look deeper into this unless you have some suggestions. thanks 76th Falcon MSI Creator X299 - INTEL i9 - 10900X 3.7 GHZ - 32 GB Corsair Dominator DDR4 - EVGA GTX 1080 FTW AC2
Grimes Posted November 11, 2015 Posted November 11, 2015 Grimes I had the function call like mist.respawn('groupName',True) then I tried mist.respawn('groupName') both failed so I assumed it can not get the groupname for some reason. I will have to look deeper into this unless you have some suggestions. Is there actually a group in your mission with the name 'groupName' ? Because that is what the function is expecting. Also true/false statements need to all be lower case. If you are using notepad++ and set the language to lua you will notice that the word true will be highlighted blue while True won't be. 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
MTrenda Posted November 11, 2015 Posted November 11, 2015 Grimes, I was using groupname as variable in our conversation the actual name is 'USA AWACS Escort' along with a few others. Thanks Mark MSI Creator X299 - INTEL i9 - 10900X 3.7 GHZ - 32 GB Corsair Dominator DDR4 - EVGA GTX 1080 FTW AC2
Grimes Posted November 11, 2015 Posted November 11, 2015 Well you put it in quotes which makes it a string of literally 'groupName', which is why I pointed it out. 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
MTrenda Posted November 11, 2015 Posted November 11, 2015 Grimes, my apologies, a coding habit. thanks 76th falcon MSI Creator X299 - INTEL i9 - 10900X 3.7 GHZ - 32 GB Corsair Dominator DDR4 - EVGA GTX 1080 FTW AC2
BR55Sevas Posted November 11, 2015 Posted November 11, 2015 Help please to get some units params via MIST. I use this code, which is work perfect local current_Unit = Unit.getByName(Units_to_fly_table[i]) local current_nickname = Unit.getPlayerName(current_Unit) local current_UnitType = current_Unit:getTypeName() local myPos = current_Unit:getPosition().p local XX = myPos.x local YY = myPos.y local ZZ = myPos.z But how can I extrack radio altitude of unit? МиГ-29 Fly by wire СДУ Su-27SM second display panel https://www.youtube.com/embed/videoseries?list=PL_2GGwNpWNp_fKXfRtDhIk8s5Jf4a9XHS http://berkuts.ru Пилотажный сервер с роботом | Aerobatic server with PhantomControl
Stonehouse Posted November 11, 2015 Posted November 11, 2015 I believe that the y component of your position is your ASL and if you want to get your AGL then you need to use land.getHeight at your x,z co-ords to get the height of the land at that position. Note that it's all in metres. eg AGL = myPos.y - land.getHeight(myPos.x,myPos.z) So ASL - ground height at unit position to get radar alt or AGL. 1
BR55Sevas Posted November 12, 2015 Posted November 12, 2015 (edited) Stonehouse, not works. got this error From ED wiki Distance function land.getHeight(Vec2 point) what vec2 point correct format? Ps Fix it local XX = myPos.x local YY = myPos.y local ZZ = myPos.z MyVec2 = { x = XX, y = ZZ } local AGL = myPos.y - land.getHeight(MyVec2) Many thanks! Edited November 12, 2015 by BR=55=Sevas МиГ-29 Fly by wire СДУ Su-27SM second display panel https://www.youtube.com/embed/videoseries?list=PL_2GGwNpWNp_fKXfRtDhIk8s5Jf4a9XHS http://berkuts.ru Пилотажный сервер с роботом | Aerobatic server with PhantomControl
Stonehouse Posted November 12, 2015 Posted November 12, 2015 (edited) Sorry. My typo. Should have been AGL = myPos.y - land.getHeight({x=myPos.x, y=myPos.z}) Which is what you got to in the end anyway. Edited November 12, 2015 by Stonehouse
JackDant Posted November 17, 2015 Posted November 17, 2015 Sorry if this already known or intended, but I think I found a bug in mist.getNorthCorrection. If called with a Vec2, the first thing it does is turn it into a Vec3: if not point.z then --Vec2; convert to Vec3 point.z = point.y point.y = 0 end But because Lua passes tables around by reference, it's changing the coordinates in the caller's scope. I just thought I was going crazy, as my code worked without the getNorthCorrection call, but didn't work with it. But I wasn't even using the returned value!
Grimes Posted November 18, 2015 Posted November 18, 2015 Thanks. I'll have a look through the code to see if this happens for anything else. I have a feeling it might... 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
BR55Sevas Posted November 22, 2015 Posted November 22, 2015 Is it possible to create tcp or udp connection with mission`s scripts like export.lua do? I tried add package.path = package.path..";.\\LuaSocket\\?.lua" package.cpath = package.cpath..";.\\LuaSocket\\?.dll" socket = require("socket") StatUDP = socket.udp() StatUDP:setsockname("127.0.0.1", 8095) StatUDP:setpeername("127.0.0.1", 8090) StatUDP:settimeout(0) socket.try(StatUDP:send(string.format("STATA_START"))) But got error МиГ-29 Fly by wire СДУ Su-27SM second display panel https://www.youtube.com/embed/videoseries?list=PL_2GGwNpWNp_fKXfRtDhIk8s5Jf4a9XHS http://berkuts.ru Пилотажный сервер с роботом | Aerobatic server with PhantomControl
FSFIan Posted November 22, 2015 Posted November 22, 2015 (edited) The Lua environment for mission scripts is limited by design (to prevent malicious mission scripts from messing with your files, turning your PC into a spam bot, etc). You can get around that by editing Scripts\MissionScripting.lua in your DCS installation directory (sometimes referred to as the "sanitation module"). If you publish anything that requires editing that file, make sure to warn your users about the increased risk or keep the existing sanitation code intact, load your own code before that and make sure that nothing you expose to the global namespace can be used to cause harm (e.g. keep a file-local copy of the "require" function etc. and expose a global function that only lets you write to a predetermined file / network port / whatever). I'd suggest posting any follow-up questions in a new thread, as this is not a MiST-specific issue. Edit: On a completely unrelated note, I just noticed that my post count is my phone number (without area code) right now *g* Edited November 22, 2015 by [FSF]Ian DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
lukrop Posted December 1, 2015 Posted December 1, 2015 What is the license of this project? I couldn't find one in the github repo or the guide. Or is it not licensed under any open source license? I'm asking because I wanted to fork it and change some stuff and send you a pull request. But in the case you don't want to merge my changes back into the main project I don't want to have to trash them (= not releasing them on github under any OS license). So I'm asking beforehand. :) GCICAP Release | GCICAP issue tracker
Grimes Posted December 2, 2015 Posted December 2, 2015 Never added a proper license to it on github, but see the first post in the thread: Community Contributions The purpose of Mist is to provide a set of scripts for the DCS community, by the DCS community. We are open to people contributing their own scripts into Mist, but we reserve the right to edit your script in any way we see fit before “officially” including it into Mist. Also, feel free to contribute ideas as for what scripts to develop next. Usage Rights Feel free to modify or redistribute Mist in any way you see fit (even including it in paid content is OK by us), AS LONG AS you don’t try claim that our work is your own. 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
Highlander Posted December 3, 2015 Posted December 3, 2015 Been testing Mist 4.0.57 with DCS 2.0 and so far no problems :)
xcom Posted December 3, 2015 Posted December 3, 2015 Respawning a/c is happening on last destroyed location instead of original birth place. In anyway many of the old bugs seen in early 1.5 are in 2.0, I'm guessing they used an old version. [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
richard008 Posted December 17, 2015 Posted December 17, 2015 My DCS(1.2.16 and 1.5.0) appear this error when a mission start--Trigger: can't execute trigger, err:"[string "?"]:1: bad argument #1 to 'loadstring' (string expected, got function)". And all the lua script does not work, is that a bug , how to fix it?
Grimes Posted December 17, 2015 Posted December 17, 2015 That looks to be a mission editor issue, would need the mission file to see if I can reproduce the issue. 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
wolle Posted December 18, 2015 Posted December 18, 2015 Hi Grimes, In the update 1 changelog today there is some mention of lua scripting. Does that mean that some of the scripting bugs you have been keeping track of have been squashed? [sIGPIC][/sIGPIC] Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro
Recommended Posts