Static Objects Spawning/Removing - Page 6 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 07-21-2019, 01:34 AM   #51
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 610
Default

Quote:
Originally Posted by Rudel_chw View Post
Ahhh ... ok, so the Caucasus Parking Spots.lua is actually a reference document that the mission designer has to use when preparing the Reference_Table ... I understand it now
Yes, that's correct. That reference info comes in handy when you need to know the terminal index and type of specific parking spots.

However, I think I've just figured out a way to get the client's terminal index automatically...let me do some testing and report back.
Hardcard is offline   Reply With Quote
Old 07-21-2019, 12:39 PM   #52
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 610
Default

Well, well, I ended up making the script (almost) completely automatic

With this new version, there's no need to place any static templates on the map, statics are created and spawned from "thin air", so to speak.


The script does everything for you, but there are a couple of catches:

- If you want the replacement static liveries to be consistent with the client's, you'll need to fill the Livery_Table, which looks like this:

Spoiler:
local Livery_Table = { -- Add a new subtable for each country that has clients in the mission, then include the client aircraft types as subindices and give each type the chosen livery enumerator as value

[country.id.GEORGIA] = { ["Su-25T"] = "af standard" , ["Su-25"] = "field camo scheme #1 (native)01" , ["TF-51D"] = "Bare Metal" } ,

[country.id.USA] = { ["A-10A"] = "23rd TFW England AFB (EL)" , ["F-15C"] = "65th Aggressor SQN (WA) Flanker" } ,

[country.id.UKRAINE] = { ["Mi-8MT"] = "Ukraine" , ["Su-27"] = "Mirgorod AFB (831th brigade)" } ,

[country.id.GERMANY] = { ["MiG-29G"] = "luftwaffe gray-1" } ,

[country.id.NORWAY] = { ["UH-1H"] = "Norwegian Coast Guard (235)" } ,

[country.id.POLAND] = { ["MiG-29A"] = "Polish 41st Sqn Standard2" }

}

--[[ The livery enumerators are a bit tricky to get, though:

1 - Once you have all the clients set with their respective liveries in the mission, save it and exit

2 - Open the .miz file with winrar/winzip/7zip/etc... and extract the "mission" file from it (doesn't have a format)

3 - Give it a lua format and open it with your editor

4 - Look for all the ["livery_id"] entries, that's where the valid livery string identifiers for each client are
]]



- Replacement statics will only spawn after clients switch slots (they will only replace client aircraft that have been active at least once).


- Remember to provide the common client prefix/suffix (it's in line 147):
Code:
ClientSET = SET_CLIENT:New():FilterActive(Active):FilterPrefixes("common client prefix/suffix"):FilterOnce()


- Remember that you need to join spectators before entering client slots at mission start (when joining the mission for the first time)



Other than this, the script should work anywhere, you can test it in Nevada map if you want

Last edited by Hardcard; 07-21-2019 at 12:52 PM.
Hardcard is offline   Reply With Quote
Old 07-21-2019, 01:08 PM   #53
Rudel_chw
Veteran
 
Join Date: Nov 2013
Location: Antofagasta, Chile
Posts: 4,260
Default

Quote:
Originally Posted by Hardcard View Post
Well, well, I ended up making the script (almost) completely automatic

With this new version, there's no need to place any static templates on the map, statics are created and spawned from "thin air", so to speak.

The script does everything for you, but there are a couple of catches:

- If you want the replacement static liveries to be consistent with the client's, you'll need to fill the Livery_Table ...

- Replacement statics will only spawn after clients switch slots (they will only replace client aircraft that have been active at least once).

Other than this, the script should work anywhere, you can test it in Nevada map if you want
OK, I will try it out today at Nevada ... I understand the advantages of the script being more automatic .. but I will probably miss the statics being there from the beginning of the mission .. let me give it a try and then I will comment more

Thanks a lot and I really apreciate all the effort you have placed on this script development,


Eduardo
__________________
For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra
For Gaming: 27" Monitor - Ryzen 1500X - 32 GB DDR4 2400 - MSI GTX970 - SSD 480 GB - HDD 10 TB - Windows 8.1 Pro - Thrustmaster HOTAS Cougar - Oculus Rift CV1
Mobile: iPad Pro 12.9" of 128 GB
Rudel_chw is offline   Reply With Quote
Old 07-21-2019, 02:20 PM   #54
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 610
Default

Quote:
Originally Posted by Rudel_chw View Post
I will probably miss the statics being there from the beginning of the mission ..
The battle is not lost, I might figure out a way to spawn a first round of statics, regardless of client activation.
In order to achieve this high level of automation, I had to ditch the static spawning method I used in the previous versions of the script (which allowed a bit more freedom in this regard)

This new method is way better, since it doesn't require static templates or reference tables (except for the freaking liveries ), but things can get messy if "unregistered" statics are present on the map when clients start spawning.

I'm pretty sure I can find a way to spawn and "register" a first set of statics, before any clients join

Last edited by Hardcard; 07-21-2019 at 02:24 PM.
Hardcard is offline   Reply With Quote
Old 07-21-2019, 05:36 PM   #55
Rudel_chw
Veteran
 
Join Date: Nov 2013
Location: Antofagasta, Chile
Posts: 4,260
Default

Hello,

I tried the latest sample mission with the automatic script and it works very nicely .. but not having the static planes present from the start takes away from the immersion.

Can you believe that I actually liked more the first version of the script? ... the one that requires establishing trigger zones .. but used with one static for every client, and replacing the 1000 with 100.

For me, it has several advantages that outweight the more involved set-up (the Client name, the static aircraft, the trigger zone, and entering these parameters on the script):

1) It provides a static replacement right from the start.
2) It can spawn a client wherever I want, not necesarily on a built-in Ramp spot, for example I can spawn a Harrier onto a Farp.
3) The handling of liveries is easier than on the latest version.

Take a look at how it works at Nevada



So, at least for me, this version of the Script is a keeper and I intend to use it on all my MP missions from now on

Cheers and thank you once again


Eduardo
__________________
For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra
For Gaming: 27" Monitor - Ryzen 1500X - 32 GB DDR4 2400 - MSI GTX970 - SSD 480 GB - HDD 10 TB - Windows 8.1 Pro - Thrustmaster HOTAS Cougar - Oculus Rift CV1
Mobile: iPad Pro 12.9" of 128 GB
Rudel_chw is offline   Reply With Quote
Old 07-22-2019, 12:39 AM   #56
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 610
Default

How about another version of the automatic script that does the following? :

- Spawn statics right from the start

- Spawn statics at the same coordinates as the clients they're replacing, regardless of their location on the map.


I still need to figure out a way to get the liveries directly from the clients, though...
Hardcard is offline   Reply With Quote
Old 07-22-2019, 01:20 AM   #57
Rudel_chw
Veteran
 
Join Date: Nov 2013
Location: Antofagasta, Chile
Posts: 4,260
Default

Quote:
Originally Posted by Hardcard View Post
How about another version of the automatic script that does the following? ...
But you have already acomplished so much, I feel bad seeing you dedicate so much time to this.

Of course, having the script easier to use would be really nice .. the version that I liked of the script, requires time: to setup the clients, a static for each, a trigger zone and adding its data on the Script table ...

... but I'm already really happy with the end-result ... the MP airbases look really different when they are full of aircrafts, waiting for their pilots to show up

I wonder why this thread hasnt attracted more MP Mission designers ... to me this is a really big deal and dont know why more people isnt more interested ??

Best wishes,


Eduardo
__________________
For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra
For Gaming: 27" Monitor - Ryzen 1500X - 32 GB DDR4 2400 - MSI GTX970 - SSD 480 GB - HDD 10 TB - Windows 8.1 Pro - Thrustmaster HOTAS Cougar - Oculus Rift CV1
Mobile: iPad Pro 12.9" of 128 GB
Rudel_chw is offline   Reply With Quote
Old 07-22-2019, 03:54 AM   #58
Shahdoh
Senior Member
 
Shahdoh's Avatar
 
Join Date: Jan 2013
Posts: 1,263
Default

Very interested, just waiting for the dust to settle!
Shahdoh is offline   Reply With Quote
Old 07-22-2019, 02:00 PM   #59
Rudel_chw
Veteran
 
Join Date: Nov 2013
Location: Antofagasta, Chile
Posts: 4,260
Default

Quote:
Originally Posted by Hardcard View Post
That funny issue happens when both conditions in the following logic check return true ... it might also be that the statics aren't populating Spawned_Static_Table on Birth...Also, perhaps the ClientSET isn't being updated properly...

You can check whether ClientSET is updating properly by uncommenting the following message ...
Hi,

I'm still getting this issue ... not with my own (small) missions, but I was trying to add it to a large existing mission (Las Vegas Variable Attack, by Apache600) ... I uncommented the message, and got this:



and then:



and about 10 seconds later:



On the DCS.log I see this:

Code:
2019-07-22 13:41:49.067 INFO    SCRIPTING: *** MOOSE INCLUDE END *** 
2019-07-22 13:41:49.109 ERROR   EDTERRAINCORE: utm_private::fromLatLon Longitude 0d more than 60d from center of UTM zone 11
2019-07-22 13:41:51.465 WARNING LOG: 133 duplicate message(s) skipped.
2019-07-22 13:41:51.465 INFO    SCRIPTING: Mist version 4.3.74 loaded.
2019-07-22 13:41:51.471 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=A-10A_1_Static41,[Country]=2,[Category]=4,})
2019-07-22 13:41:51.473 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=A-10A_2_Static90,[Country]=2,[Category]=4,})
2019-07-22 13:41:51.475 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=A-10A_3_Static99,[Country]=2,[Category]=4,})
2019-07-22 13:41:51.477 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=A-10A_4_Static32,[Country]=2,[Category]=4,})
2019-07-22 13:41:51.478 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=MiG-21_1_Static12,[Country]=0,[Category]=4,})
2019-07-22 13:41:51.481 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=MiG-21_2_Static24,[Country]=0,[Category]=4,})
2019-07-22 13:41:51.483 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=MiG-21_4_Static24,[Country]=0,[Category]=4,})
2019-07-22 13:41:51.522 ERROR   EDTERRAINCORE: utm_private::fromLatLon Longitude 0d more than 60d from center of UTM zone 11
2019-07-22 13:41:53.500 WARNING LOG: 131 duplicate message(s) skipped.
2019-07-22 13:41:53.500 INFO    SCRIPTING: Generating Laser Codes
2019-07-22 13:41:53.500 INFO    SCRIPTING: Generated Laser Codes
2019-07-22 13:41:53.500 INFO    SCRIPTING: Generating UHF Frequencies
2019-07-22 13:41:53.500 INFO    SCRIPTING: Generated  UHF Frequencies
2019-07-22 13:41:53.500 INFO    SCRIPTING: Generating VHF Frequencies
2019-07-22 13:41:53.500 INFO    SCRIPTING: Generated VHF Frequencies
2019-07-22 13:41:53.500 INFO    SCRIPTING: Generating FM Frequencies
2019-07-22 13:41:53.500 INFO    SCRIPTING: Generated FM Frequencies
2019-07-22 13:41:53.500 INFO    SCRIPTING: Searching for Crates
2019-07-22 13:41:53.500 INFO    SCRIPTING: Crate Found: DictKey_GroupName_2524 - Unit: UH-1H cargo
2019-07-22 13:41:53.500 INFO    SCRIPTING: Crate Found: DictKey_GroupName_2527 - Unit: ISO container small
2019-07-22 13:41:53.500 INFO    SCRIPTING: END search for crates
2019-07-22 13:41:53.500 INFO    SCRIPTING: CTLD READY
2019-07-22 13:41:53.513 ERROR   EDTERRAINCORE: utm_private::fromLatLon Longitude 0d more than 60d from center of UTM zone 11
2019-07-22 13:42:01.495 WARNING LOG: 533 duplicate message(s) skipped.
2019-07-22 13:42:01.495 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=MiG-21_1_Static19,[Country]=0,[Category]=4,})
2019-07-22 13:42:01.497 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=MiG-21_2_Static50,[Country]=0,[Category]=4,})
2019-07-22 13:42:01.498 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=MiG-21_4_Static68,[Country]=0,[Category]=4,})
2019-07-22 13:42:01.518 ERROR   EDTERRAINCORE: utm_private::fromLatLon Longitude 0d more than 60d from center of UTM zone 11
2019-07-22 13:42:50.503 WARNING LOG: 3265 duplicate message(s) skipped.
2019-07-22 13:42:50.503 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=MiG-21_1_Static74,[Country]=0,[Category]=4,})
2019-07-22 13:42:50.505 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=MiG-21_2_Static67,[Country]=0,[Category]=4,})
2019-07-22 13:42:50.507 INFO    SCRIPTING:  11586( 26896)/I:            DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=MiG-21_4_Static2,[Country]=0,[Category]=4,})
2019-07-22 13:42:50.536 ERROR   EDTERRAINCORE: utm_private::fromLatLon Longitude 0d more than 60d from center of UTM zone 11
2019-07-22 13:42:56.149 WARNING LOG: 377 duplicate message(s) skipped.
I've checked the client and statics names and they are ok and correspond to those I placed on the script:

Code:
local Reference_Table = {

    [1] = {
   ClientName = "A-10A_1_Client" , 
   StaticName = "A-10A_1_Static" ,
   Bearing = 130 ,
   ZoneName = "A-10A_1_spawn" ,
   Country = country.id.USA ,
   Coalition = coalition.side.BLUE 
   }, 

  [2] = {
   ClientName = "A-10A_2_Client" , 
   StaticName = "A-10A_2_Static" ,
   Bearing = 130 ,
   ZoneName = "A-10A_2_spawn" ,
   Country = country.id.USA ,
   Coalition = coalition.side.BLUE
   }, 
   
   [3] = {
   ClientName = "A-10A_3_Client" , 
   StaticName = "A-10A_3_Static" ,
   Bearing = 130 ,
   ZoneName = "A-10A_3_spawn" ,
   Country = country.id.USA ,
   Coalition = coalition.side.BLUE
   }, 
   
   [4] = {
   ClientName = "A-10A_4_Client" , 
   StaticName = "A-10A_4_Static" ,
   Bearing = 130 ,
   ZoneName = "A-10A_4_spawn" ,
   Country = country.id.USA ,
   Coalition = coalition.side.BLUE
   }, 
   
   [5] = {
   ClientName = "MiG-21_1_Client" , 
   StaticName = "MiG-21_1_Static" ,
   Bearing = 130 ,
   ZoneName = "MiG-21_1_spawn" ,
   Country = country.id.Russia ,
   Coalition = coalition.side.BLUE 
   }, 

   [6] = {
   ClientName = "MiG-21_2_Client" , 
   StaticName = "MiG-21_2_Static" ,
   Bearing = 130 ,
   ZoneName = "MiG-21_2_spawn" ,
   Country = country.id.Russia ,
   Coalition = coalition.side.BLUE 
   }, 
   
    [7] = {
   ClientName = "MiG-21_3_Client" , 
   StaticName = "MiG-21_3_Static" ,
   Bearing = 130 ,
   ZoneName = "MiG-21_3_spawn" ,
   Country = country.id.Russia ,
   Coalition = coalition.side.BLUE 
   }, 
   
    [8] = {
   ClientName = "MiG-21_4_Client" , 
   StaticName = "MiG-21_4_Static" ,
   Bearing = 130 ,
   ZoneName = "MiG-21_4_spawn" ,
   Country = country.id.Russia ,
   Coalition = coalition.side.BLUE 
   }, 
   
}
Strangely, the A-10's on the background dont suffer from this effect, even tough I've defined them identically. Could it be that on this missions the clients are grouped onto 4-ship units?

The mission is too large to attach, but I could upload it onto a cloud if you would like to take a look at it

Cheers!

Eduardo
__________________
For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra
For Gaming: 27" Monitor - Ryzen 1500X - 32 GB DDR4 2400 - MSI GTX970 - SSD 480 GB - HDD 10 TB - Windows 8.1 Pro - Thrustmaster HOTAS Cougar - Oculus Rift CV1
Mobile: iPad Pro 12.9" of 128 GB
Rudel_chw is offline   Reply With Quote
Old 07-22-2019, 03:36 PM   #60
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 610
Default

Quote:
Originally Posted by Rudel_chw View Post
But you have already acomplished so much, I feel bad seeing you dedicate so much time to this.
I'm doing this for me as much as for you and others, don't worry about it.
Learning new stuff as I go, increasing my understanding of lua and perfecting the script, two birds with one stone, as they say.

The good news is that I think I've finally found a way of keeping things automatic while having statics spawn from mission start (without being tied to parking spots).

This new script I'm working on is the best version so far (I think)... but the required setup process requires some explaining (probably will post a tutorial video for this in the near future)


@Rudel

I'll send you the new files + a link to a video tutorial that I've made for you (in Spanish)
I hope this new version will satisfy all your fundamental requirements

As for the issue you're having with those MiG21s, you're using one of the previous versions of the script (the "improved" one?), I've changed things around in the latest versions.
Hardcard is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:51 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.