Redglyph Posted January 28, 2018 Share Posted January 28, 2018 where to find tutorials on creating missions by scripting A few pointers to add to what HiJack posted. This wiki is a good reference for scripting: http://wiki.hoggit.us/view/Simulator_Scripting_Engine_Documentation http://wiki.hoggit.us/view/Mission_Scripting_Tools_Documentation Be aware that many mission features cannot be accessed from scripting unfortunately (like any R/W interaction with the aircraft systems). This is a great tool to do some interactive tests: (but it's a bit awkward to set up, there are two modes depending on what you want to do) https://jboecker.github.io/dcs-witchcraft/ There are libraries like MOOSE and MIST with a fair amount of code, reading that helps a bit to understand how scripting works in DCS. System specs: Win7 x64 | CPU: i7-4770K | RAM: 16 GB | GPU: GTX 980 Ti 6 GB | Thrustmaster HOTAS | MFG rudder pedals | SATA3 SSD | TrackIR Link to comment Share on other sites More sharing options...
berk.kp Posted March 16, 2018 Share Posted March 16, 2018 Guys I'm having a problem I am unable to edit any .lua files. The game won't start. I tried to edit the Su-33.lua to correct weapon stations but the game does not start. Link to comment Share on other sites More sharing options...
Wunderwolf Posted April 9, 2018 Share Posted April 9, 2018 Guys I'm having a problem I am unable to edit any .lua files. The game won't start. I tried to edit the Su-33.lua to correct weapon stations but the game does not start. Probably related to the new integrity check system? Twitch : https://www.twitch.tv/wunderwolfx YouTube : https://www.youtube.com/channel/UCQLu0V_6GGqJYiwQf3gvmUw DCZ Discord : https://discord.gg/ytmqYqZ DCZ : https://www.digitalconflictzones.net Link to comment Share on other sites More sharing options...
Wunderwolf Posted April 9, 2018 Share Posted April 9, 2018 Just to bring it to an end ... The 'world.searchObjects' does indeed work for Object.Category.SCENERY. It was a problem in my script. i queried attributes which are no longer there in the current version. So everything is fine. :) Twitch : https://www.twitch.tv/wunderwolfx YouTube : https://www.youtube.com/channel/UCQLu0V_6GGqJYiwQf3gvmUw DCZ Discord : https://discord.gg/ytmqYqZ DCZ : https://www.digitalconflictzones.net Link to comment Share on other sites More sharing options...
FlightControl Posted March 19, 2019 Share Posted March 19, 2019 Is Unit.getPlayerName( Unit ) bugged in multi player in the latest beta of DCS in multi player? Can somebody try to obtain the player name of a unit using the above API on a multi player server? sven [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE] Link to comment Share on other sites More sharing options...
Pikey Posted January 18, 2020 Share Posted January 18, 2020 https://forums.eagle.ru/showthread.php?t=260977 getByName() returns nil for farps and oil rigs, didnt see this here. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING * Link to comment Share on other sites More sharing options...
Surrexen Posted February 16, 2020 Share Posted February 16, 2020 Is StaticObject.getByName() working for anyone else properly if it is being run from a Mission Start type trigger event (like in a script fired from Mission Start). Link to comment Share on other sites More sharing options...
Hippo Posted February 16, 2020 Share Posted February 16, 2020 Is StaticObject.getByName() working for anyone else properly if it is being run from a Mission Start type trigger event (like in a script fired from Mission Start). https://forums.eagle.ru/showpost.php?p=4210190&postcount=5 System spec: Intel i9 13900KF @ stock, Gigabyte GeForce RTX 4090 Gaming OC 24GB GDDR6X, Gigabyte Z690 UD DDR4, Corsair Vengeance RGB PRO SL 32GB (2 x 16GB) DDR4 3600MHz C18, Samsung 980 EVO 500 GB NVME M.2 SSD (system drive), Samsung 970 EVO 1 TB NVME M.2 SSD (games drive), Cooler Master ML360 Illusion CPU Cooler, Asus XG43UQ Monitor, Oculus Quest Pro, Thrustmaster Warthog HOTAS, MFG Crosswind Rudder Pedals Link to comment Share on other sites More sharing options...
Pikey Posted February 16, 2020 Share Posted February 16, 2020 https://forums.eagle.ru/showthread.php?t=260977 getByName() returns nil for farps and oil rigs, didnt see this here. Reference my above post, this appears to be fixed in 2.5.6 The test included the new animal type. cargo, farp, oil rig, building types tested and getByName() works env.info("BUG REPORT") local function checkIsExist(Name) local static = StaticObject.getByName(Name) if static:isExist() == false then env.info("BUG REPORT: "..Name.." does not exist (but getByName() works)") else env.info("BUG REPORT: "..Name.." returns true for both getByName() and isExist()") end end env.info("BUG REPORT: trying a techcombine") checkIsExist('techCombine')--returns true env.info("BUG REPORT: trying a cargo barrel") checkIsExist('Barrels')--returns true env.info("BUG REPORT: trying an animal") checkIsExist('cow')--returns true env.info("BUG REPORT: trying a farp") checkIsExist('farp')--returns true env.info("BUG REPORT: trying an oilrig") checkIsExist('oilrig')--returns true which is great news thanks ED! ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING * Link to comment Share on other sites More sharing options...
Terzi Posted May 3, 2021 Share Posted May 3, 2021 S_EVENT_PLAYER_LEAVE_UNIT This event fires twice. I tested many times. Other events such as dead, eject, crash works just once. [CENTER] [/CENTER] Link to comment Share on other sites More sharing options...
Jagohu Posted October 27, 2021 Share Posted October 27, 2021 Static objects with type FARP, Single Helipad, Oil rig, Gas platform can't be destroyed. No errors in the log, but the object stays on. It seems like it affects the objects which have an ATC frequency. StaticObject.getByName('Static FARP-1'):destroy() no_static_object_destroy.trk no_static_destroy.miz Link to comment Share on other sites More sharing options...
Elphaba Posted November 8, 2022 Share Posted November 8, 2022 Link to comment Share on other sites More sharing options...
daemon1808 Posted November 20, 2022 Share Posted November 20, 2022 (edited) Hi, world.event.S_EVENT_UNIT_LOST is not returning the correct category for vehicles. It should return "1" (Object.Category.UNIT), but is returning "3" (Object.Category.STATIC) edit: it is not only the category. It seems that ground units are considered now static objects for the S_EVENT_UNIT_LOST. If you tried to use any "unit" related function (like event:initiator:getGroup()) the code launch an exception. This hadn't happened before. categorybug.miz Edited November 20, 2022 by daemon1808 new info Link to comment Share on other sites More sharing options...
Chump Posted November 20, 2022 Share Posted November 20, 2022 @daemon1808 Event.initiator returns a Unit object. There is no Unit.getCategory(), so it defaults back to its base Object.getCategory(). event.initiator:getCategory() -- returns Object.Category If you want to get the Unit.Category, you will need to get it from the descriptor. event.initiator:getDesc().category -- returns Unit.Category Link to comment Share on other sites More sharing options...
daemon1808 Posted November 20, 2022 Share Posted November 20, 2022 (edited) 1 hour ago, Chump said: @daemon1808 Event.initiator returns a Unit object. There is no Unit.getCategory(), so it defaults back to its base Object.getCategory(). event.initiator:getCategory() -- returns Object.Category If you want to get the Unit.Category, you will need to get it from the descriptor. event.initiator:getDesc().category -- returns Unit.Category Hi @Chump You have understood it wrong. I don't want the unit.category, I need the object.category. Object.category for a ground unit must return "1", because the ground unit killed (the event:initiator) is a UNIT object, not a STATIC object. But the event:initiator:getCategory() of the event is returning "3" instead. In fact this only happens if the initiator is a ground unit, not an aerial unit (In this case it returns "1", as expected) Not only that, as the initiator is no longer considered a UNIT for this event, now all functions related to a UNIT launch an excepcion, like event:initiator:getGroup() (because a STATIC object haven't a parent group). This worked right 3 or 4 months ago. Now a script that worked before, is not working anymore because of this. Edited November 20, 2022 by daemon1808 Link to comment Share on other sites More sharing options...
Chump Posted November 20, 2022 Share Posted November 20, 2022 @daemon1808 Gotcha. My bad. Thanks for clarifying the issue. Fix one thing, break two! Hopefully ED will take a look at this. 1 Link to comment Share on other sites More sharing options...
Flappie Posted November 20, 2022 Share Posted November 20, 2022 5 hours ago, daemon1808 said: world.event.S_EVENT_UNIT_LOST is not returning the correct category for vehicles. It should return "1" (Object.Category.UNIT), but is returning "3" (Object.Category.STATIC) This bug was reported earlier this year, and a fix is in the making. 2 Don't accept indie game testing requests from friends in Discord. Ever. Link to comment Share on other sites More sharing options...
daemon1808 Posted November 21, 2022 Share Posted November 21, 2022 18 hours ago, Flappie said: This bug was reported earlier this year, and a fix is in the making. great! thanks you Link to comment Share on other sites More sharing options...
Loophole Posted January 5, 2023 Share Posted January 5, 2023 groupObj:getUnits() for a train group only ever returns one unitObj, even if the train consists of multiple carriages. Yet events like hit or dead will return different unitObj for different carriages in the train. Link to comment Share on other sites More sharing options...
Grimes Posted January 6, 2023 Author Share Posted January 6, 2023 23 hours ago, Loophole said: groupObj:getUnits() for a train group only ever returns one unitObj, even if the train consists of multiple carriages. Yet events like hit or dead will return different unitObj for different carriages in the train. That is an oddity that occurs from how the train is formed. Each component isn't a unit, rather they are more like entities attached to the unit. It has been a while since I last tested scripting functionality on trains and I seem to remember making a few bug reports on the odd values returned by group and unit functions. null 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 Link to comment Share on other sites More sharing options...
snowsniper Posted March 11, 2023 Share Posted March 11, 2023 (edited) BUG : Object.getName(Class Self ) return "static" instead of real static name like "Static Infantry M249-1" ? since DCS 2.8.3.37556 Open Beta - 10.03.2023 Major pain point as all DCS object are referenced in script by the name. way to reproduce : lua : -- standard DCS Scripting functions do local StaticObject1 = StaticObject.getByName("static1_for_test") -- Unit Name line "static1_for_test" in DCS Mission Editor ( no group Name line ) local StaticObject1category = StaticObject1:getCategory() local StaticObject1name = StaticObject1:getName() trigger.action.outText("category :"..StaticObject1category, 5) trigger.action.outText("Name :"..StaticObject1name, 5) env.info("category :"..StaticObject1category,false) env.info("Name :"..StaticObject1name,false) -- RESULTS ! : since DCS 2.8.3.37556 Open Beta - 10.03.2023 -- return correct Name "static1_for_test" from DCS OBJECT if Static unit is anything else than ground Unit( vehicle or infantery ) -- return only "static" for Name from DCS OBJECT if static unit is a ground unit ( vehicle or infantery ) end Edited March 11, 2023 by snowsniper updated with more tests i7-10700KF CPU 3.80GHz - 32 GO Ram - - nVidia RTX 2070 - SSD Samsung EVO with LG TV screen 40" in 3840x2150 - cockpit scale 1:1 - MS FFB2 Joystick - COUGAR F16 throttle - Saitek Pro Flight Rudder Pedals Link to comment Share on other sites More sharing options...
davidp57 Posted March 16, 2023 Share Posted March 16, 2023 We've got the same issue (getName() -> "static") on our side too. This is problematic because we need to dynamically enable/disable whole groups containing statics. @BIGNEWY, do you know if this issue is going to be worked on? Zip - VEAF :pilotfly: If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze ! Link to comment Share on other sites More sharing options...
Flappie Posted March 19, 2023 Share Posted March 19, 2023 The "static" issue was reported internally. 2 Don't accept indie game testing requests from friends in Discord. Ever. Link to comment Share on other sites More sharing options...
Flappie Posted April 13, 2023 Share Posted April 13, 2023 On 3/16/2023 at 9:26 PM, davidp57 said: We've got the same issue (getName() -> "static") on our side too. This is problematic because we need to dynamically enable/disable whole groups containing statics. Fixed in OB. 1 1 Don't accept indie game testing requests from friends in Discord. Ever. Link to comment Share on other sites More sharing options...
davidp57 Posted April 13, 2023 Share Posted April 13, 2023 Thank you Flappie, for letting me know! And thanks to the ED devs for correcting this quickly. Zip - VEAF :pilotfly: If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze ! Link to comment Share on other sites More sharing options...
Recommended Posts