Jump to content

Photo
- - - - -

Multiplayer Slingload


  • Please log in to reply
18 replies to this topic

#1 neokika

neokika

    BI Developer

  • BI Developer
  • 1136 posts

Posted 30 March 2012 - 03:26 PM

Posted Image

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

Posted Image

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, 01 November 2012 - 10:15 PM.

Proud community admin/member of The Tour of Teamrespawn

#2 -EVO- Dan

-EVO- Dan

    Master Gunnery Sergeant

  • Members
  • 1262 posts

Posted 30 March 2012 - 03:50 PM

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.
My custom missions:
TOH - COOP5 Operation Pegasus http://forums.bistud...eration-Pegasus
TOH - COOP Convoy attack (both Hinds and stock versions) http://forums.bistud...O-Convoy-Attack
A2CO Multi-mission Template http://forums.bistud...048#post2182048
Basic Vehicle respawn script (A3 Alpha) http://forums.bistud...272#post2389272

[EVO] Multigaming Clan is recuiting at ts3.evoclan.net

#3 Jedra

Jedra

    Warrant Officer

  • Members
  • 2048 posts

Posted 30 March 2012 - 05:37 PM

Very nice indeed! Will check this out later on.
Jedra's Addons
Arma 2 : Enhanced Skills Slider
Take On Helicopters : Take On Taxi | Jedra's Time Trials | Weapon Indicators | No Radar

#4 Codfish

Codfish

    Private

  • Members
  • 8 posts

Posted 31 March 2012 - 04:26 PM

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.

#5 Mr. Charles

Mr. Charles

    Sergeant Major

  • Members
  • 1837 posts

Posted 31 March 2012 - 05:32 PM

Nice work.

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

#6 neokika

neokika

    BI Developer

  • BI Developer
  • 1136 posts

Posted 31 March 2012 - 05:43 PM

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_
Proud community admin/member of The Tour of Teamrespawn

#7 sxp2high

sxp2high

    Master Sergeant

  • Members
  • 779 posts

Posted 01 April 2012 - 12:22 AM

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

#8 daikan

daikan

    Staff Sergeant

  • Members
  • 285 posts

Posted 07 April 2012 - 06:44 PM

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


"Nothing is so firmly believed as what is least known." - Michel de Montaigne


#9 BeePee

BeePee

    Sergeant

  • Members
  • 199 posts

Posted 04 May 2012 - 07:46 PM

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?
Posted Image

#10 neokika

neokika

    BI Developer

  • BI Developer
  • 1136 posts

Posted 10 May 2012 - 11:23 AM

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.bistud...edicated-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_
Proud community admin/member of The Tour of Teamrespawn

#11 -EVO- Dan

-EVO- Dan

    Master Gunnery Sergeant

  • Members
  • 1262 posts

Posted 26 August 2012 - 06:01 PM

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)
My custom missions:
TOH - COOP5 Operation Pegasus http://forums.bistud...eration-Pegasus
TOH - COOP Convoy attack (both Hinds and stock versions) http://forums.bistud...O-Convoy-Attack
A2CO Multi-mission Template http://forums.bistud...048#post2182048
Basic Vehicle respawn script (A3 Alpha) http://forums.bistud...272#post2389272

[EVO] Multigaming Clan is recuiting at ts3.evoclan.net

#12 neokika

neokika

    BI Developer

  • BI Developer
  • 1136 posts

Posted 26 August 2012 - 07:47 PM

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,

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_
Proud community admin/member of The Tour of Teamrespawn

#13 -EVO- Dan

-EVO- Dan

    Master Gunnery Sergeant

  • Members
  • 1262 posts

Posted 26 August 2012 - 08:29 PM

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!
My custom missions:
TOH - COOP5 Operation Pegasus http://forums.bistud...eration-Pegasus
TOH - COOP Convoy attack (both Hinds and stock versions) http://forums.bistud...O-Convoy-Attack
A2CO Multi-mission Template http://forums.bistud...048#post2182048
Basic Vehicle respawn script (A3 Alpha) http://forums.bistud...272#post2389272

[EVO] Multigaming Clan is recuiting at ts3.evoclan.net

#14 neokika

neokika

    BI Developer

  • BI Developer
  • 1136 posts

Posted 26 August 2012 - 08:59 PM

Dan;2214481']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!


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

Thanks,
_neo_
Proud community admin/member of The Tour of Teamrespawn

#15 -EVO- Dan

-EVO- Dan

    Master Gunnery Sergeant

  • Members
  • 1262 posts

Posted 27 August 2012 - 09:08 AM

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?
My custom missions:
TOH - COOP5 Operation Pegasus http://forums.bistud...eration-Pegasus
TOH - COOP Convoy attack (both Hinds and stock versions) http://forums.bistud...O-Convoy-Attack
A2CO Multi-mission Template http://forums.bistud...048#post2182048
Basic Vehicle respawn script (A3 Alpha) http://forums.bistud...272#post2389272

[EVO] Multigaming Clan is recuiting at ts3.evoclan.net

#16 neokika

neokika

    BI Developer

  • BI Developer
  • 1136 posts

Posted 27 August 2012 - 12:50 PM

Dan;2214711']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?


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_
Proud community admin/member of The Tour of Teamrespawn

#17 -EVO- Dan

-EVO- Dan

    Master Gunnery Sergeant

  • Members
  • 1262 posts

Posted 27 August 2012 - 02:06 PM

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?)
My custom missions:
TOH - COOP5 Operation Pegasus http://forums.bistud...eration-Pegasus
TOH - COOP Convoy attack (both Hinds and stock versions) http://forums.bistud...O-Convoy-Attack
A2CO Multi-mission Template http://forums.bistud...048#post2182048
Basic Vehicle respawn script (A3 Alpha) http://forums.bistud...272#post2389272

[EVO] Multigaming Clan is recuiting at ts3.evoclan.net

#18 neokika

neokika

    BI Developer

  • BI Developer
  • 1136 posts

Posted 27 August 2012 - 03:59 PM

Dan;2214879']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?)


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, 27 August 2012 - 05:33 PM.

Proud community admin/member of The Tour of Teamrespawn

#19 -EVO- Dan

-EVO- Dan

    Master Gunnery Sergeant

  • Members
  • 1262 posts

Posted 27 August 2012 - 05:17 PM

Ah yes, thats a good idea. Thank you for you help and your awesome scripts.
My custom missions:
TOH - COOP5 Operation Pegasus http://forums.bistud...eration-Pegasus
TOH - COOP Convoy attack (both Hinds and stock versions) http://forums.bistud...O-Convoy-Attack
A2CO Multi-mission Template http://forums.bistud...048#post2182048
Basic Vehicle respawn script (A3 Alpha) http://forums.bistud...272#post2389272

[EVO] Multigaming Clan is recuiting at ts3.evoclan.net