Jump to content

Complete transport script


geloxo

Recommended Posts

I put in the feature request for a function to find the largest safe group and unit Ids. Considering the game has to have that code or something like it already somewhere, it is hopefully just a matter of making it accessible.

 

If you don't create your own variable which is both read and updated, no issue with concurrent access. But if you do....

it depends on what you call "making it accessible" and how.

Link to comment
Share on other sites

"Making it accessible" means to create a scripting engine function for it. The game is full of stuff we can't directly access via the SSE. In other words a function is there, but it isn't accessible.

 

I don't want to face concurrent access issues... = spawning2 is reading largestId variable before spawning1 has updated it !

You have to REALLY try to make that happen and by the time it does the lag would be unbearable. I just cloned a group to a random point in a zone 25 times every 0.1 seconds without a problem aside from lag after 1500 units were added. Don't get me wrong, coroutines are great, but they aren't always required to make something complex work.

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

Link to comment
Share on other sites

If choice is between first implementation that makes bugs very unlikely and the second one that makes them impossible, I choose the latter with no doubt.

 

by the time it does the lag would be unbearable

 

But If you are right (I haven't tested yet, and I trust u), let's take the risk :thumbup:


Edited by galevsky06
Link to comment
Share on other sites

Yeah well the only reason I just tested it was because I wasn't 100% sure for myself and I don't think I had stress tested the script as intensely as that. I was halfway tempted to grab an A-10C to see what would happen if I flew over 1500 Vulcan AD in a 3km area :lol:

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

Link to comment
Share on other sites

Yeah well the only reason I just tested it was because I wasn't 100% sure for myself and I don't think I had stress tested the script as intensely as that. I was halfway tempted to grab an A-10C to see what would happen if I flew over 1500 Vulcan AD in a 3km area :lol:

 

Did a similar thing once, but then whit two columns next to each other.

One had shilka's, the other one Vulcans.

 

Awesome fireworks.:D

[sIGPIC][/sIGPIC]

The keeper of all mathematical knowledge and the oracle of flight modeling.:)
Link to comment
Share on other sites

Yeah well the only reason I just tested it was because I wasn't 100% sure for myself and I don't think I had stress tested the script as intensely as that. I was halfway tempted to grab an A-10C to see what would happen if I flew over 1500 Vulcan AD in a 3km area :lol:

 

Well the main important thing is to use the same method via Mist, 'cause everybody is doing is own business, with relative success... I saw hardcoded values, random integer values, incremental counters starting from hardcoded value (this is mine, starting from 500)....

 

I was really confident to find out some (U)UID generator in lua, and modify it a bit to get integer values only, because it is really what your need => unique Id, whatever the value til it suits DCS Id field requirements. But UUID implementations that I found was referencing external lib, or OS features that made solution out-of-scope.':(

Link to comment
Share on other sites

geloxo, Hi!

Thank you for the script! It works very well with my mission.

I want to make some modifications. I want to use 3 different logisticItemModel to spawn as a logistic item :

 

logisticItemModel = "FARP Fuel Depot"

logisticItemModel = "skladik"

logisticItemModel = "Crowd1"

and I want to add new commands to RadioCommandTable:

local radiotext1 = "Load/Unload Troops"

local radiotext2 = "Load/Unload Fuel"–- for "FARP Fuel Depot"

local radiotext3 = "Load/Unload Cargo"–- for "skaldik"

local radiotext4 = "Load/Unload Passengers"–- for "Crowd1"

local radiotext5 = "Check Cargo Status"

 

geloxo, I really hope you can help me!

Thanks in advance!


Edited by airwar
Link to comment
Share on other sites

Could get very complicated...

 

logisticItemModel = "FARP Fuel Depot"

logisticItemModel = "skladik"

logisticItemModel = "Crowd1"

 

won't work, you are overwriting the variable, so in the end you will have only logisticItemModel = "Crowd1".

 

You need:

 

logisticItemModel1 = "FARP Fuel Depot"

logisticItemModel2 = "skladik"

logisticItemModel3 = "Crowd1"

 

and on each occurrence of logisticItemModel you have to code a decision, which of the 3 you need to work with.

 

Basically you need to check which item you picked up, and put exactly that item down, when unloading...

 

Didn't overview the code yet, but I hope thet helps a little

"Sieh nur, wie majestätisch du durch die Luft segelst. Wie ein Adler. Ein fetter Adler."

http://www.space-view.net

Link to comment
Share on other sites

Regarding the pickup of dropped troops....

On a multiplayer server if you have a large trigger zone people may have dropped troops here there and everywhere would it be possible, when it comes time to "EXFIL" troops that they could all march to a specific predefined pickup point if all the enemy is dead within the zone they were dropped.

 

would just make picking troops up again easier if they all congregated round a pickup point instead of having to go looking for where they were dumped off.

Link to comment
Share on other sites

Did you change anything in the script?

 

I have changed only the players helicopters names 960, 963 ... And Troops from 10 to 4.

In the mission, read the briefing (18 images) and you will understand the mission idea (transportation conception).

If make this script work, we will go behind the limits of the DCSW and FSX as well ))) This script could create transportation simulator like German Truck Simulator from SCS Software. You will fly, transport and make money )))

 

P.S. FSX+ORBX+REX+GEX = DCSW )))


Edited by airwar
Link to comment
Share on other sites

Regarding the pickup of dropped troops....

On a multiplayer server if you have a large trigger zone people may have dropped troops here there and everywhere would it be possible, when it comes time to "EXFIL" troops that they could all march to a specific predefined pickup point if all the enemy is dead within the zone they were dropped.

 

would just make picking troops up again easier if they all congregated round a pickup point instead of having to go looking for where they were dumped off.

 

Ground commander can control de troops at any time.Thats why i always put such role on my missions. I prefer to avoid too much automated tasks to force players to play as a team

Link to comment
Share on other sites

Will check your mission airwar. Anyway dont panic if you need to change anything on the code. Feel free to do it and experiment. Nice outputs could come from users modifications guys

 

Thank You!!! This idea to make scripts for DCSW simply GREAT! And your CTTS script very good and tested in MP DCSW 1.2.5 )))

Link to comment
Share on other sites

I managed to alter the code, so that you can unload Fuel, Cargo or Passengers now. This is my first time with lua, I know the 3 additional functions are not good programming style, but it was the only way that I could figure out to work in the time..

 

Unfortunately it still doesn't check which type of cargo you loaded, so you can load fuel and unload passengers..but I think it's a nice first step..

 

I marked the changes with -- changed by MZ

 

Have fun :)

CTTS_MZ.lua

"Sieh nur, wie majestätisch du durch die Luft segelst. Wie ein Adler. Ein fetter Adler."

http://www.space-view.net

Link to comment
Share on other sites

I managed to alter the code, so that you can unload Fuel, Cargo or Passengers now. This is my first time with lua, I know the 3 additional functions are not good programming style, but it was the only way that I could figure out to work in the time..

 

Unfortunately it still doesn't check which type of cargo you loaded, so you can load fuel and unload passengers..but I think it's a nice first step..

 

I marked the changes with -- changed by MZ

 

Have fun :)

 

Weel done for first shot :thumbup:

 

I think the first upgrade could be remove ugly hardcoded units/groups names, and be able to loop on units that match some type requirement whatever their name.

 

If you still stick with naming convention, please avoid ugly lists, and prefer regexp matching... I mean loop on all units and check if name matches /^transport.*$/.

 

Same for PickupZones, and so on.... use regexp.

Link to comment
Share on other sites

I managed to alter the code, so that you can unload Fuel, Cargo or Passengers now. This is my first time with lua, I know the 3 additional functions are not good programming style, but it was the only way that I could figure out to work in the time..

 

Unfortunately it still doesn't check which type of cargo you loaded, so you can load fuel and unload passengers..but I think it's a nice first step..

 

I marked the changes with -- changed by MZ

 

Have fun :)

 

Perfect!!! It works! Thank you very much! Now I could Load/Unload Generator, Injured Pilot and UAZ-469. I hope we will have good Air Transportation Simulator :pilotfly:


Edited by airwar
Link to comment
Share on other sites

Nice. I´m in holidays now but when back I will take a review on the code to avoid the "GroupName" convention and all other things. I will use a dedicated script name to avoid problems with other scripts as suggested.

 

The problem about loading a item and unloading another one is one of the reasons why I decided to stick to one cargo type. As I said in the PM you can always change the variables logisticItemModel in the script for different missions, depending if you will load fuel, ammo or whatever. You stick to one task per mission, but it´s consistent at least.

Link to comment
Share on other sites

Hey

 

I´m a really big fan of your mission pack, especially the last one "Frontline" (because it doesn´t eat all my FPS like the other ones =D).

 

Now i would like to alter you mission a bit to our preferences.

For example, i changed that the ground commander can control units while piloting a C&C Huey (this is the only way to communicate with GC via TARS). We also noticed that the chinooks keep killing troops while they unload them (increase spawn distance?). Another issue is the lack of controlability of dropped troops (I noticed a line[598] in your script: "["playerCanDrive"] = true," but since it is true I dont know why I was not able to control them).

 

I have some programming skills but never worked with lua. still i understand your script quite well and it would hhelp me if you could sort y issues out.

Link to comment
Share on other sites

  • 3 weeks later...

Hi, excelent script, Im using this on a mission with also the DCS Artillery Script.

 

The Initialization script is the Artillery and 30 seconds after mission I call the CTTS Script..

 

Now, my problem is that I been having problems changing the drop zone smoke to NONE

I have 2 different drop zones and I dont want red smoke over them.. I change the value

 

DropZones = {

 

"dropzone1", "none",

"dropzone2", "none",

"dropzone3", "red",

"dropzone4", "red",

"dropzone5", "red",

 

Making the the two drop zones without smoke, but 30 seconds in the game, the game crashes, saying "found error near ! value" or something like that..

 

Also change the CTTS to initialization and the same happens during load.

 

Another question..

I want a Group of Mil Mi 8 to drop paratroopers on a Dropzone.

 

This is what I have,

4 Mil Mi 8 activate after a certain trigger happens... (they where set with late activation)

I name them transport1 transport2 ... etc

 

10 seconds after they apppear I use the script Loadtranport1 Loadtransport2 etc..

or

should I just place a pickup zone at the FARP (where they appear)

 

To be honest i put the puckup zone and also use the loadtraport script.. and I been having mixed results, sometimes they drop the troops, sometimes they dont..

 

So can you use the Loadtransport1 script if the choppers are already on the air?

A.K.A. Timon -117th- in game

Link to comment
Share on other sites

  • Recently Browsing   0 members

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