Jump to content

SWAPR - SWeet Automatic Player Replacement script


Recommended Posts

This fixed the issue.

 

Thanks again.

 

:thumbup: you're welcome, glad that the problem was solved .. this fixes of MIST were provided to me by @Hardcard :)

 

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 3600 - 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 post
Share on other sites
  • Replies 187
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

@Anyone Interested   After days of tweaking and testing, SWAPR 1.4 is finally out!  Main post updated with new videos and links (old videos and links removed)   04-05-2021

SWAPR works fine with 2.7 - if anyone was wondering.   My SWAPR enabled missions work the same as before in 2.7.

@Mav87th Thanks, I'll take a look.  You didn't include your dcs.log in the zip file, please provide it as well. It's located in C:\Users\YourUserName\Saved Games\DCS.openbeta\Logs

  • 1 month later...

Soooo cool story, I tried to use your script. Very cool idea by the way! Buuuuttttt it looks like I either A. Did something wrong or B. Script is broken for newer versions.

 

 

 

At first everything looked great. All the aircraft where there, chillin. But then when we went to spawn into aircraft it was spawning the aircraft in the other aircraft. Took awhile to figure out what is going on because we would just explode when we started moving.

Link to post
Share on other sites

@Neon

 

Please provide the mission file.

 

Also, in case it was running on a dedicated server, provide the server hook and the dcs.log from that session as well.

 

I'll look into it, but, from your description, looks like replacements aren't being removed when clients spawn (possible scripting error along the way)


Edited by Hardcard
Link to post
Share on other sites
  • 1 month later...

We have the problem that on our dedicated squadron server, every now and then a replacement doesn't de-spawn in time, and then it explodes, usually damaging the freshly spawned client aircraft.

 

We haven't found any common cause so far. It usually happens no more than once at squad training, but it doesn't always happen. It seems to be most likely to happen to the player that joins 3rd or 4th. All others spawn without a problem. The slots themselves work fine at other times (I've tested every single client slot in our squad mission before SWAPR went live).

 

Most unfortunately, the server log doesn't show anything remotely linked to SWAPR when those hick-ups occur.

 

Should I send you the mission?

 

I guess the server hook should be out of the question, because it works mostly fine and these problems appear to be almost random.

 

Anyone else having this type of problem?

 

In our case, it's a mission based in Nellis (not on any aircraft carriers).

Link to post
Share on other sites

@Yurgon

 

I don't have Nevada map installed due to limited space in my SSD, so I can't test your mission atm.

 

The problem you're describing could be caused by some obscure scripting error that only appears in certain situations (when several players connect, for instance)... or it could be caused by processing times getting longer (as players join and the mission runs).

 

 

Key question #1: Are those problematic replacements being removed at all, or do they remain and make clients go boom?

 

If they are being removed, the problem is likely caused by increased processing time.

If not, there's probably a scripting error, somewhere (I'll need log info).

 

 

Key question #2: Does this happen only with specific types of replacements or not?

 

Static, AI...both?

Any specific airframe types?

 

 

Key question #3: Solving this problem will probably require dozens of failed tests on your dedicated server... are you willing to endure the torture? :D

Link to post
Share on other sites
  • 2 weeks later...

@Careos

 

The demo mission works for me.

 

Keep in mind that it's configured for multiplayer (needs to run on a server)

 

Also, you need to place SWAPR_Server_Hook_1_2.lua (provided inside the demo mission folder) in System_Drive:\Users\YOUR_USERNAME\Saved Games\DCS.openbeta\Scripts\Hooks

 

 

 

If you're having problems with one of your own missions, please include your mission file, dcs.log and server hook (if MP) in your report


Edited by Hardcard
Link to post
Share on other sites
Key question #1: Are those problematic replacements being removed at all, or do they remain and make clients go boom?

 

If they are being removed, the problem is likely caused by increased processing time.

If not, there's probably a scripting error, somewhere (I'll need log info).

 

They remain and make the clients go boom, quite impressively if I may say so. ;)

 

Their wreckage also usually stays on the ground and causes problems later on if/when other aircraft taxi across that place.

 

When we looked at the logs, there were no log entries even remotely hinting to anything related to these problems.

 

Key question #2: Does this happen only with specific types of replacements or not?

 

Static, AI...both?

Any specific airframe types?

 

I've set replacements to "AI" in that mission, but have not tested "Static".

 

It definitely happened with A-10C, but I think our UH-1H were also affected.

 

Just to re-iterate, the slots themselves definitely worked fine at other times; the problems appeared to be fairly random.

 

Key question #3: Solving this problem will probably require dozens of failed tests on your dedicated server... are you willing to endure the torture? :D

 

I'll need to check if I can get access to our squad server. I'd be willing to figure this thing out, but not if it means me relaying between you and the server-owner all the time. ;)

Link to post
Share on other sites

So if understand it’s use you first run a trigger the loads mist then shortly later use the same process to load moose as per normal the a third process to load swapr then if configured correctly it will replace all unused client aircraft with ai or must the client be shot down before it replaces it?

BlackeyCole 20years usaf

XP-11. Dcs 2.5OB

Acer predator laptop/ i7 7720, 2.4ghz, 32 gb ddr4 ram, 500gb ssd,1tb hdd,nvidia 1080 8gb vram

 

 

New FlightSim Blog at https://blackeysblog.wordpress.com. Go visit it and leave me feedback and or comments so I can make it better. A new post every Friday.

Link to post
Share on other sites
  • 3 months later...

I installed MOOSE and SWAPR for the first time about an hour ago. v1.2 and moose as comes in the archive file.

 

I'm having the same issue where picking a slot at mission start makes the new AC spawn into the existing AI simultaneously and explode. IT seems to happen only on the initial misison start / choose a slot operation.

 

I was designing/testing a mission while the computer itself was busy doing other things (GPUs and CPUs pinned doing non-DCS work).

 

Once I paused those workloads and restarted the mission it worked as it is supposed to work.

 

For people having this issue I think it might be a busy system or a weak system in general.

 

My mission is simplistic - just a dozen planes/helis sitting on the tarmac at Batumi. Single player.

 

I am wondering if there is a timing loop that can be added to the script to prevent this? I dunno.

 

One thing I did notice was that at mission start I am presented with the slot pick screen but none of the aircraft in the mission are rendered on the tarmac behind the pick dialog. Maybe if there was a way to render before presenting the pick dialog this might be a work around. I don't know much about how this works at a nuts and bolts level - don't know if that is practical.

 

 

$0.02


Edited by reece146
Link to post
Share on other sites

I'm having the same issue where picking a slot at mission start makes the new AC spawn into the existing AI simultaneously and explode. IT seems to happen only on the initial misison start / choose a slot operation.

 

Where do I report issues?

  • Issues can be reported directly in this thread (you can also send me a PM).
    Please, always include your mission file, dcs.log and server hook (if MP) in your reports

Link to post
Share on other sites
The Moose.lua version you should use is this one

https://github.com/FlightControl-Master/MOOSE_INCLUDE/tree/develop/Moose_Include_Static

 

Moose issues will get quicker attention if you address them to the Moose discord.

 

I don't think this was caused by a MOOSE issue (looks like DCS 2.5.6 introduced changes I haven't prepared SWAPR for), but it's true that the MOOSE versions linked in the OP were pre- 2.5.6, so I should update them, thanks for reminding me ;)


Edited by Hardcard
Link to post
Share on other sites

@Anyone interested

 

Due to changes introduced in DCS 2.5.6+ , SWAPR could no longer support ship-based clients properly (caused CTDs, ship-based replacements were spawning incorrectly, etc.)

 

Therefore, I've had to remove all the code related to ship-based clients / replacements and create a new SWAPR release.

 

SWAPR 1.3 is here!

 

If you're using SWAPR 1.2 without any ship-based replacements, it might still work with DCS 2.5.6+, but I recommend using SWAPR 1.3 instead, since it's lighter in all respects.

 

 

[b]Changes:[/b]
[list]
[*][b]05-10-2020[/b]  
[list]
[*]SWAPR 1.3 released!

[list]
[*]Removed support for ship-based clients (carriers included) due to issues introduced in DCS 2.5.6+


[*]Added spawn offsets for static replacements on open terrain in SP (should fix related collision problems)

[/list]
[/list]
[/list]

 

Btw, use this Moose.lua version for now (until the new MOOSE stable version comes out)


Edited by Hardcard
Link to post
Share on other sites
@Anyone interested

 

Due to changes introduced in DCS 2.5.6+ , SWAPR could no longer support ship-based clients properly (caused CTDs, ship-based replacements were spawning incorrectly, etc.)

 

Therefore, I've had to remove all the code related to ship-based clients / replacements and create a new SWAPR release.

 

Hello,

 

A good move, as the upcoming Supercarrier would most likely have introduced additional issues too :thumbup:

 

Best regards,

 

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 3600 - 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 post
Share on other sites

A good move, as the upcoming Supercarrier would most likely have introduced additional issues too :thumbup:

 

I would've gone insane, most likely :lol:

 

 

 

@reece146

 

Try again with SWAPR 1.3 and the new Moose.lua (linked above, in the OP and also included in the rar), then report back (include your mission file and dcs.log in the report, please)


Edited by Hardcard
Link to post
Share on other sites

It does the same thing whether v1.2 or v1.3 - and maddeningly it does it when the system is only running DCS now too (i.e. not only when heavily loaded with other jobs like before).

 

I sent you an email with the files you requested.

 

I did notice that if I start the mission in one aircraft, as it loads it puts me in the seat. I can see the other aircraft pop in but they are black like when the livery doesn't load in time.

 

It eventually loads all the aircraft with their liveries but by then I'm on fire! LOL

 

To me it "smells" like timing issues - stuff not being loaded just in time before the spawn into the seat. But that's an uneducated guess.

 

I'd really like to get this fixed - this is a fantastic mod/script/whatever.

 

If you need someone to test for you just say the word. Keep peppering me with new lua. :)

Link to post
Share on other sites

@reece146

 

1- Your mission is using MB339 PAN mod, next time please remove all mod assets before sending the mission for troubleshooting. (MB339 PAN mod appears to be compatible with SWAPR, btw)

 

2- Join spectators at mission start and wait there for ~5 seconds (10+s if your pc is slow), before entering any clients. Otherwise the required event won't trigger and the replacements won't have time to spawn properly.

 

3- To be on the safe side, avoid using any of the following characters in either group or unit names:

( ) [] {} / \ | # , . ` ´ ' % + - ~ * ¿? ¡! ¨ ^ $ € @

Underscores are fine, you can use as many as you want.

 

4- As a general rule, don't add more than one client per group.

 

5- Slot_Block setting should be set to false in SP (since it's a MP feature only)

 

6- Both SWAPR 1.2 and 1.3 run fine in your mission, as far as I can tell. Everything works as intended.


Edited by Hardcard
Link to post
Share on other sites
@reece146

2- Join spectators at mission start and wait there for ~5 seconds (10+s if your pc is slow), before entering any clients. Otherwise the required event won't trigger and the replacements won't have time to spawn properly.

 

This was the main issue I think. I didn't have any red teams set up so I couldn't be a spectator - it went straight to pick a slot - no way to give the mission time to load.

 

I added some red assets and now it works if I go to spectators and count off some time. It doesn't take much - a few seconds.

 

4- As a general rule, don't add more than one client per group.
Did some testing - it seems like you can get away with more than one client per group for aircraft but not helicopters. Not a big deal to make distinct groups for clients - just an observation.

 

5- Slot_Block setting should be set to false in SP (since it's a MP feature only)

Right. I changed it - need to remember to change it back when I move the mission to my server.

 

Is there something special about placing aircraft on carriers? This doesn't seem to be working for me - maybe I'm not aware of a config requirement for carriers. I'm new to this. Started messing with DCS over the Christmas holidays and this is my first attempt at mission building.

 

I've placed a carrier (Stennis). I'm trying to stick a few F18s on the ramps (or cats - doesn't seem to matter). The aircraft aren't shown.

 

When ever I pick 'takeoff from ramp - PRK 1' the client aircraft is only shown when I pick the slot. The other client aircraft on parking spots 2,3,4 are not shown either.

 

I've tried it with 1 aircraft be group, 2 AC per group, 1 Ac per group, multiple groups, never draws any of the aircraft until I pick a slot and then only draws the aircraft that I'm in.

 

I feel like I'm missing a little bit of info on how to use SWAPR for carrier ops or maybe on DCS itself. Pointers?

 

 

Edit: re-read some of the posts above about Supercarrier and breaking SWAPR... I'm running 2.5.5 (stable). Dunno if this is related. Will it work if I roll back to 1.2? I'd test myself but I'm out of time for tonight.

 

 

 

Thank you very much for the help!


Edited by reece146
Link to post
Share on other sites

@recce146

 

To jump to spectators in any SP mission, you only need to press esc (or hit the "BACK" button on the slot selection window), then choose spectators as coalition.

 

In MP everybody goes to spectators automatically, so you don't have to worry about it.

 

 

SWAPR has never been compatible with Stennis and Tarawa, due to DCS automatically blocking spawns and switching client locations.

 

SWAPR 1.2 used to be compatible with Carl Vinson, Kuznetsov, Chinese destroyers / frigates, Perry and Ticonderoga... but changes introduced in OB 2.5.6+ seem to have broken it.

 

If you still have 2.5.5 installed and are feeling adventurous, feel free to try SWAPR 1.2 with Vinson or Kuznetsov, but you'll need to watch the first video in the OP, which explains how to set it all up.

 

(Btw, I'll need to create a new video for SWAPR 1.3... hopefully I'll manage to make it shorter this time... :cry:)

 

 

Like I explained in post #115, I removed all the ship-related code to solve conflicts with 2.5.6+ and make the script lighter, so SWAPR 1.3 doesn't support ship-based clients.

 

 

I don't plan to buy the supercarrier module, so SWAPR won't support it (I doubt it'll be needed, though)


Edited by Hardcard
Link to post
Share on other sites

I tested the script with MIST and after replacing my MIST with the fixed one all seems to work minus some little things.

 

Some Ka50 are ejecting :D

AI replacements on Delayed Activation Ships don't show after ships appear.

Harrier as well as WW2 planes seems to act weird not being "completely deactivated" and move across the airport.

Also UH1H have pilots inside and they are powering down at mission start (on farps) and a clack clack clack clack clack noise can be heard continuously at infinitum I think.

[sIGPIC][/sIGPIC]

I5 4670k, 32GB, GTX 1070, Thrustmaster TFRP, G940 Throttle extremely modded with Bodnar 0836X and Bu0836A,

Warthog Joystick with F-18 grip, Oculus Rift S - Almost all is made from gifts from friends, the most expensive parts at least

Link to post
Share on other sites

Some Ka50 are ejecting :D

 

That's a new one, I think I know what's going on, could be tricky to fix.

 

AI replacements on Delayed Activation Ships don't show after ships appear.

 

By "ships" do you mean planes or actual vessels? SWAPR 1.3 doesn't support ship-based clients, due to changes introduced in DCS 2.5.6+.

Even if you're using SWAPR 1.2, it might not work properly with ship-based clients if you're using 2.5.6+

 

 

Harrier as well as WW2 planes seems to act weird not being "completely deactivated" and move across the airport.

Also UH1H have pilots inside and they are powering down at mission start (on farps) and a clack clack clack clack clack noise can be heard continuously at infinitum I think

 

Harriers and WW2 planes shouldn't move, since they're supposed to spawn with no fuel.

 

As for hueys having pilots inside and engines hot on spawn, that's normal. I had to do this as a workaround, otherwise they'd spawn half-buried in FARPs and other places (old DCS problem)

 

 

 

 

I'll look into the Ka-50, harrier and WW2 problems, see if I can come up with a fix / workaround.

 

Could you please provide the mission file? It would help speed things up.

 

Thanks for the report! :thumbup:


Edited by Hardcard
Link to post
Share on other sites

I think it has something to do with those slots being HOT on the ground slots.

 

Mission attached. I will test it without hot start but... is a big one :D .

SWPR_MercInc Training Caucasus 2020 Mai No MODS No WW2 asst.miz


Edited by zaelu

[sIGPIC][/sIGPIC]

I5 4670k, 32GB, GTX 1070, Thrustmaster TFRP, G940 Throttle extremely modded with Bodnar 0836X and Bu0836A,

Warthog Joystick with F-18 grip, Oculus Rift S - Almost all is made from gifts from friends, the most expensive parts at least

Link to post
Share on other sites
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...