Jump to content

Complete transport script


geloxo

Recommended Posts

Thanks for digging that up ENO! I found the function in CTTS with Notepad++ and it was actually line 552, at least in the version that I pulled from the top of this thread yesterday.

 

I pasted it over the original function and tested it but couldn't make it work. In fact, it said I dropped the troops but didn't actually generate any. I've done a smaaaaaall amount of work with programming languages before, mainly Javascript, but I'm super duper new to LUA so I don't think I should mess around with it too much myself. Any thoughts?

 

Also, just to clarify, MIST isn't actually a script file that I need to load alongside CTTS in the ME right, because it didn't do that?

 

Thanks again -- rep coming :-)

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

Does this point out any obvious errors to you? Like I said, I'm not good enough with script to tell.

 

 

Here's the original script:

 

function ConfigGroup (newGroup, groupside)

if groupside == 2 then

coalition.addGroup(country.id.USA, Group.Category.GROUND, newGroup)

elseif groupside == 1 then

coalition.addGroup(country.id.RUSSIA, Group.Category.GROUND, newGroup)

else

coalition.addGroup(country.id.INSURGENTS, Group.Category.GROUND, newGroup)

end

 

return

end

 

 

This is the new script:

 

function ConfigGroup (newGroup, groupside)

newGroup.category = 'GROUND_UNIT'

if groupside == 2 then

newGroup.country = 'USA'

elseif groupside == 1 then

newGroup.country = 'RUSSIA'

else

newGroup.country = 'INSURGENTS'

end

 

mist.dynAdd(newGroup)

return

end

 


Edited by rassy7
Compare scripts

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

Just to clarify- mist can be loaded as a mission start trigger with no conditions and do script file. Latest is 3.2.

 

To load CTTS you can have it initiate if you just load it at the bottom of the triggers page. Once you save you mission it's embedded but don't forget you need to resave CTTS any time you make changes to it.

 

As most guys in here will attest I'm no good at interpreting scripts but if those are the ones I've pointed you towards copy and pasted they should be fine.

"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

Assuming you are using the latest version he has on that thread, version 1.04.

 

Goto line 652 and copy and paste over the ConfigGroup function with the following.

 

 

function ConfigGroup (newGroup, groupside)
newGroup.category = 'GROUND_UNIT'
if groupside == 2 then 
	newGroup.country = 'USA'
elseif groupside == 1 then
	newGroup.country = 'RUSSIA'
else 
	newGroup.country = 'INSURGENTS'
end

mist.dynAdd(newGroup)
return
end

 

Ok, I'm about to give up on this. I downloaded MIST 3.2. Loaded it as MISSION START with no condition and Do Script File.

 

Followed that with a Time More Than (2) condition and Do Script File to load CTTS (with the ConfigGroup script replaced as Grimes dictated but on line 552, because that's where the ConfigGroup script began in the CTTS v1.04 in Notepad++)

 

I attached Message To All actions to ensure both MIST and CTTS loaded - both did.

 

I set up a test trigger as ONCE - Unit Inside Zone (Also tried Part Of Group In Zone and All Of Group In Zone) - Message To All

 

I loaded the unit from outside the zone, transported him to inside the zone and unloaded him. CTTS told me I unloaded troops. The unit was created and started to run toward enemies but no message. Group name was preserved but I can't seem to get that to trigger anything. I'm not sure what could be fouling this up. 1.2.6? Trigger type? I feel like it is something simple I'm missing. Hmmm ...

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

No dice. Thanks for the reoly tho Midnight.

 

I created a new mission from scratch for testing this. One helicopter. One unit. One zone. MIST and CTTS. Can extract and drop without error. Group name of unit is preserved but still no action triggered.

 

I'm going to redownload CTTS and MIST and try again. I have to believe something somewhere was accidentally changed in the script that is affecting this.

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

I see. I was already trying to find other options as well. I'm working on a sort of hostage rescue scenario. I'd like to trigger mission goals for points along with other actions, including and eventually a mission end when the units are moved to a safe zone. Finding a work-around is tricky because the only way I can think to force this to happen after the units are evacuated is to have them trigger the actions themselves. I have noticed if the units start it a zone, when they are loaded, the unit outside zone trigger fires just fine but I can't work a way to get an action triggered in the other end, when the units are unloaded. After all, if a chopper evacuating a unit gets shot down in the way back, the mission really shouldn't be successful.

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

I think it was st3v3 who came up with a script that allowed to register units landing in particular zones. It's helped me out a TON with various concepts so if you need that script let me know and I'll go find it. It's a lua predicate that is set in a condition for a trigger... can be used in conjunction with a unit in zone or part of group in zone trigger.

 

I've got the same problem. What I've done is set it up so that I have a flag for various units that land in one zone (to evac) and then in a second zone (drop off safe).

 

Unit 1 (helo) takes off and lands in zone (with use of script and a flag). I then have a condition that if that flag is true and the unit lands in the second zone a second flag is dropped. I then set a trigger for when both flags are true... it can increase a flag value (1 and 2 are true so increase flag 100 value by 1.

 

In some cases it gets a bit more complicated since a single chopper may be doing all the transfers in which case you need to factor that into your conditions (again, I'm more restricted then some of the smart guys in here so I tend to fall back on the mission editor abilities.) In this case I end up setting a flag equals value in the conditions to represent the fact that a transfer has already taken place and then build the action around that so that single unit going back and forth can still accomplish the mission (if multiple trips are required).

"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

ENO, that's an excellent idea, thanks. I suppose since this particular transfer would only take place once, since once the evac units are loaded they're gone until either moved or forever if the chopper is shot down, I could include a Unit Out Of Zone condition along with the flag for landing in the first zone (the evac zone).

 

Perhaps I could also use a radio trigger of my own for the pilot to select right after unloading the evac units under the guise of, oh I don't know, calling in the unit has been returned safely and make that option dependant upon conditions relating to the second flag, made available when the helo lands in the safe zone.

 

For a one-time transfer for us more-or-less limited to ME coders, ;) that might work all right. I have to go try it out.

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

Again you would need to set the trigger up as a "switched condition" and with a condition under "lua predicate."

 

Copy and paste the following:

 

local group = 'yourgroupnamehere' --Enter the groupname from the ME here

 

group = Group.getByName(group)

if group ~= nil then

group = group:getUnits()[1]

if group:inAir() then

return false

else

return true

end

else --If Group does not exist

return true

end

return false

 

 

 

 

 

If you want to make it zone specific- add the "unit / group in zone" condition... then you can set the appropriate flags.

"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

That's great! Credit to St3v3 and thanks so much for finding it for me. Can't wait to plug it in and get going with it. I have a few ideas in mind for using it.

 

Thanks again, ENO, for all your help and thanks largely to you, I finally got my mission finished. Guess it's time to start fiddlin' around with a new one, ;)

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

I'm having an issue with dropped troops not going out past 1.5 - 2km from drop point in search of the enemy. They are heading in the right direction though.

Ive tried editing line298 maxDistEnemy and also tried and the standalone function CallSpawn("blue", 6, "LZ hammer", 8000). Both end in the units heading off towards the enemy, but stopping after only going 1.5-2km.

What am i missing? Any help would be appreciated.

 

Edit: Sorted it out. Apparently dropped or spawned groups only target the #1 unit of an enemy group. They will engage any other units that they come across that are within range though.


Edited by LiveBait
Link to comment
Share on other sites

Output flag value to groups

 

Hi everyone, i noticed that you can output flag values as text to everyone. (with a script on page 4 in this thread)

 

I need a script that output the flag value to certain groups. So other units doesn't get spammed.

 

eg. "You have transported 5 logistic items"

 

Any help would be much apprecitated :)

 

(if there is an easier way then through a script it would be even more awesome)

i7 8700K | GTX 1080 Ti | 32GB RAM | 500GB M.2 SSD | TIR5 w/ Trackclip Pro | TM Hotas Warthog | Saitek Pro Flight Rudder

 

[sigpic]http://www.132virtualwing.org[/sigpic]

 

Link to comment
Share on other sites

Hi, I'm really, really, newbie in scripting... I tryed to use the spawn script to make soldiers moving away a dead transport few seconds after impact... but I failed :(

I never found this kind of script... does it exist ?

My goal is more generally to be able to make a random number of soldiers running away a killed armor or transport (0 to 4-5 for a tank and 0 to 10-12 for transport for example). I think it can be really more immersive :)

Do you think it can be done (if it doesn't exist ... ) ?

[/url]All known Dynamic Campaign Engine Campaigns

Last DCE news : Crisis in PG - Blue version

Link to comment
Share on other sites

Basically you'd need to do something like MIST spawn in zone when the unit is dead... but you'd need to make a moving zone around each unit that you wanted to do this to.

 

I know you can spawn units or clone units in a zone- but I'm not sure if it applies to moving zones?

 

 

The way I see it playing out is you'd have a bunch of different units tucked away in a far away place on the map where people won't go... make them invisible on the map. When the unit is destroyed you can simply trigger the script that clones the appropriate group into the moving zone. You could have one group of 3, one group of 4, one group of however many. If a tank unit is destroyed, you can clone the group in the moving zone with disperse set to true. This will clone the group of 3 in the middle of the zone- which should be around your vehicle- and scatter them for a certain distance. The only problem is a) part of the group getting killed by the explosion of the vehicle (which adds some randomness) and b) not sure if you can teleport / clone units in moving zones.

 

Perhaps someone in the know could fill us in?

 

 

In addition- currently there are some MP issues with cloning and spawning in zone- many of these MIST functions aren't working in the MP environment- I think it's a 1.2.6 problem though.


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

Actually, I think there is a script around that does pretty much what you'd like. Spawns infantry when vehicules are destroyed. It then calls for Medevac.

 

Try searching for Medevac script.

 

EDIT: Ok, found it. Dynamic Medevac Script

If a ground-vehicle on your side is destroyed, some infantry will spawn representing the crew of the vehicle

 

Could do the trick. I haven't tried it myself


Edited by Robin_Hood
Link to comment
Share on other sites

I am currently working on a mission involving multi drops of construction material and would like to count how many loads have been delivered. I get how the count can be stored to a flag, what I need to know is how best to access the flag to get the info.

 

Hope someone can help:)

i5 8600k@5.2Ghz, Asus Prime A Z370, 32Gb DDR4 3000, GTX1080 SC, Oculus Rift CV1, Modded TM Warthog Modded X52 Collective, Jetseat, W10 Pro 64

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

use Do Script and try this (assuming the flag you use is 99):

 

local myFlagValue = trigger.misc.getUserFlag('99')

trigger.action.outText('Loads delivered: ' .. myFlagValue, 10)

 

Of course, this is used just to show on the screen what is that flag value. You can do whatever you want with myFlagValue.

  • Like 1

[sIGPIC]OK[/sIGPIC]

Link to comment
Share on other sites

The text is displayed for everyone and if you want it being displayed for

 

-coalition you must have it trigger.action.outTextForCoalition(coalition.side.BLUE,'Loads delivered: ' .. myFlagValue, 10)

-country you must have it trigger.action.outTextForCountry(country.id.UK,'Loads delivered: ' .. myFlagValue, 10)

-group you must have it trigger.action.outTextForGroup(Group.getID(Group.getByName('TornadoOne')),'Loads delivered: ' .. myFlagValue, 10)

[sIGPIC]OK[/sIGPIC]

Link to comment
Share on other sites

  • Recently Browsing   0 members

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