Jump to content

SWAPR - SWeet Automatic Player Replacement script


Hardcard

Recommended Posts

In theory it's pretty simple, just add more strings to a table, like this:

(from the reference builder as an example):

 

local AI_SET = SET_UNIT:New():FilterPrefixes({"Prefix1_","_Suffix2","string3","etc"}):FilterOnce()

 

Ah, yeah I forgot to close the array when I tried it the first time :doh: Thanks, works great ~

Link to comment
Share on other sites

@Anyone interested

 

Just letting you know that I think I've found a way to skip the Reference_Table builder step altogether.

 

If things go as expected I'll be uploading a new version of SWAPR, which won't require users to generate the Reference_Table and dump it in dcs.log (it won't require switching clients to AI either)

Also I think I can make it work with shelter-based clients as well (no more spawning on shelter roofs).

 

What's even cooler, I'll try the new method with carrier-based aircraft as well, with a bit of luck, I might pull it off :thumbup:

 

 

Thanks to Funkyfranky and Nolove for their guidance and tips :thumbup:


Edited by Hardcard
Link to comment
Share on other sites

I'm the only one who have problem when spawning ?

My helo is always broken.

If i don't want to break it, i have to select my helo, spawn, go back to spectator then select the same helo.

It happen on a dedicated server (ping 25), not on solo.

Screen_190807_104322.thumb.jpg.f86ec234b5bdbc7151ce8c9b242b8d97.jpg

Screen_190807_104339.thumb.jpg.72e1ac4e763e9cd69e579f22ad44eed7.jpg

People fly planes, pilots fly helicopters

Link to comment
Share on other sites

@wolf5

 

Interesting... are the helos falling from an altitude or do they simply spawn broken?

 

Also, I'll need you to specify the map, the airbase and the parking spot number(s) (I'm assuming this doesn't happen with helos placed on other airbases, right?)

 

Btw, you can just PM me the mission file (as long as it's not based on the Normandy map)


Edited by Hardcard
Link to comment
Share on other sites

Also, I'll need you to specify the map, the airbase and the parking spot number(s)

 

Definitely Caucasus, looks like Min Vody. I'll leave the rest to you guys. ;)

 

Haven't tried this script yet, but it sounds awesome, I'll be following progress and let you know how it works for me when the time comes. :thumbup:

Link to comment
Share on other sites

Oh, forgot to write it here to but after sending Hardcard my mission it was a classic case of "damnit, of course" and I had placed units inside hangars but that didn't show as hangars in the ME and I was to sloppy to check each unit in-game to realize that was the case. So, it was not a SWAPR error, it was a Bamse-error :D

 

@Hardcard the upcoming changes sounds amazing! Can't wait to try it out when it's ready! :D

Link to comment
Share on other sites

I had placed units inside hangars but that didn't show as hangars in the ME:D

 

Bamse is referring to Senaki and Kutaisi parking spots, many of them are sheltered (even though this can't be appreciated in the F10 / ME map).

 

Aside from SWAPR, I'm also working on a little parallel project... basically, I'm creating reference parking spot data for all airbases in the game (I'm almost finished with all Caucasus airbases).

 

The problematic parking spots Bamse is referring to can be seen in the following pics (all the TERM_TYPE 68 spots are sheltered, so the current version of SWAPR will ignore them) :

 

 

PKQWhjV.jpg

5zN3C8Y.jpg

 

 

 

 

@Hardcard the upcoming changes sounds amazing! Can't wait to try it out when it's ready! :D

 

Yes, it'll be pretty cool, but I need to get it working first :thumbup:

Link to comment
Share on other sites

@hardcard's Script works fine for me, I've been adapting some MP missions for use on my own Dedicated Server and have not found any issues besides the FARP's helos some times refuse to allow joining a Client there ... but I understand that this is more of a DCS issue than the script's

 

Here is a short video of an old MP Mission that I want to adapt for use on my Server:

 

wLnXlCDPMVk

 

:)

 

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

@wolf5

 

This is pretty weird, I performed tests on Mineralnye Vody this morning and everything worked fine

 

I've tested the mission you attached, it also works without issues in SP

 

If you test it in SP, do you still experience those problems?

 

Also, are you entering spectators before joining a coalition? It's a requirement for the script to work... if you spawn directly after joining, the birth event won't trigger, so the statics won't be cleared when you spawn


Edited by Hardcard
Link to comment
Share on other sites

No problem in SP, only in MP.

 

Sounds like an execution delay problem then... those statics are likely being removed a tad too late, so your clients are being damaged (the helo statics are still being removed in MP, right?)

 

 

Do you want to try by yourself or a video ?

 

If you run the demo mission on a dedicated server, I guess I could connect and try it out, see if I can reproduce the issue ;)

Link to comment
Share on other sites

@Everyone

 

New SWAPR(Plug&Play) version + tutorial video released (main post updated), you'll love it! :thumbup:

 

I was happy with the older version :) .. but of course, I will check out this new one ... cheers!

 

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 old version required quite a bit of work to set up (dump + edit reference tables, etc.), didn't support sheltered clients, it caused problems when switching between FARP clients and didn't allow users to customize offsets (in bulk)

 

This new version still has some limitations, like not supporting multiple-client groups...but I'm working on it!

 

Trust me, you'll be happier with this one!


Edited by Hardcard
Link to comment
Share on other sites

This is a great improvement to an already great script. Will need to test to see if it solved the high client count issue.

 

About the only other thing I would like to see if it could be added is an OPTION to disable the slot if the aircraft was damaged while waiting for a client. Along with the option to turn that on and off, a variable to set how long you wanted it to be disabled for.

 

Though, even without that capability, you have done something great for the community and thank you for all the time and effort you have put into this.

Link to comment
Share on other sites

This is a great improvement to an already great script. Will need to test to see if it solved the high client count issue.

 

I'd be surprised to see that issue resurface with the plug & play version... but, please, keep me posted!

 

Reference tables are automatically generated and accessed now, no dumps on dcs.log required... so it should work fine? (fingers crossed)

 

As for your parking spot block suggestion, I'll need to discuss it with the scripting gurus, see if we can pull it off.

 

Like I said, I'll keep improving this script until it does pretty much everything a user would want. :thumbup:


Edited by Hardcard
Link to comment
Share on other sites

Just tested in SP and MP. No errors with 206 client aircraft on the Normandy map.

 

Observations:

- Aircraft now show preloaded ordinance where the statics did not.

- With this many clients, I did notice a performance hit on FPS. This is not the scripts fault though, just have to keep in mind number of displayed objects (with ordinance, skins, etc) that the mission creator must balance for a smooth mission.

- Client aircraft set to hidden in the ME are not hidden when sitting on the ramp. Is it possible to carry over that value to the inactive aircraft?

 

Major improvements overall and no setbacks that I could see. Awesome work!!!

Link to comment
Share on other sites

Just tested in SP and MP. No errors with 206 client aircraft on the Normandy map.

 

Awesome :thumbup:

 

- With this many clients, I did notice a performance hit on FPS.

 

Yes, that's the real downside of SWAPR... you would experience pretty much the same performance hit if the plane replacements were statics instead of uncontrolled AI.

 

The good news is that you're now able to replace sheltered clients as well (with their loadouts and all, which is pretty sick ;) )

 

- Client aircraft set to hidden in the ME are not hidden when sitting on the ramp. Is it possible to carry over that value to the inactive aircraft?

 

Oopsie, that was an oversight on my part, let me fix it real quick ;)

 

EDIT: The issue should be corrected now (new SWAPR script uploaded), keep in mind that it'll only work for replacement planes located in airbases. Helicopter and plane replacements outside airbases won't be hidden.

 

I mean... I guess I could get rid of static replacements altogether and use uncontrolled AI replacements exclusively (so they would also "inherit" loadouts and settings like "hidden")... might end up doing that in the future, we'll see.


Edited by Hardcard
Link to comment
Share on other sites

  • Recently Browsing   0 members

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