Jump to content

Complete transport script


geloxo

Recommended Posts

Im probably behind the times on this one but one thing I noticed is if you pick up a custom group, say georgians that are on the blue side, it will unload the generic nato troops. Doesnt keep track of the units you pick up.

 

you have in the CTTS only Russia, USA and Insurgents groups .... go to line 519 in the CTS.lua file. You will need to add other countries.

Playing: F-16C

Intel i7-13700KF, 64GB DDR5 @5600MHz, RTX 4080 ZOTAC Trinity, WIN 11 64Bit Prof.

Squadron "Serious Uglies" / Discord-Server: https://discord.gg/2WccwBh

Ghost0815

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

Hi, I am currently struggling to spawn units with coalition.AddGroup, and have them loaded right away, it I can't seem to have it working (well, it does sometimes).

 

ENO, what do you call "Dynamically spawned unit bug" ? I'd like to know if I'm experiencing some kind of bug. If there isn't a big issue that I can't do a thing about, I will explain more what I have.

Link to comment
Share on other sites

That bug should be fixed with 127 / MIST 3.3. Depending on which one you were refering to- one resulted in a memory leak while the other was basically a lack of sync between client and server.

 

The one I found wasn't address with the CTTS script in particular was something that Grimes pointed me at. I'll look back at the line but the way it works is if you have more than 100 units, the CTTS script overwrites it... or versa vice. So I needed to go in and edit the script so the unit numbers started at 1000 or 10000... whichever. Basically a number that would never be overwritten. That solved my second CTTS problem.

 

I'm not sure if that's the same problem, however. This generally resulted in the units spawning in- but then people being unable to join in with different aircraft or positions.

"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

I’ve made a little modification on the RagnarDa’s script (http://forums.eagle.ru/showthread.php?t=106083&highlight=board+vehicle&page=2) to unload troops anywhere in the map from a BMP-2.

 

 

After the disembark I want to load the troops again in the BMP-2 and unload them in another area.

 

 

My doubt is how to do a soldier that died after the first disembark not appear again when the group loads into the BMP-2 and disembark in another area?

 

 

I’ve looked into the geloxo’s script (CTTS), but I couldn’t find the answer.

 

Does anybody know if the answer is there?

 

 

I’ve attached the mission and the script but they are not complete yet.

 

Thanks

Poti.miz

PotiScript.lua

Link to comment
Share on other sites

Thanks, ENO, this doesn't seem to be the issue I am having. So here I will try to explain a bit more.

 

What I want to achieve, is to spawn a unit with coalition.addGroup, and load it with CTTS right away. Somehow it doesn't load the vehicule (but a later LoadTransport does).

 

So here is a simplified version of my code, that still doesn't work. It is for the default CTTS (default transport names).

 

I have two radio items.

One calls a function that spawns an M2A2 and then calls LoadTransport.

The other simply calls LoadTransport.

 

function LoadM2A2 () -- simple call of LoadTransport
   LoadTransport("transport1", 6)
end
 
function SpawnM2A2 (Location)
   local pos = trigger.misc.getZone(Location)
    -- gets the zone location

   local ranpos = {}
   ranpos.x = pos.point.x + math.random(pos.radius * -1, pos.radius)
   ranpos.z = pos.point.z + math.random(pos.radius * -1, pos.radius)
    -- randomize spawn position within zone

   local data = {
       ["visible"] = false,
       ["name"] = "Troop transport",
       ["task"] = {},
       ["hidden"] = false,
       ["units"] =
       {
           [1] =
           {
               ["x"] = ranpos.x,
               ["y"] = ranpos.z,
               ["type"] = "M-2 Bradley",
               ["name"] = "transport1",
               ["heading"] = 0,
               ["playerCanDrive"] = true,
               ["skill"] = "Average",
           }, -- end of [1]
       }, -- end of ["units"]
   }
   -- unit data, with unit name "transport1"

   coalition.addGroup(country.id.USA, Group.Category.GROUND, data)
    -- spawns the group

   LoadM2A2()
    -- should load troops, but doesn't

end
 
missionCommands.addCommandForCoalition(coalition.side.BLUE, "Spawn M2A2 Bradley", nil, SpawnM2A2, "SpawningZone")
-- adds radio item

missionCommands.addCommandForCoalition(coalition.side.BLUE, "Load M2A2 Bradley", nil, LoadM2A2, nil)
-- adds radio item

So when you try it (test mission and .lua attached), the unit spawns, but empty. Then if you use the "Load M212 Bradley" radio item, it loads as expected. I cannot understand why it doesn't work.

 

The funny thing is, I just noticed, if I make it spawn again, it will now be loaded.

Spawn.miz

Spawn.lua

Link to comment
Share on other sites

ENO has a valid point here. The larger scripts, like MIST, RagnarDa's MEDEVAC or CTTS may need a few seconds to be loaded into memory and have the script functions available... if you call a function before it is loaded, it will fail.

 

Try delaying your script with a "TIME MORE THAN, 10 sec" trigger, that should be enough for MIST and CTTS to initialize first.

 

If this doesn't solve your problem we need to look further.:smartass:

  • Like 1

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VIRPIL CM 50 Stick & Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

Thanks a lot for the input.

 

I finally got it working by combining your suggestion (2 seconds seems enough for now) with a timer that delays the LoadTransport call by 5 seconds (2 seconds wouldn't work).

 

The strange thing is I had tried those two solutions before, maybe I hadn't tried the right combination. :doh:

 

Well, I will see if it keeps working consistently with my complex script, but I have hope now :)

Link to comment
Share on other sites

05969.987 ERROR DCS: Mission script error: : [string "C:\Users\Eno\AppData\Local\Temp\DCS\/~mis00..."]:777: attempt to index local 'leader' (a nil value)

stack traceback:

[C]: ?

[string "C:\Users\Eno\AppData\Local\Temp\DCS\/~mis00..."]:777: in function 'FindNearestEnemy'

[string "C:\Users\Eno\AppData\Local\Temp\DCS\/~mis00..."]:1409: in function 'CallSpawn'

[string "CallSpawn("blue", 4, "spawn1", 100)"]:1: in main chunk

Just curious- I'm not sure if this is a mist thing or CTTS thing... I have a variety of spawns that occur and I thought this one was the same. I think this is the first time I've got this error... look familiar?

 

I checked the name of the spawn location and it's good... which aspect of this error should I be investigating? Reload CTTS?

"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

Similar issue here. Honestly I've no idea what is the root cause. Since I currently load 3 scripts in that mission, I'll start testing step by step...

 

Seems the CallSpawnFunction tries to find the unit it is about to spawn and fails? I'm no script guru or programmer so it's just my wits against bloody ones and zeros...:helpsmilie:

 

00096.711 ERROR   DCS: Mission script error: : [string "C:\Users\user\AppData\Local\Temp\DCS\/~mis0..."]:4244: Unit doesn't exist
stack traceback:
   [C]: ?
   [C]: in function 'getName'
   [string "C:\Users\user\AppData\Local\Temp\DCS\/~mis0..."]:4244: in function 'f'
   [string "C:\Users\user\AppData\Local\Temp\DCS\/~mis0..."]:509: in function 'onEvent'
   [string "Scripts/World/EventHandlers.lua"]:13: in function <[string "Scripts/World/EventHandlers.lua"]:11>
   [C]: in function 'addStaticObject'
   [string "C:\Users\user\AppData\Local\Temp\DCS\/~mis0..."]:606: in function 'ConfigObject'
   [string "C:\Users\user\AppData\Local\Temp\DCS\/~mis0..."]:582: in function 'NewStructure'
   [string "C:\Users\user\AppData\Local\Temp\DCS\/~mis0..."]:1485: in function 'CallSpawnLogistics'
   [string "CallSpawnLogistics("blue", 2, "spawn1", 30)"]:1: in main chunk

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VIRPIL CM 50 Stick & Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

Ok, it seems to work now!

 

What I changed:

 

Use MIST 3.3 !!!

 

and increased the base object ID counters in CTTS, as already mentioned somewhere in the thread.

Rather than 100 it's now 10000!

 

When cascading the scripts on load with trigger conditions and give them time to load, it seems now perfect to me.:D

 

groupCounter = 10000
unitCounter = 10000
logcargoCounter = 10000

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VIRPIL CM 50 Stick & Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

thank you so much for this great script

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

  • 2 weeks later...

I'm getting a script error using the Original Poster's Transport tutorial.miz

 

The window pops up as soon as the mission tries to demonstrate the spawning of the enemy groups that will look for troops to engage at the base.

 

Can someone please confirm? is the CTTS script bugged with 1.27?

 

00253.612 ERROR DCS: Mission script error: : [string "C:\Users\KIRKAD~1\AppData\Local\Temp\DCS\/~..."]:789: Group doesn't exist

stack traceback:

[C]: ?

[C]: in function 'getName'

[string "C:\Users\KIRKAD~1\AppData\Local\Temp\DCS\/~..."]:789: in function 'FindNearestEnemy'

[string "C:\Users\KIRKAD~1\AppData\Local\Temp\DCS\/~..."]:1404: in function 'CallSpawn'

[string "CallSpawn("red", 2, "spawn", 1000)..."]:1: in main chunk


Edited by dooom

ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 

"This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

I'm getting a script error using the Original Poster's Transport tutorial.miz

 

The window pops up as soon as the mission tries to demonstrate the spawning of the enemy groups that will look for troops to engage at the base.

 

Can someone please confirm? is the CTTS script bugged with 1.27?

 

No. It works fine. Just make sure that the pilot name is helicargo1 and not unit name. Also, reset the mission init script then reload the CTTS.LUA and should work seamlessly. Let me know if that solved your issue.

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

ok - i'll try ... i'll report back in a sec.

 

... sorry not quite sure what you mean by "reset the mission init script then reload the CTTS.LUA" . the tutorial.miz was not altered in any way from the page one download so i'll check the naming.

 

FYI I just ran the Airmobile Frontline mission and received the same error when it tried to callspawn red.

ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 

"This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

Sometimes you need to delete the init file, save the mission (resets the init file to blank), then reload it the init file (CTTS.lua) and save again... I think that's what he was talking about.

 

I find sometimes I need to do the same with MIST

"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

ah ok, the callspawn red function is borked. I should've read carefully. Yes I confirm you can't spawn reds but loading and unloading your chopper still works, right?

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

Nope - still getting the script error on CallSpawn.

 

.miz attached. I clicked "reset" one the initialization bar and the CTTS.lua disappeared. I then clicked "Open" and reselected the CTTS.lua file and saved the .miz

 

Then i tried to run the miz again and still received the script error.

Transport Tutorial.miz

ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 

"This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

yup - loading and unloading works...

 

I also note the callspawn logistics appears borked too.

 

Any scuttlebutt on script fix?

ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 

"This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

you should probably PM this fellow

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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