neokika

Multiplayer Slingload

19 posts in this topic

2012032200004.jpg

Name: Multiplayer Slingload

Developer: _neo_ aka neokika

Version: Alpha

Credits: Osmo for feedback and testing

Download: Multiplayer Slingload - Example Mission

Description

  • This script will allow you to Slingload objects such as people and cars in an on-line game.

How does it work?

  • Using some very simple JIP and Multiplayer scripting techniques rope simulation in multiplayer becomes possible, running locally on each machine, while being JIP aware.

Notes

  • Only AI units can be slingloaded
  • Any object can be slingloaded
  • To add more object classes that can be slingloaded add them at "scripts\NEO_slingload\sl_action.sqf" - Line 3 - Carefull here, there are some non-physics aware objects, that if you drop them in air they wont fall, so take this into account when adding more
  • These set of script will also add action to choppers screens, adding the possibility to see the Hook camera and or Fastrope camera that are syncronized over the network (If one players turn it on, others see it - Including JIP) - There may be also random things happening on this part, but I'm working on fixing this
  • There is also the Fastrope available that allows players to fastrope out of the Medium and Heavy Choppers (This is a custom fastrope, not default one, so the players wont actually be attach to the rope)
  • Take into account, that if a chopper does not have a Hook, you cant sling load, if your chopper does not have a Winch you cant fast rope, if it does not have a FLIR screen you cant turn it on etc, so you have to manually add these yourself, this way, you can have a mission that some choppers have these and others not, while if you add these parts at mid mission, they will get the actions again
  • You can drop/pull your Hook (Slingload) rope by pressing the "StepOver" action and attach/detach a cargo to rope using "Binocular" action

2012032100005.jpg

Installation

init.sqf

Note this is just an example, adding all AIR objects to run the script (Since in example mission I only have choppers)

(allMissionObjects "Air") execVM "scripts\NEO_slingload\sl_init.sqf";

- Latest Version

  • Alpha

_neo_

Edited by neokika

Share this post


Link to post
Share on other sites

Cool, nice to see this done (would be nicer if BIS had done it in the first place). Will try this out later and myabe make a proper mission to release as well.

Share this post


Link to post
Share on other sites

Excellent work my friend. Me an my mates will be enjoying all kinds of sling load action thanks to you.

One small question if you don't mind. I allowed 'air' units to be sling loaded in the script file however I think that when ordered to attach to cargo the helicopter is attaching to itself. Which kicks me out and freezes the helicopter I was just flying in place. Is there anyway to make it so the load that is being attached is never the players chopper?

Cheers again for a great script.

Share this post


Link to post
Share on other sites

Nice work.

Shame on BI for not making sure that everything works in MP (hosted and dedicated)

Share this post


Link to post
Share on other sites
One small question if you don't mind. I allowed 'air' units to be sling loaded in the script file however I think that when ordered to attach to cargo the helicopter is attaching to itself. Which kicks me out and freezes the helicopter I was just flying in place. Is there anyway to make it so the load that is being attached is never the players chopper?

Thanks for the feedback,

Sure, you just need to add the following to line 44 of sl_action.sqf

//From
if (!(_x isKindOf "Man") || !isPlayer _x) then

//To
if ((!(_x isKindOf "Man") || !isPlayer _x) && _x != vehicle player) then

This should make it so the player vehicle won't get into account while searching for objects to slingloaded.

This also has been merged in the current version (not released) of the script.

Thanks,

_neo_

Share this post


Link to post
Share on other sites

Nice work _neo_! :thumbsup: Let's hope BIS will pick it up for the next patch!

Share this post


Link to post
Share on other sites

has anyone tried this on a dedicated server? for me cargo always disappears upon detaching (the same mission works okay on a hosted MP session however).

Share this post


Link to post
Share on other sites
has anyone tried this on a dedicated server? for me cargo always disappears upon detaching (the same mission works okay on a hosted MP session however).
Yes, same here. Neokika can you please modify your scripts to make them work on dedi?

Share this post


Link to post
Share on other sites

Hi all,

I have found the problem with the cargo disappearing after released from the rope.

Check here:

https://dev-heaven.net/issues/31145

http://forums.bistudio.com/showthread.php?134192-BIS_fnc_MP-and-Dedicated-Server

I'll wait and see if the problem can be fixed in the next patch, otherwise I'll have to re-do some of the parts of this script in order to make it work, differently.

_neo_

Share this post


Link to post
Share on other sites

Are you still planning or working on fixing the script so that cargo does not disappear once it has been dropped or are the BIS side issues still there? (I might have a go a editing it myself if the issues are fixed if thats ok)

Share this post


Link to post
Share on other sites
Dan;2214410']Are you still planning or working on fixing the script so that cargo does not disappear once it has been dropped or are the BIS side issues still there? (I might have a go a editing it myself if the issues are fixed if thats ok)

Hi Dan' date='

I completely forgot about fixing Slingload scripts for TakeOn Helicopters in dedicated servers.

Although, after giving a quick look at the files I think I have a very easy/quick fix, although, I cannot test it atm since I'm not home.

If you are are to do a quick blind test here goes the modification:

Download

If you are up to test it, please, don't forget to tell me if it works,

_neo_

Share this post


Link to post
Share on other sites

Just tested it on a dedicated server. It works, when I dropped the cargo off, I could see it, and so could the other guy on the server, and it was the correct and same object for both of us. Thank you for the fix!

Share this post


Link to post
Share on other sites
Dan;2214481']Just tested it on a dedicated server. It works' date=' when I dropped the cargo off, I could see it, and so could the other guy on the server, and it was the correct and same object for both of us. Thank you for the fix![/quote']

Great, I'll wrap it in a new version when I get back.

Thanks,

_neo_

Share this post


Link to post
Share on other sites

I got a question aboutr how you attach the load script wise. Do you delete the object at anytime whilst doing it, or is it simply just being attached to things?

Share this post


Link to post
Share on other sites
Dan;2214711']I got a question aboutr how you attach the load script wise. Do you delete the object at anytime whilst doing it' date=' or is it simply just being attached to things?[/quote']

Well in theory is quite simple.

The problem with the ropes in TakeOn is that they are Local, one rope can only exist in one machine, like, if you create a rope on the server, only the server "sees" the rope, while in the clients machines it does not exist.

What I do within the scripts is create each rope multiple times per machine and this is quite simple, the problems start when you want the ropes to interact with objects, because if you attach a (global) object to a (local) rope, the object disappears where it is remote, and will only be seen where the rope is local.

For this, I have to delete the global object (cargo) once the rope is attached to it, then, create the same object multiple times per machine locally, ofc, I also need to do basically the same when the rope is detached, I delete all the (local) objects that exist on each machine, and create the global object instead, that everyone sees.

I also have to deal with all kind of garbage, and properly delete it.

If done right, this method can be quite effective, but it is still a scripted solution with several limitations.

_neo_

Share this post


Link to post
Share on other sites

does the global object keep its same name though at the end of this? (i.e if i name it box1, then lift it and then drop it, will the global box recreated at the still be called box1?)

Share this post


Link to post
Share on other sites
Dan;2214879']does the global object keep its same name though at the end of this? (i.e if i name it box1' date=' then lift it and then drop it, will the global box recreated at the still be called box1?)[/quote']

No, since it will be a completely different instance of the class.

Although, with a few changes it should be possible to make the new object have the same name as the last one, but any other reference of the old object won't be available anymore.

As a work around, for example, to check if all cargo has been transported is to check by class name and nearestObjects.

_neo_

Edited by neokika

Share this post


Link to post
Share on other sites

Ah yes, thats a good idea. Thank you for you help and your awesome scripts.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now