Jump to content

Complete transport script


geloxo

Recommended Posts

I'm sorry if this is the dumbest question in the thread but I thought I had this figured out and then looked at the tutorial and was thrown for a loop...

 

I thought I would have to load the script in a fashion similar to MIST- near the beginning of the mission and that was what the trigger system used to draw various script definitions from. Once you load a particular script saying to pick up, or drop off... the program would refer back to the original .lua file.

 

When I looked in the tutorial and didn't see that initial script loaded and instead saw just a few very basic looking commands, I became confused. Is the .lua just a template that you can use to copy and paste various features?

 

Again, please forgive my ignorance- but I'm anxious to learn more about these incredible features and how I can apply them in a variety of missions.

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Hi,

 

I'm asking cause it's difficult to me to understand the code. As far I read, seems possible to load and unload fuel in the transport... then, do you think it's possibile to migrate fuel between a warehouse to another-one using a truck group?

 

i.e. let's say each fuel truck keep 4 tons of fuel. Each cargo group has 5 fuel trucks (total 20 tons).

 

When "cargo group" is within 200 mt from the first warehouse, it takes 20 tons of fuel from it. Then, "cargo group" move to the second warehouse, and deploy 20 tons of fuel in it. than come back and start again... (obviously the route is pre-planned and can loop due to the fantastic MIST add-on made by Grimes).

 

If possible, can someone create a small code example that works with one group between 2 warehouses? I would like to try to implement physical transport in a fuel supply net that I'm creating.

 

thanks in advance!

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

As far as I know there aren't any scripting commands that allow you to vary the contents of warehouses. It was something that was requested though. I could be wrong though, I've been out of the script testing loop for some time.

i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q

Link to comment
Share on other sites

I must be missing something- can someone at least post a link to where there are proper directions to load the script / use the ctts.lua file? The only relevant file google brings up is this thread.

 

Thanks and sorry that I can't get my head around its application.

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

As far as I know there aren't any scripting commands that allow you to vary the contents of warehouses. It was something that was requested though. I could be wrong though, I've been out of the script testing loop for some time.

 

Yes, Grimes already told me in another thread that ongoing store status and quantity is currently not accessible. And now I undestand that also it's not possibile yet to load or drain resources from a warehouse even by script.

 

Well, the current system it's however ok for my purposes, so i'll wait for future updates ;)

 

Thanks for the fast answer, even if you're not sure about it ;).

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

I must be missing something- can someone at least post a link to where there are proper directions to load the script / use the ctts.lua file? The only relevant file google brings up is this thread.

 

Thanks and sorry that I can't get my head around its application.

 

 

The .lua file must be initialized at the beggining via

 

Triggers... And the Initialization Script "Open"

 

Thats it...

 

The different scripts in the Do Script in the tutorial help you choose wich transport will be preloaded etc.

  • Like 1

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

Link to comment
Share on other sites

Frick. Just realized the reason I hadn't seen the initialization part of the triggers was because the resolution I'm in cut off just a small portion of the page... and I didn't notice the scroll bar on the side. As soon as I scrolled down- literally the width of the initialization script bar I realized how silly my question was. I never knew it was there because I always edit on this computer!

 

D'oh!

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Generally it doesn't matter when a script is loaded as long as any dependency of another script is fulfilled. For instance you must load MIST before SCT. It can be part of the same trigger action, split into different triggers, it really doesn't matter.

 

The initialization script is mostly there so that LUA can be referenced in the "group condition" script box just below the group name. It basically runs whatever code you have in there and the initialization script is the only lua that can be added before the group condition code runs.

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

One quick question-

 

If you do the "loadtransport" as described and someone leaves and comes back... if you use "Run Once," how do you make it so that the second itteration comes back being "pre loaded?"

 

If I run it on a continuous condition- will it just keep loading guys every second or will it stop at the default rate? If someone drops off will it replenish automatically?

 

Are these issues or am I thinking too much. Unfortunately it's hard for me to test this stuff out from where I am but I don't recall seeing anything in the thread earlier.


Edited by ENO

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

  • 2 weeks later...

Okay no takers on the last one... just as well I think I've worked through that one.

 

Second question-

 

I'm trying to evacuate personnel from one location using a spawn function, loading client hueys with those troops, then moving those troops to a second evac site where they are to board buses and be moved out of the combat zone. I can lose the buses if necessary- I have tried with a ural as well, assigned it both group name and unit name of transport1, put it in a pickzone and made sure it's about 50 meters from the troops...

 

But once they're spawned 10 seconds in they run around a bit as expected then stop.

 

I know the troops are called "groupname100 / 101 etc..."

 

What I'd like to be able to do is have them be dropped off by client hueys, and board the AI buses / transport... my understanding is that if they're in a pickzone within 50 (meters I'm assuming) that they'll automatically be "boarded" into the designated unit.

 

Am I missing something?

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Okay... another question. Maybe I'll get lucky.

 

Any plans to modify the script to account for the larger potential passenger load of the Mi-8? When troops are "autoloaded" at the beginning I'm assuming the same number will be autoloaded as what is set in your script settings?

 

And further to this... do we know of any changes to 1.2.6 which may cause errors with the current script initialized? I'm certainly not pointing fingers but as you will see in the bug section for DCSW the crashes are rampant and I'm trying to rule out some stuff on my end.

 

Missions I'm using that don't run CTTS (I only use it to basically load troops onto huey's so far) haven't crashed but the one that did crash is running with CTTS initialized. If I'm WAY off then please let me know and I'll move on to other possibilities but it would be nice to get some confirmation.

 

I also had traffic forced on for the first time in a long time in that mission- so that's my next critical suspect.


Edited by ENO

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Found a problem with this script and maybe you can help. Ive created 4 groups of 4 vehicles which Ive designated each unique vehicle as transports and are pre loading via a trigger. When I click on a vehicle say in group 3 I get the F10 menu which repeats each option 4 times. (Load/Unload, check status, load cargo bay). It turns out that this F10 option only associates with the first group in the list not the group your looking at. So even though I have 4 groups of vehicles only the first group unloads troops no matter what group Im looking at.

Also if you move the troops out of the area of the vehicle you just unloaded, you can unload a second group out of the same vehicle.

I was in Art of the Kill D#@ it!!!!

Link to comment
Share on other sites

Geloxo, thank you very much for this very useful and simple script, working very well.

 

However, some questions for you:

 

- about pre-loaded and generated troops, I'd like to use always "paratroopers" (for red country, of course). Please, can You explain me how and where to change the script?

 

- about radio action to load/unload troops or to check the cargo status, I'd like have them in russian language. Please, can you allow me to modify your script?

 

- about pre-defined extractable group, I've created a 6 man gruop of paratroopers (red country). Before the troops to load, I see 6 paratroopers. After unoladed I see items: 4 paratroopes and a 2 soldiers. Please, can you help me?

Please, see screen.

 

pq66.jpg

 

coyb.jpg

 

antonio.

Link to comment
Share on other sites

Search in the script "paratrooper" and just above you could change the unit name of Infantry AK to either paratrooper aks or rpg.

 

elseif groupside == 1 then

unitType = "Infantry AK"

if i <= 4 then

unitType = "Paratrooper RPG-16"

end

if i <= 2 then

unitType = "Paratrooper AKS-74"

end

 

Thats what I would try if you're in a hurry :)

sigpic4165_1.gif

attachment.php?attachmentid=36435&d=1266786388

Link to comment
Share on other sites

  • Recently Browsing   0 members

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