piXel496 Posted December 6, 2014 Posted December 6, 2014 (edited) Pinpointed error below.. :cry: Edited December 7, 2014 by piXel496 Updated below old stuff I made
piXel496 Posted December 7, 2014 Author Posted December 7, 2014 (edited) After further testing, it appears that cargo (slingload) crashes scripts for being nil. The dcs.log error 00028.345 ERROR DCS: Mission script error: : [string "D:\Temp\DCS\/~mis0000755E"]:4: attempt to index local '_cargoObject' (a nil value) The script to test this: function initializeCrash() local _cargoObject = StaticObject.getByName("testitem") --this is the name of the cargo local _cargoPos = _cargoObject:getPoint() trigger.action.outTextForCoalition(coalition.side.RED, string.format("Test x-coordinate cargo position: " .. _cargoPos.x), 25) end initializeCrash() A test mission made for this purpose attached below, it only runs the above code in 5sec. after missionstart: Any help or "it's a bug" acceptance is welcome. Thanks, .Test_get_ cargo_object_coordinate.miz Edited December 7, 2014 by piXel496 old stuff I made
Grimes Posted December 8, 2014 Posted December 8, 2014 StaticObject.getByName() is returning "nil" for all cargo objects. It seems to work with other statics though. I also had a game crash while trying to spawn a cargo object, but it isn't 100% reproducible yet. Still trying to figure that one out. I'll get this info reported to the relevant dev. 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
piXel496 Posted December 8, 2014 Author Posted December 8, 2014 (edited) Nice to know the "bug" is in good hands. :) For what it's worth, my mission is able to script spawn cargo's. At the moment the script calls a cargo-object it freezes. mission: http://www.digitalcombatsimulator.com/en/files/716322/ . Edited December 8, 2014 by piXel496 true, other static objects seem to work fine old stuff I made
Chic Posted December 10, 2014 Posted December 10, 2014 StaticObject.getByName() is returning "nil" for all cargo objects. It seems to work with other statics though. I also had a game crash while trying to spawn a cargo object, but it isn't 100% reproducible yet. Still trying to figure that one out. I'll get this info reported to the relevant dev. THANK YOU It would be a shame to loose sling load. A Co, 229th AHB, 1st Cav Div ASUS Prime Z370-A MB, Intel Core i7 8700K 5.0GHz OC'd, RTX 3090, 32GB DDR4, 1TB SSD, Win 10 Samsung 65" 4K Curved Display (Oculus Rift occaisionally), Track IR5, VoiceAttack, Baur's BRD-N Cyclic base/Virpil T-50CM Grip, UH-1h Collective by Microhelis & OE-XAM Pedals. JetSeat & SimShaker for Aviators. JUST CHOPPERS
Chic Posted December 11, 2014 Posted December 11, 2014 THANK YOU It would be a shame to loose sling load. Got my problem solved here; http://forums.eagle.ru/showthread.php?p=2258336#post2258336 I suspect its probably not relevant to the issue described above. Hope its worked out soon for you as well. A Co, 229th AHB, 1st Cav Div ASUS Prime Z370-A MB, Intel Core i7 8700K 5.0GHz OC'd, RTX 3090, 32GB DDR4, 1TB SSD, Win 10 Samsung 65" 4K Curved Display (Oculus Rift occaisionally), Track IR5, VoiceAttack, Baur's BRD-N Cyclic base/Virpil T-50CM Grip, UH-1h Collective by Microhelis & OE-XAM Pedals. JetSeat & SimShaker for Aviators. JUST CHOPPERS
piXel496 Posted December 11, 2014 Author Posted December 11, 2014 I hope cargo is fixed soon too, thx. The issue with cargo in scripts is "I think" related with properties or attributes of the object cargo. ID, name and getLife seem to work but getpoint, country or type do not. . old stuff I made
FlightControl Posted January 16, 2015 Posted January 16, 2015 Has this been fixed? I am getting similar results (nil) when querying for a Cargo StaticObject.getByName( CargoName )... Please advise... 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]
FlightControl Posted January 16, 2015 Posted January 16, 2015 pfff. And it seems the errors are larger with cargos... When you design a trigger to check if a cargo is in a zone or out of a zone, that does not seem to work neither. The position of cargos are not updated when you pick them up and fly them around... I can make a test mission if you want... 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]
spinter Posted January 30, 2015 Posted January 30, 2015 how do I fix? Static local StaticObject.getByName = (name) ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net
FlightControl Posted January 30, 2015 Posted January 30, 2015 spinter, is your comment a question or an answer? Can you pls elaborate a bit? [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]
spinter Posted January 30, 2015 Posted January 30, 2015 Static local StaticObject.getByName = ("test") Use this function I do not know if I wanted answers and was adjusted! ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net
FSFIan Posted February 13, 2015 Posted February 13, 2015 I posted results of some further testing in this thread. The cargo object is spawned into the game world and some methods such as getName() and getDesc() work, but most fail with an "Object doesn't exist" error. The cargo object can also not be enumerated with world.searchObjects(). StaticObject.getByName("MyCargo").id_ has an object ID, but StaticObject.getByName("MyCargo"):getID() returns 0. DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
vicx Posted February 13, 2015 Posted February 13, 2015 I think that there needs to be a new type added to this table Object.Category = { UNIT, WEAPON, STATIC, SCENERY, BASE } Cargo is not really a STATIC. --- On the subject of other hard to handle objects; I am trying to access SPOT objects and objects that are used by service.FAC. Support from ED for scripted access to CARGO/TRANSPORT and SPOT/TARGETING objects is unlikely in the short term. The only solution as I see it, is to ignore the built-ins and create scripted alternatives. Thoughts?
FlightControl Posted November 5, 2015 Posted November 5, 2015 StaticObject.getByName() is returning "nil" for all cargo objects. It seems to work with other statics though. I also had a game crash while trying to spawn a cargo object, but it isn't 100% reproducible yet. Still trying to figure that one out. I'll get this info reported to the relevant dev. Is this bug fixed in 1.5? I also use this function to detect if Cargo has reached a certain coordinate (sling loaded) by a player. 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]
Grimes Posted November 5, 2015 Posted November 5, 2015 As far as I know its been fixed for a while. The only part broken is the destroy() function doesn't work on cargo objects. 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
FlightControl Posted November 5, 2015 Posted November 5, 2015 Ok. Thanks. I've reactivated the sling load missions in the gori valley combat field. Who wants can try it out on dcs belgium server in 1.5 beta. [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]
Recommended Posts