Jump to content

Since update 1.2.12 get object coordinates cargo not working?


Recommended Posts

Posted (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 by piXel496
Posted

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 ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted
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

 

Posted
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

 

Posted

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.

 

 

 

 

 

 

 

.

  • 1 month later...
Posted

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]|

[/TABLE]

  • 2 weeks later...
  • 2 weeks later...
Posted

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.

Posted

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?

  • 8 months later...
Posted
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]|

[/TABLE]

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...