Jump to content
t-800a

script snippet - downlad data from a laptop

Recommended Posts

is there a way to have the bomb explode using a timed trigger ? i use it as a detonator to trigger the nuclair explosion (player has to download intel to see witch action to perform on the bomb to have it not explode and destroy 3/4 of Altis)

ps. seting the trigger with setdamage 1 is not the option i am looking for, i want to have the bomb explode the same way if you perform the wrong action

Share this post


Link to post
Share on other sites
My personal intention was to steal that focus, so the player is locked down for a few seconds maintaining the download, making him more vulnerable to his surroundings. Therefore I didn't use HUD elements. But feel free to edit this thing to your personal preferences. ;)

Would you consider having the dialog go away and focus automatically returned by the script once the download is complete? Or a second or two afterwards, once the hint and/or task completion animation is complete.

Share this post


Link to post
Share on other sites

Last week I played a mission with my friends and it worked fine on dedi. Maybe you can give me the mission and I can look into it?

Share this post


Link to post
Share on other sites

We recently played a mission that used this script and it didn't seem to work. I checked it, and I found something that might be an error:

T8_fnc_addActionLaptop ={
{
	private [ "_DT", "_cDT" ];
	_DT = format [ "%1_%2", "T8_pubVarDataTask", _x ];
	_cDT = missionNamespace getVariable [ _pV, false ]; // <-****
	if ( _cDT ) exitWith {};
	_x addAction [ T8_varTLine05, { call T8_fnc_ActionLaptop; }, [], 10, false, false ];
} forEach _this;	
};

I marked the place. The variable _pV should not be defined, you would need to use _DT instead, or am I misunderstanding something?

Share this post


Link to post
Share on other sites

Hi,

I try to spawning intel after download from laptop, but that doesn't work.

I need to spawn intel ex : "Item_ItemMap"

On downloaddata.sqf

{

try {

if(T8_varDownSucce == true) then {

throw "v0";

}

}

catch {

if(_exception == "v0") then {execVM "scripts\dlintel\intelcreator.sqf"}

}

};

and in intelcreator.sqf

_veh  = createVehicle ["Item_ItemMap",getpos player,[], 0, ""];
_veh setpos  (player modelToWorld [0,6,0]);
_veh setDir ([_veh, player] call BIS_fnc_dirTo);
_setVehiculeInit = if (isServer) then {
   this setVariable ["RscAttributeDiaryRecord_texture","a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa", true];
   [this,"RscAttributeDiaryRecord",["Top Secret Docs","<br /><execute expression=""[(group player), 'my intel task', ['an intel task', 'secret docs', ''], [0,0,0], 'ASSIGNED', 0] call BIS_fnc_taskCreate"">Nos lignes sont bien gardés, nous allons gagner !</execute><br />",""]] call bis_fnc_setServerVariable;
   this setVariable ["recipients", west, true];
   [this,"init"] spawn bis_fnc_initIntelObject;
};

But i think my script is really bad.

can you help me ?

Edited by Kyusss

Share this post


Link to post
Share on other sites
We recently played a mission that used this script and it didn't seem to work. I checked it, and I found something that might be an error:

[...]

I marked the place. The variable _pV should not be defined, you would need to use _DT instead, or am I misunderstanding something?

that was a copy paste error ... fixed this

I try to spawning intel after download from laptop, but that doesn't work. [...]

Hmm, why don't you just execVM your script from a trigger, like in the triggers in the example, where a hint is displayed when the download is finished?

anyway:

---- updated script on 24.06.2014 - V003 ----

fixed the bug that was posted in April ... lazy me

added the percentage part cuel posted. thanks!

added WTFPL licence to script files, because licenses everywhere :x

Download the sample mission (V003)

Edited by t-800a

Share this post


Link to post
Share on other sites

yay thanks for keeping this up to date!! great script

Share this post


Link to post
Share on other sites

How can I get this to work placing multiple laptops where only one has download using call BIS_fnc_selectRandom; or do you have an easier way within your script?

Share this post


Link to post
Share on other sites
How can I get this to work placing multiple laptops where only one has download using call BIS_fnc_selectRandom; or do you have an easier way within your script?

place your laptops and name em: laptop01, laptop02, laptop03, ... , laptop999 (or however you want to name em)

then replace

[ [ laptop01, laptop02, laptop03, ... , laptop999 ], "T8_fnc_addActionLaptop", true, true ] spawn BIS_fnc_MP;

with

_thisLaptop = [ laptop01, laptop02, laptop03, ... , laptop999 ] call BIS_fnc_selectRandom;
[ [ _thisLaptop ], "T8_fnc_addActionLaptop", true, true ] spawn BIS_fnc_MP;

(untested!)

Share this post


Link to post
Share on other sites

Worked great I didn't have it written right is why I couldn't get it to work thanks again.

Share this post


Link to post
Share on other sites

I need help running this on laptop objects spawned in later during mission. My objective system isn't reading the T8_pubVarDataTask variable, I'm not sure how to get a reference to that on spawned objects. I hope you understand what I mean, it's 1am here :bb:

Where _obj = laptop and _id = task ID...

0 = [_obj, _id] spawn
	{
		[[_this select 0], "T8_fnc_addActionLaptop", true, true] spawn BIS_fnc_MP;
		_DT = format [ "%1_%2", "T8_pubVarDataTask", (_this select 0) ];
		waitUntil {sleep 5; !(alive (_this select 0)) || (_this select 0) getVariable ["_DT", false]};
		if(getPosATL (_this select 0) isEqualTo [0,0,0])then //was deleted / despawned
		{
			[_this select 1, "Cancelled"] call BIS_fnc_taskSetState;
		}
		else
		{
			[_this select 1, "Succeeded"] call BIS_fnc_taskSetState;
		};
	};

Share this post


Link to post
Share on other sites

Change this:

waitUntil {sleep 5; !(alive (_this select 0)) || (_this select 0) getVariable ["_DT", false]};

To this:

waitUntil {sleep 5; !(alive (_this select 0)) || missionNamespace getVariable [ _DT, false]};

And see if it works.

I am not sure if it will, because the script was never intended to work with spawned Objects. Maybe I can find some time to rework the script so it's vars are saved to the object itself, instead of mission namespace.

Share this post


Link to post
Share on other sites

---- updated script on 30.01.2015 - V004 ----

updated the script to better work with objects created on-the-fly

incompatible to previous versions, so you are not done by replacing files!

You can check if the download on a laptop/object was finished and/or if someone uses the object by checking the

following variables saved to the object:

_laptopInUse = _myLaptop getVariable [ "T8L_pvar_inUse", false ];
_downloadComplete = _myLaptop getVariable [ "T8L_pvar_dataDownloaded", false ];

Download the sample mission (V004)

Edited by t-800a

Share this post


Link to post
Share on other sites

Thanks for the headsup about the new version :cool:

Release frontpaged on the Armaholic homepage.

==============================================

We have also "connected" these pages to your account on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Thanks for the help previously, it worked after some more messing around. I must have forgotten to reply.. :eek:

Nice update. :)

Edited by LowFlyZone

Share this post


Link to post
Share on other sites

Hey dude, im very very new using this stuff, but ty!! just tested it one time and it works perfectly.

Cheers!

Share this post


Link to post
Share on other sites

T800 I am trying to get Cobras script to work on MP. It is kind of the same thing but places a code on the Laptop for disarming a bomb. Problem I am having is when I play with friends if I find the code it may be 123456, my friend will find a code on another computer 098765 and if he uses mine or I use his bomb goes off. It is making a seperate random placement and code for each player instead of one for everyone. I have tried to add IfServer codes but never seems to work. Can you look at it and see if you could help. Here is the link- http://forums.bistudio.com/showthread.php?173540-Defuse-the-Bomb&highlight=defuse+bomb

Share this post


Link to post
Share on other sites

Hi, I read through the whole thread, but haven't figured out how to place a new laptop in my mission. I already serached through the sample missions, but since the option is linked to the task crete module, I don't know how to unlik it or how to make the option "download data" available from the mission start.

I want to have a laptop with "download data" option already allowed from the mission start, or by a task.

How do I enable the "download data" option by a task?

How do I enable the "download data" option from the mission start?

Share this post


Link to post
Share on other sites
Hi, I read through the whole thread, but haven't figured out how to place a new laptop in my mission. I already serached through the sample missions, but since the option is linked to the task crete module, I don't know how to unlik it or how to make the option "download data" available from the mission start.

I want to have a laptop with "download data" option already allowed from the mission start, or by a task.

How do I enable the "download data" option by a task?

How do I enable the "download data" option from the mission start?

Are you trying to spawn a laptop randomly? If not a laptop is placed using editor under "Empty/Objects (small)/ Laptop". Then you name the laptops whatever you are going to use for code.

Share this post


Link to post
Share on other sites

My personal intention was to steal that focus, so the player is locked down for a few seconds maintaining the download, making him more vulnerable to his surroundings. Therefore I didn't use HUD elements. But feel free to edit this thing to your personal preferences. ;)

Sorry to revive an old thread but could anyone specify how exactly you change from dialog to "hud elements" so my player can move while downloading the data? 

 

In my mission I've slowed down the download speed so that it takes several minutes while the squad defends the laptop room. naturally I want the player thats using the laptop to be able to move so that they aren't just trapped there bored

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

×