Jump to content

Static Objects Spawning/Removing


Woodbuster

Recommended Posts

Well, I've managed to improve the script quite a lot, now you only need to fill up the reference table and specify the common client prefix/suffix, the script should take care of the rest :thumbup:

...

Demo mission + script file attached

 

Hello,

 

Tried the mission on my gaming PC and it works perfectly, but on my dedicated server (same DCS version) it works fine until a client is destroyed .. afterwards, the moment I try to get myself onto another slot the client DCS crashes:

 

np6XXLe.jpg

 

The Server mission still runs, if I restart the client DCS I can connect again to the mission on the Server with no issues.

 

I'm finishing my last two Mig-29 missions and after that I will try the script again but on a mission of my own .. just to gather more information and to try different planes.

 

Will keep you informed.

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: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Thanks for testing it!

 

Looks like you're getting access violations, for some reason...

 

I created the mission using the latest openbeta, btw, if your dedicated server is running something else, that might explain the problem.

 

It's also possible that the mission / script needs to be modified in a certain way for MP...

 

I'll investigate and ask around, see if I can find answers

Link to comment
Share on other sites

I created the mission using the latest openbeta, btw, if your dedicated server is running something else, that might explain the problem.

 

I'm also running the latest Openbeta, both on my client machine and on the dedicated server ... I'm still pretty excited with your script, as it is the closest I've ever seen to achieve the ideal of being able to "see" other client's planes when there is no one on-board of them .. :)

 

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: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

@Rudel_chw

 

Hi there!

 

I've had the chance to test the mission in MP and it was all fine, no access violation crashes after switching clients (even after dying).

 

There was increased delay, though, which caused statics to remain on the parking spots for just a tiny bit longer, but other than that, everything seemed fine.

 

Looks like the problem might be on your end


Edited by Hardcard
Link to comment
Share on other sites

We were talking about Statics with Linked units and offsets the other day.

 

 

The mission file seemed to refer to a couple of places where it says linked is true and provides the offset. But I haven't been able to use dynAdd with the extra parts of the table included. It might not be supported in the function. Well, the function isn't supported anyway by ED, but I mean, not designed to work. Anyone else tried?

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

@Pikey

 

I've never used MIST, sorry.

 

However, if you're interested in getting an offset spawn coordinate from a POSITIONABLE, Funkyfranky created :GetOffsetCoordinate(x,y,z) (keeps the relative offset, regardless of orientation, it's pretty neat)

 

It's not included in the MOOSE documentation yet, but it's in the latest Moose include ( develop ), it works quite nicely.

 

You can get the vec2 from the returned coordinate, which can be used by dynAdd.


Edited by Hardcard
Link to comment
Share on other sites

@Rudel_chw

...

Looks like the problem might be on your end

 

Ok, will check my DCS install, maybe there is a conflict with one of my Mods ...

 

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: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

The improved script makes customisation easier, unfortunately it doesn't work with more than 2 Clients.:(

 

That doesn't sound right. It should work with any number of clients you want.

Let me add a gazillion clients and report back... oh wait, you meant more than two people playing at the same time?


Edited by Hardcard
Link to comment
Share on other sites

I've made further improvements to the script and added extra clients (12 total)

 

I experienced Rudel_chw's access violation the very first time I included an extra client, but looks like the issue is solved now (fingers crossed).

 

 

New demo mission + script file attached

 

IMPORTANT NOTE: I've gotten rid of spawn zones, spawn coordinates are now directly obtained from the parking spots on Kobuleti (other airfields are not supported at this point...unless you know the terminal IDs).

Also, add a replacement static for each client and give it a unique name, otherwise there are problems. Set the static templates to DEAD, though, that way they shouldn't impact performance.

 

You'll also notice that I've made further modifications to the reference table (and some other stuff elsewhere):

 

 

local Reference_Table = {

 

[1] = {

ClientName = " Pilot name of the first client " ,

StaticName = " Replacement static name " ,

Bearing = number ,

Country = country.id.COUNTRY ,

Coalition = coalition.side.COLOR ,

Spawn_Coords = Park_Coord(" Airbase name ", Term_Index ) -- Airbase name should be the same as in the F10 map. Term_Index is an internal parking spot identifier, check this pic for reference (use the numbers in red)

},

 

[2] = {

ClientName = " Pilot name of the second client " ,

StaticName = " Replacement static name " ,

Bearing = number ,

Country = country.id.COUNTRY ,

Coalition = coalition.side.COLOR ,

Spawn_Coords = Park_Coord(" Name of the airbase ", Term_Index )

},

 

-- etc...

 

}

Client Static Replacement (further improved).miz

Client Replacement with Statics (further improved).lua


Edited by Hardcard
Link to comment
Share on other sites

Ok, will check my DCS install, maybe there is a conflict with one of my Mods ...

 

 

@Hardcard, it seems one of my Mods was conflicting (tough I dont know which yet) .. now your "improved" version of the mission works fine on my Dedicated Server and I didnt encounter any crashes at all.

 

 

I was trying to edit my own mission on Nevada using the improved script, but cant get it to work properly .. not sure if it may be the Map itself, so I will make a 2nd attempt using Caucasus, and report back.

 

 

:)

 

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: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

I've made further improvements to the script and added extra clients (12 total) ...

 

IMPORTANT NOTE: I've gotten rid of spawn zones, spawn coordinates are now directly obtained from the parking spots on Kobuleti (other airfields are not supported at this point...unless you know the terminal IDs).

 

I tried the mission locally and it works perfectly .. but I'd prefer it to still use spawn zones, so I could use it on any airbase, I dont mind creating one zone for each client (nor one static for each too)

 

However, I will study the script to see what I can learn :D

 

Thanks a lot for all your effort with this subject, as this Script truly has the potential to be a big breakthrough, being able to see every client aircraft is so immersive for MP and I've wished for it for a long time.

 

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: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

I was trying to edit my own mission on Nevada using the improved script, but cant get it to work properly .. not sure if it may be the Map itself, so I will make a 2nd attempt using Caucasus, and report back.

 

@Hardcard, it was a mistake on my part ... the 2nd version of your Script (the "improved" one :) ) works fine at Nevada ... tough I have to be careful not to use any Ramp location that has roofs:

 

QW0Ltwm.jpg

 

:D

 

I really thinks that this version of the script is easy enough to use and works perfectly ... will do more testing on the Dedicated Server, just to be more thorough ... will report back soon.

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: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Hi guys!

 

Don't worry, I'm currently mapping all airbases in Caucasus, then I'll move on to PG and Nevada airbases.

 

My goal is for this script to work, no matter what you throw at it :thumbup:

 

 

 

@Rudel_chw

 

If you're using the second version of the script (the "improved" one), make sure to include one static per client (their names must be unique), otherwise you'll experience problems with aircraft of the same type not spawning.

 

Also, in the following line, change 1000 for 100 (I suspect 1000 causes problems):

 

SPAWNSTATIC_Table[i]:SpawnFromPointVec2( ZONE:New(client.ZoneName):GetPointVec2(), client.Bearing, client.StaticName..math.random(1, [color="Red"]1000[/color]) )

 

 

As for the static spawning on top of that structure, I haven't tested anything in NTTR yet, we'll get there ;)


Edited by Hardcard
Link to comment
Share on other sites

Don't worry, I'm currently mapping all airbases in Caucasus, then I'll move on to PG and Nevada airbases.

 

My goal is for this script to work, no matter what you throw at it :thumbup:

 

I'm so glad to hear that ... this is potentially a big breakthrough for Multiplayer Mission Design, giving us a much more realistic starting airbase, even if not enough pilots are present at start :) ... so, kudos to you for making this possible.

 

@Rudel_chw

 

If you're using the second version of the script (the "improved" one), make sure to include one static per client (their names must be unique), otherwise you'll experience problems with aircraft of the same type not spawning.

 

Yes, I noticed that .. :)

 

Also, in the following line, change 1000 for 100 (I suspect 1000 causes problems):

 

OK, will do.

 

As for the static spawning on top of that structure, I haven't testing anything in NTTR yet, we'll get there ;)

 

Actually, that's a known issue of DCS .. you cant place a static plane under those roofs, even if I place it by hand on the ME .. it's no biggie, as there are not too many of such places.

 

I was trying to add this script to an existing mission, but for some reason the statics keep appearing on top of each other, one level every 10 seconds or so .. like this:

 

n5dfJo2.jpg

 

I suspect that it may be a conflict with a pre-existing script, as this Mission uses Mist too ... so, dont worry about it :)

 

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: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

That funny issue happens when both conditions in the following logic check return true:

if ClientSet:FindClient(client.ClientName) == nil and Spawned_Check(client.StaticName) == false then

 

It might be a naming issue (affecting clients and / or statics), 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 (line 94 in the "improved" demo mission script):

-- MESSAGE:New("Static_Spawner running!\nClientSet count = "..ClientSet:Count(), 10):ToAll()

 

It'll give you a count of active clients... make sure that it's consistent with the number of clients currently active (remember that they must all use the PILOT name prefix / suffix for it to work!)


Edited by Hardcard
Link to comment
Share on other sites

The mapping process is going smoothly, I'm done mapping all Georgian airbases (Blue) in Caucasus map (raw data file attached) .

 

Its a big task .. can I help by doing Nevada? .. you’d have to teach me, but it may be worthwhile :)

 

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: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Its a big task .. can I help by doing Nevada? .. you’d have to teach me, but it may be worthwhile :)

 

Trust me, you don't want to go through such torture :lol:

 

I've already mapped all airbases in Caucasus (raw data file attached, pics are coming soon!), PG is next in the list.

Don't worry, I'll do Nevada as well.

Caucasus Parking Spots.lua


Edited by Hardcard
Link to comment
Share on other sites

Trust me, you don't want to go through such torture :lol:

 

ok, just wanted to easen the burden on you :)

 

I've already mapped all airbases in Caucasus (raw data file attached, pics are coming soon!)

 

I've studied your "further improved script" and there is something that puzzles me .. where is the parking spots data table? I cant find it anywhere within the sample .miz file :(

 

PG is next in the list.

Don't worry, I'll do Nevada as well.

 

That's excellent .. I'm interested in Nevada as I intend to edit a missions series there for my country's C-101 .. it's more believable to imagine our Air Force being invited to Red Flag, than showing up on Caucasus or the Persian Gulf :D

 

Best regards and thanks a lot for all your effort on this script ... 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: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

I've studied your "further improved script" and there is something that puzzles me .. where is the parking spots data table? I cant find it anywhere within the sample .miz file :(

 

 

The required terminal indices for the demo mission clients are already included in Reference_Table:

 

 

[1] = {

ClientName = "Su25T_Client" ,

StaticName = "Su25T_Static" ,

Bearing = 340 ,

Country = country.id.GEORGIA ,

Coalition = coalition.side.BLUE ,

Spawn_Coords = Park_Coord("Kobuleti", 37) -- 37 is the terminal index for this client. It's used by Park_Coord function, in order to get the precise spawn vec2 for the replacement static

},

 


Edited by Hardcard
Link to comment
Share on other sites

The required terminal indices for the demo mission clients are already included in Reference_Table:

 

 

[1] = {

ClientName = "Su25T_Client" ,

StaticName = "Su25T_Static" ,

Bearing = 340 ,

Country = country.id.GEORGIA ,

Coalition = coalition.side.BLUE ,

Spawn_Coords = Park_Coord("Kobuleti", 37) -- 37 is the terminal index for this client. It's used by Park_Coord function, in order to get the precise spawn vec2 for the replacement static

},

 

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 :)

 

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: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

  • Recently Browsing   0 members

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