Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

infantry drop

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> infantry drop Page: [1]
Login
Message << Older Topic   Newer Topic >>
infantry drop - 6/9/2020 3:32:34 PM   
wqc12345


Posts: 250
Joined: 12/7/2015
From: San Francisco, CA
Status: offline
I'm trying to drop an infantry unit (from edit cargo). The manual process works, where I add a infantry section, select unload cargo and the unit appears.

If I script it, I get an Object reference not set to an instance of an object error.

local u = SE_GetUnit({name='Cub4', guid='RHR5WE-0HM0B0J6KFMOU'})
print(u.cargo[1].cargo)
for k,v in pairs (u.cargo[1].cargo) do
print(v.dbid)
ScenEdit_UnloadCargo(u.guid, { {v.quantity,v.dbid}})
end

{ [1] = { mass = 0, status = 'Operational', name = 'Spetsnaz Saboteur', area = 0, dbid = 880, crew = 1, quantity = 10, guid = 'RHR5WE-0HM0CJQSARNTP' } }
880
ERROR: Object reference not set to an instance of an object.

I'm using arrays, since I'll have several planes in the section, but even if I'm explicit in my reference parameters, meaning, CUB1, it still returns an error?

This is definitely a bug.. needs fixing. Because it works manually.

I've tried everything and there doesn't seem to be a way to unload cargo from a aircraft. You can certainly do it manually, but the ID field doesn't seem to conform to the dbid field in the database. Anyway, any help here would be greatly appreciated. Also, adding cargo to a guid doesn't seem to work, and not sure why?

am I missing something


< Message edited by wqc12345 -- 6/9/2020 6:30:25 PM >
Post #: 1
RE: infantry drop - 6/9/2020 10:08:06 PM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
I'll take a look, as for the scene setup, all I need is a paratroop loadout plane (or group of them) with 10 sabo's loaded as cargo in each them to duplicate the basic circumstances right? I ask cause I've found cargo setups to be very particular, is there a particular unit# I should use to simulate the above. Also the 880 dbid there seems odd should be 858 for a Spetsnaz Saboteur mount, or 1944\1946 for a Spetsnaz sabo facility. hmm.




(in reply to wqc12345)
Post #: 2
RE: infantry drop - 6/9/2020 10:18:42 PM   
wqc12345


Posts: 250
Joined: 12/7/2015
From: San Francisco, CA
Status: offline
Hi KnightHawk,

Thanks for taking the time to take a look. Yes, I have manually executed the order with the ID of the cargo. Meaning, I've taken an AN-12 Cub, loaded it with 10 Spezsnaz ID: 880 units and "unloaded" the cargo manually and they drop.

I do the same thing with code, meaning, I just run the below code (and I tested it against a port land structure with the same cargo) and it worked, but it didn't work with the AN-12.



See above for the image in cargo that references the unit.

Here is the cargo displayed



I've attached the images in case the images don't show

Attachment (1)

< Message edited by wqc12345 -- 6/9/2020 10:23:53 PM >

(in reply to KnightHawk75)
Post #: 3
RE: infantry drop - 6/10/2020 5:35:24 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
Weird on the db#'s maybe different ones are enabled in db485, or maybe you're using CWDB?.

Anyway...


Ok so I went digging. I found three things.

First yup it's broke, it doesn't matter what you feed it when it's an aircraft.
The part where it dies is after it's found or not found the stuff we send it. Doesn't matter if you feed it guids or {num,dbids} sets or really if it finds any matches or not. It'll die when it gets to a point of code after building it's cargo list that looks something like this [for devs eyes]
...
if(activeUnit is Aircraft)  //it is valid and aircraft...so next line fires and then throws object not set.
{   
if (((Aircraft_AirOps)activeUnit2.\SomeObsfucatedFunctionOrProperty()).\SomeOtherObsfucatedFunctionOrProperty())
...

I can confirm activeUnit2 is indeed null when it reaches there and whatever the above it meant to do to maybe change that doesn't happen.


Second thing that I noticed during this and maybe one of the devs can confirm or not is that while the {{5,851}...} type parameter works as expected the guid {'guidhere,guidhere'} one does not. It parses the list fine, but it seems to do a compare on each individual cargo entries mount guid vs some overall package\group guid we see in unit.cargo entries.

So for example (in the attached scene) I added 10 #851's and 10 #858's to a IL76MD-90A with a 50ton air-drop loadout, one of those has paradrop capability flagged one of them doesn't (I wanted to see if it would let me drop it anyway).

The print(u.cargo) produces
{ [1] = { name = 'Ace Tomato #1', cargo = { [1] = { crew = 1, guid = '4FH7PU-0HM0CDR2UPE6Q', area = 0, mass = 0, quantity = 10, name = 'Spetsnaz Saboteur', dbid = 858, status = 'Operational' }, [2] = { crew = 1, guid = '4FH7PU-0HM0CDR2UPE82', area = 0, mass = 0, quantity = 10, name = 'SpecOp Saboteur', dbid = 851, status = 'Operational' } }, guid = '4FH7PU-0HM0CDR2UPE4G' } }

I assumed I could pass it those two guids to bulk drop them all but, that's not what think I saw happening, I saw it do a comparison between 0-19 individual cargo entries each having their own guid, of which of course none matched. When I recorded what some of those were such as 4FH7PU-0HM0CDR2UPE81 and 4FH7PU-0HM0CDR2UPE61, and ran it again, then I saw it match and get added to the drop list. Now btw that's cool we can specify specific dudes to drop, but the issue is how do we get the full list of those guids to know to do that?


Third thing is, it does work for Ships. Sort of.
That is the {num,dbid} process does complete without errors for ships. However unlike in gui, there doesn't seem to be a check for near-by land and placement there, it will drop the units into the ocean. So that that's a little bit of a problem. I suppose the guid works too for ships but I didn't want to go through another debug session to find out the individual ones for ones I stuck on a carrier in the scene. Another issue is that when you feed it a guid that didn't do anything it returns true anyway as if it did something. idk I think it should return false that no match was found.

attch: TestRig_CargoOps_TroopDrop2.scen (play red, special actions help demo problems...ignore blue side)

Edit - Side note: When triggering unload via the gui on Ace Tomato #1, it drops the paradrop flagged guys, the other 10 that are not capable just deleted, which strikes me as odd, I guess they just get thrown out the back without chutes.










< Message edited by KnightHawk75 -- 6/10/2020 6:23:19 AM >

(in reply to wqc12345)
Post #: 4
RE: infantry drop - 6/10/2020 9:00:25 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Yes, sorry my mistake.
I used 'unitTO' rather than 'unitFROM' to test if the aircraft was on the ground. And of cause as 'unitTO' doesn't exist ....

_____________________________

Michael

(in reply to KnightHawk75)
Post #: 5
RE: infantry drop - 6/10/2020 9:16:13 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
The {dbid,dbid,dbid,..} does work in the Lua function, but not for para-drops. It uses the same base function as the UI, so all para-drop capable mounts are created as a unit, and the cargo cleared.

The UI function won't drop the cargo unless all the cargo mounts are drop capable. If you have a case where this is wrong, please drop in a save to see what defect exists.

Looking at this, I think I can see the issue. Will let you know if I need a save.

< Message edited by michaelm75au -- 6/10/2020 9:39:01 AM >


_____________________________

Michael

(in reply to michaelm75au)
Post #: 6
RE: infantry drop - 6/10/2020 10:29:36 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Logged 0013942

_____________________________

Michael

(in reply to michaelm75au)
Post #: 7
RE: infantry drop - 6/10/2020 3:04:58 PM   
wqc12345


Posts: 250
Joined: 12/7/2015
From: San Francisco, CA
Status: offline
Hey, thanks a lot Michael. Appreiciate the digging and bug report.

(in reply to michaelm75au)
Post #: 8
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> infantry drop Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.469