[Script] MP-compatible "Data recovery" action

Party-approved future science plus handbooks for the revolution
Post Reply
User avatar
wolfenswan
Posts: 1208
Joined: Wed May 25, 2011 4:59 pm

[Script] MP-compatible "Data recovery" action

Post by wolfenswan » Sun Jan 18, 2015 10:55 am

ws_transferData
Code on Github - requires ws_fnc



What does it do?
  1. It adds an action to any object which when prompted creates a laptop at the executing unit's position and displays a countdown.
  2. After the countdown any unit can collect the data from the Laptop. A message will show who collected it and who's carrying the Data. A marker will indicate the carrier's position.
  3. Should the carrier die a message will tell as much and the marker will stop moving. The data has to be collected again from the corpse.
How does it work?
  1. Copy the code into file named "ws_transferData.sqf" in your mission folder.
  2. Add this to the main object's init:

    Code: Select all

    [this,120] execVM "ws_transferData.sqf";
    The second value is the time in s for the transfer to finish. A value of 0 makes it instantly.
How do I check who has the data?
To check if a specific unit is carrying the Data use

Code: Select all

(unitName getVariable ["ws_transferData_dataCarrier",false])
To check if the unit is inside a trigger, use this condition (and activation "anybody"):

Code: Select all

this && ({(_x getVariable ["ws_transferData_dataCarrier",false])} count thisTrigger > 0)
If you only want to check if the Data has been collected at all, check

Code: Select all

ws_transferData_transferDone
How does this work in an adversarial?
Just like in a coop (everyone will see the messages). Currently there's no way to set it up to display stuff only for one side but I'll add that in the future.

Post Reply