Jump to content

Recommended Posts

Posted

Would somebody be so kind to provide an example how to use the following Task for a Group Controller (Helicopter):

 

Embarking = {  
id = "Embarking",  
params = {    
  x = Vec2.x,    
  y = Vec2.y,    
  duration = time,    
  groupsForEmbarking = array of groups,    
  distributionFlag = boolean,    
  distribution = array of unitIds  
}

 

I've studied the documentation of Grimes, but after my implementation in lua, DCS keeps on crashing:

 

http://wiki.hoggit.us/view/DCS_task_embarking

 

 

This is the line where my logic crashes. Please help. I think i am doing something wrong with the "Array of Groups"...

 

function GROUP:Embarking( Point, Duration, Group )
trace.f( self.ClassName, { self.GroupName, Point, Duration } )

   local Controller = self:_GetController()
   
   trace.i( self.ClassName, Group.GroupID )
   [color=Red]Controller:pushTask( { id = 'Embarking', params = { point = Point, duration = Duration, groupsForEmbarking = { Group.Group } } } )[/color]
   
   return self
end

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Posted

Its gotta be a table of GroupIds.

 

I have had to report a number of crashes related to the scripting engine and creating embarking tasks in the past. But that was under 1.2.16 and I haven't really tried it recently in 1.5. I found my old test file for it and it didn't crash, but at the same time it didn't exactly work either. I'll have to play with it a bit to see if something changed. In the mean time perhaps Ciribob has messed with it as he does a lot more scripting for transport stuff, but I think he might use his own system.

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

Okay, I've given the table providing the group IDs, but still there is something not cooking. I need to retrieve the Group IDs with the function Group:getID() right? I get a hard crash, so i must be doing something wrong.

I've already successfully been able to script the EmbarkToTransport task for the infantry (which needs to be done before the Embarking task).

So the crash is really just when i call the pushTask function for the controller.

 

Tried if Embark works in DCS 2.0, and the logic DOES seem to work from the mission editor without scripting, as the attached mission illustrates.

 

So Grimes, would you please be able to help on this one. Historically the Embarking logic has been very undocumented since 1.2.6, and now when cargo etc is coming, things may become even more exciting for lua scripting mission builders. So, maybe there is a small initiative where you can help.

 

How actual is the current Embarking, EmbarkToTransport, DisembarkFromTransport documentation, and where did you get the AI task lua interface specs from? Did the DCS development team provide you with these specs?

 

In your documentation, for your feedback, it seems that:

- the Embark task is the most documented:

 

- the EmbarkToTransport task has documentation, but when i look in the mission editor there are more editor fields than there are lua fields in the AI Task table.

 

- the DisembarkFromTransport task seems to have no documentation.

 

I think you are the only person who can help here at the moment.

 

Would you be so kind to look into a few items:

 

1. Would you be able to provide an example how to use the Embarking and EmbarkToTransport logic with a script? Something that is working and not crashing. Maybe in a test mission or something.

 

2. Can you pls help to describe the Controller Tasks: Embarking, EmbarkToTransport, DisembarkFromTransport? Maybe complete your hoggit pages would help. I also found some confusing texts, but we can handle that later maybe. Especially the DisembarkFromTransport currently has no documentation. Would you still have that somewhere available?

 

It may also help others to provide this documentation.

 

kind regards,

Sven

2016-02-16 - DCS_2.0 - Helicopter Embarking Test.miz

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Posted

Found it... My memory ...

 

 

 

The truth was in the 'mission' file of the attached miz file in the previous post. Unzipped the miz file and all the required task fields are embedded in the helicopter and infantry object descriptions...

 

 

 

Cheers

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Posted

Checking the mission file is how I came about testing it all in the firstplace. I ended up reporting 2-3 bugs/crashes when I tried to just get it to work with scripting, each at different steps along the way. Suffice to say its been one of the more annoying things to test and document. It seems with the documentation I simply forgot about it. Probably started it and got annoyed that it crashed on disembark, so I couldn't verify if the values were correct. Luckily its pretty easy to update and I've already created a basic entry.

 

It looks like the values changed on embarkToTransport task for some reason. Then again its probably one of the more confusing features of the mission editor right now with how its setup. Gotta love how the community has made our own scripts to handle it indirectly. I think what is listed currently is the bare minimum required for that given task. The other variables are possibly optional.

 

Looking at the page reminds me I need to create a few other task wiki pages. Of which I'm gonna try and figure out real quick as I made little headway on the actual embarking scripts tonight.

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 (edited)

Cool! I have been able now to make a helicopter execute an Embarking task using lua without a crash, by calling pushTask on the controller. I simply took all the fields I found in the test mission and copied them into the pushTask script call. So that resolved the crash I got.

 

 

 

For the infantry to enter the helicopter using the EmbarkToTransport is another story. There seems to be a bug with that. It works fine when setup in the mission, but when using pushTask, the coordinates don't seem to work properly. Infantry starts running to point 0, 0 which is a quite far run I think. I need to do further tests and will submit a bug report including test mission files to re-simulate the issues. We can use that later to test the fixes.

 

Note that in my MOOSE framework I am currently having quite an extensive cargo handling logic setup. This includes handing of transports, packages, sling load, etc. I just will need to publish it once properly finished and documented in my Github source code lib. Right now the latest code can be found on GitHub in a special branch I created where I am now improving the logic.

 

 

 

Additional comment:

 

DCS world scripting APIs have a lot of bugs related to cargo since 1.2.6. It is a mess actually. Hardly anything works properly at the moment in 1.5.2.

 

I really hope that 1.5.3 will fix a lot of those, but my hopes are very low at the moment.

Edited by FlightControl

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

  • 2 weeks later...
Posted
Cool! I have been able now to make a helicopter execute an Embarking task using lua without a crash, by calling pushTask on the controller. I simply took all the fields I found in the test mission and copied them into the pushTask script call. So that resolved the crash I got.

 

 

 

For the infantry to enter the helicopter using the EmbarkToTransport is another story. There seems to be a bug with that. It works fine when setup in the mission, but when using pushTask, the coordinates don't seem to work properly. Infantry starts running to point 0, 0 which is a quite far run I think. I need to do further tests and will submit a bug report including test mission files to re-simulate the issues. We can use that later to test the fixes.

 

Note that in my MOOSE framework I am currently having quite an extensive cargo handling logic setup. This includes handing of transports, packages, sling load, etc. I just will need to publish it once properly finished and documented in my Github source code lib. Right now the latest code can be found on GitHub in a special branch I created where I am now improving the logic.

 

 

 

Additional comment:

 

DCS world scripting APIs have a lot of bugs related to cargo since 1.2.6. It is a mess actually. Hardly anything works properly at the moment in 1.5.2.

 

I really hope that 1.5.3 will fix a lot of those, but my hopes are very low at the moment.

 

 

I'm really bad at scripting and coding, can you type in your script so i can create my SAR mission please? :)

Posted

Actually, the scripts are embedded in the mission in the first post. Open the mission and select the helicopter. Go to waypoint 1 and select the actions on the waypoint. You'll find 2 scripts there...

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

  • Recently Browsing   0 members

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