Jump to content
Sign in to follow this  
icebreakr

Making a MP campaign - need help with Virus scripting :)

Recommended Posts

I have a settlement that has an airborne virus present (marker area). How can I infect a player that is:

a) not wearing a gasmask (ACE item) in that marker?

b) is wounded (damage <0.95) and virus comes to body directly into blood?

Virus would have a timer that would kill off a unit in less than 5 minutes.

Thanks.

Share this post


Link to post
Share on other sites

_r = [player] call ace_eyeprotection;
_r = [player] call ace_earprotection;

_r values: true or false

Problem is eye protection will count for tactical glasses and balaclavas and safety glasses too.

Share this post


Link to post
Share on other sites
I have a settlement that has an airborne virus present (marker area). How can I infect a player that is:

a) not wearing a gasmask (ACE item) in that marker?

b) is wounded (damage <0.95) and virus comes to body directly into blood?

Virus would have a timer that would kill off a unit in less than 5 minutes.

Thanks.

Oh god, thats just evil.

Do it :D

Then release the script to us :D

Share this post


Link to post
Share on other sites
_r = [player] call ace_eyeprotection;
_r = [player] call ace_earprotection;

_r values: true or false

Problem is eye protection will count for tactical glasses and balaclavas and safety glasses too.

There must be something directly related to the Gasmask though, as tactical glasses won't protect you againt tear gas, for instance? I don't know what variable that could be though.

Share this post


Link to post
Share on other sites

BTK did it like this.

if (player getVariable "ACE_Identity") == "ACE_GlassesGasMask_RU") || ((player getVariable "ACE_Identity") == "ACE_GlassesGasMask_US") then {

}

Share this post


Link to post
Share on other sites

Yes. There's a lot of stuff you need to figure out yourself :)

Share this post


Link to post
Share on other sites
Thanks guys!

Intrigued about how the infected will behave? This sounds awesome!

Share this post


Link to post
Share on other sites

They would die after 5 minutes, I guess. As for their behaviour, that's up to the players.

Share this post


Link to post
Share on other sites
BTK did it like this.

if (player getVariable "ACE_Identity") == "ACE_GlassesGasMask_RU") || ((player getVariable "ACE_Identity") == "ACE_GlassesGasMask_US") then {

}

Doesn't work... does anyone have a working sample? I would need to activate script if player doesnt have GasMask_RU or GasMask_US.

Share this post


Link to post
Share on other sites

Two things, first is a few typos in that demo, second it seems that ACE_Identity isn't set by default till you put something on.

Here's a demo that appears to be working, but by no means is the best way of doing this. :)

init.sqf:

player setVariable ["virus", 0, true];
player setVariable ["ACE_Identity", "WhatYourMammaGaveYou", true];

sleep 1;

while {true} do {

hintSilent format["%1", player getVariable "virus"];
};

trigger running this:

addVirus.sqf:

private ["_zone", "_virus", "_inZone"];
_zone = _this select 0;
_virus = player getVariable "virus";
_inZone = true;


while {_inZone} do {
if (((player getVariable "ACE_Identity") == "ACE_GlassesGasMask_RU") || ((player getVariable "ACE_Identity") == "ACE_GlassesGasMask_US")) then {
	//player sideChat "masky"; 
} else {
	//player groupChat "sicky";
	_virus = _virus + 1;
	player setVariable ["virus", _virus];
};

if ((player distance _zone) > 5) then {_inZone = false};
sleep 1;
};

//player sideChat "phew!";

For MP you'd probably wanna call the script via a distance check or local trigger. :)

Edited by kylania

Share this post


Link to post
Share on other sites

Tnx panther42, totally forgot about BTK. All is working fine with couple of tweaks, even in MP ;)

Share this post


Link to post
Share on other sites

Yeah the BTK thing works but is it possible to fix the Error? Because i hate Script errors. :D

Error in expression <riable "ace_sys_goggles_identity";

if (_old_identity in ["ACE_GlassesGasMask_US>

Error position: <_old_identity in ["ACE_GlassesGasMask_US>

Error Undefined variable in expression: _old_identity

Share this post


Link to post
Share on other sites

As I mentioned in my apparently completely ignored post, the ACE_Identity variable isn't set to anything until the first time you put on a mask. So your initial check of it will fail unless you set it to something first.

Share this post


Link to post
Share on other sites

Could also be fixed by using the getVariable array (value to return if the variable doesn't exist). :). I'd assume it didn't exist when BTK wrote his script.

BTK did it like this.

if (((player getVariable ["ACE_Identity",""]) == "ACE_GlassesGasMask_RU") || ((player getVariable ["ACE_Identity",""]) == "ACE_GlassesGasMask_US")) then {

}

Share this post


Link to post
Share on other sites

I've managed to fix it. But, check BTK's topic for a hint.

Share this post


Link to post
Share on other sites

@kylania No i read your Post and set in my init file "player setVariable player setVariable ["ACE_Identity", "ACE_Original_Identity"];"

but the error still comes again on Mission Start "Error in expression <riable "ace_sys_goggles_identity"; blabla" i searched the BTK code to find "ace_sys_goggles_identity" but there was nothing

so i try to set "player setVariable player setVariable ["ACE_Identity", "ace_sys_goggles_identity"];" but unfortunately has not worked.

Maybee i need start the hole squad by mask on his face to fix it. :D

Any Ideas?

Share this post


Link to post
Share on other sites

I can send you a working mission, but it requires ACE,ACEX, Duala & SBP Slovenian Soldiers addons. Only problem I have right now that spawn doesn't work for masks, they are not there.

Share this post


Link to post
Share on other sites

A Demo Mission sounds nice. My mission is playing at Duala and the SBP Part i can cut out the file. :)

And for your problem you tried to place the "ACE Respawn with same Gear" Module on the map?

Or try some like this:

in your init: [] execVM "pl_respawn.sqf";

pl_respawn.sqf

player addEventHandler ["Killed",{

player spawn {

_unit = _this;

/*

_Unit setVehicleInit "btk = [this,'Use'] execVM 'BTK\Gasmask\Gasmask.sqf';";

processInitCommands;

*/

};

};

maybee it help a bit :o

Sc0rc3d

Share this post


Link to post
Share on other sites

If I may recommend something, since the victim will die in 5 minutes. I can presume this is a very painful death. So I say when the victims death timer is near zero you should play the sound when a person is on fire. It sounds like a painful and terrible death, which it perfect for you!

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
Sign in to follow this  

×