Jump to content
Sign in to follow this  
sxp2high

BTK Gasmask for ACE (Simulate conterminated areas)

Recommended Posts

gm3q.jpg

Recently created for a mission, maybe useful for some people too. :D

gm1x.jpg

gm2l.jpg

You can customize or disable the Hints and the visual effects by editing the Start.sqf file.

BTK Gasmask

Function (SQF) for ArmA 2 Operation Arrowhead (lastest) + ACE

This function simulates contaminated areas. Being inside a contaminated area without wearing a Gaskmask will harm the player. He gets damage in intervals and dies after some time, if the does not exit the area or equip his gasmask. Works in singleplayer and multiplayer. Only players are affected, not AI.

Also included: Gasmask.sqf

Add and/or use gasmask. Works for both player and AI.

Execute from Unit init:

Add a gasmask.

[font="Fixedsys"]BTK = [this,"[color="Blue"]Add[/color]"] execVM "BTK\Gasmask\Gasmask.sqf";[/font]

Add (if necessary) a gasmask and use it.

[font="Fixedsys"]BTK = [this,"[color="Blue"]Use[/color]"] execVM "BTK\Gasmask\Gasmask.sqf";[/font]

To activate the function put this into your init.sqf file.

[font="Fixedsys"]BTK = execVM "BTK\Gasmask\Start.sqf";[/font]

To define a conterminated area, create a Game Logic , give it a name and edit the Start.sqf file.

You can also move the areas at any time (setPos).

This file contains the most important settings.

[font="Fixedsys"]BTK_Gasmask_Area1 = [color="Blue"]MyGameLogicName[/color]; // - Object (if not used, set to objNull)
BTK_Gasmask_Area1Radius = [color="Blue"]123[/color];       // - Radiation area around the object (in meter)
BTK_Gasmask_Area2 = [color="Blue"]MySecondArea[/color];    // - Object (if not used, set to objNull)
BTK_Gasmask_Area2Radius = [color="Blue"]666[/color];       // - Radiation area around the object (in meter)
[color="Red"][...][/color]

BTK_Gasmask_Damage = 0.2;           // - How many damage from conterminated air? (in %)
BTK_Gasmask_DamageInterval = 30;    // - Interval for the damage while not protected (in seconds)
BTK_Gasmask_EnableSound = 1;        // - Play sound? 1 = yes / 0 = no (Sound must be defined as BTK_Gasmask_Geiger in description.ext)
BTK_Gasmask_EnableFX = 1;           // - Enable visual effects while not protected? 1 = yes / 0 = no
BTK_Gasmask_EnableHints = 1;        // - Enable hints when entering a conterminated area?  1 = yes / 0 = no
BTK_Gasmask_GasmasksqfType = "ACE_GlassesGasMask_US";    // - Gasmask type for the add function (Gasmask.sqf)
[color="Red"][...][/color][/font]

Changelog

v1.0

-

Known issues

ACE related error when using use_glasses.fsm on AI, not causing any known problems

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

Download Demo Mission

Mirror

Armaholic

Feel free to ask for changes or report problems.

Edited by sxp2high

Share this post


Link to post
Share on other sites

Cool, thanks :) How does it work for people in cars and tanks?

Share this post


Link to post
Share on other sites

Uh nice. I always hated that teargas in ACE didn't work in older builds (play on dedicated server).

Share this post


Link to post
Share on other sites

THX ! I love u Guys. Created a Map longe Time ago but not enough Knoweledge to use Identities and Masks. Now all Problems solved :).

Greetings Thunder

Share this post


Link to post
Share on other sites

I hate to say it so I'll put it in brackets so that noone hears .... (is there a NON ACE version ? ) shhhhhhh

Share this post


Link to post
Share on other sites
How does it work for people in cars and tanks?

Vehicles do not protect you at the moment, you will take damage without gasmask. But it's a good idea to protect players inside some vehicles. :)

Share this post


Link to post
Share on other sites

Hi guys!

Is there a way to define conterminated areas with markers, too? It would be very cool if you could prepare conterminated areas like this because i think it´s more precise than placing a logic.

I think of a mission where nobody got a gasmask and you will have to find a way out of an area with your squad. So if you come in to a conterminated area, you step back and try to find another way out of it. For this i need to place them really accurate in the editor. So that for example in the middle of a city only a few streets are not conterminated and you have to find them to get out alive.

Share this post


Link to post
Share on other sites
;1832769']Is there a way to define conterminated areas with markers' date=' too? It would be very cool if you could prepare conterminated areas like this because i think it´s more precise than placing a logic.[/quote']

You create a game logic and define it's radius. It's basically the same like creating a marker.

Just create a marker on the game logic's position with the same radius and you got what you're asking for. :)

Here's an example that creates a 100% accurate marker at the first defined area:

[font="Fixedsys"]if (isNil "BTK_GasmaskInit") then { waitUntil {!(isNil "BTK_GasmaskInit")}; };

_Area1Marker = createMarkerLocal["Area1Marker",(getPos BTK_Gasmask_Area1)];
_Area1Marker setMarkerShapeLocal "ELLIPSE";
_Area1Marker setMarkerColorLocal "ColorRed";
_Area1Marker setMarkerBrushLocal "Solid";
"Area1Marker" setMarkerSizeLocal [bTK_Gasmask_Area1Radius, BTK_Gasmask_Area1Radius];[/font]

@victim913:

Sorry, my english sucks sometimes. :o

Edited by sxp2high

Share this post


Link to post
Share on other sites

Yea right, evil. I forgot that distance check works with markers too. :D

I found a respawn related issue, the reset is not working correctly. Till i got a update out please fix it yourself by changing:

player setVariable ["BTK_GasmaskUnsafe", true];

to

player setVariable ["BTK_GasmaskUnsafe", false];

at the bottom of Start.sqf.

That should solve it.

Share this post


Link to post
Share on other sites
I hate to say it so I'll put it in brackets so that noone hears .... (is there a NON ACE version ? ) shhhhhhh

(I double this one. Would be amazing!!) shhhhhh

Share this post


Link to post
Share on other sites

Who ever created this is all good but a quick question. Is there a function to place in the Init of a Unit that will cause the unit to put the gas mask on? Specifically looking to force gas masks on AI units.

Share this post


Link to post
Share on other sites

Gasmask.sqf

_Unit = _this select 0;

_Unit setVariable ["ACE_Identity", "ACE_Original_Identity"];
if (!(_Unit hasWeapon "ACE_GlassesGasMask_US")) then { _Unit addWeapon "ACE_GlassesGasMask_US"; };
[_Unit, "ACE_GlassesGasMask_US"] execFSM "x\ace\addons\sys_goggles\use_glasses.fsm";

Unit init:

BTK = [this] execVM "Gasmask.sqf";

That was working for both AI and players, last time i checked (been a while).

Share this post


Link to post
Share on other sites

I added the code to a separate file .sqf into my mission folder. Then added the code you said to put in the Init area of the unit. It works well actually but one minor glitch. It added gas masks to units that dont even have the code in the init box. Works for my missions though as everyone needs a gas masks anyways. Thanks a bunch!

Edit: I did some more playing around and found that it doesn't add gas masks to units unless they have the above code in the init. But, if you are in the same group it gives the person playing a gas mask. That piece of code is really nice thanks.

Edited by VISION1776

Share this post


Link to post
Share on other sites

Is it possible to apply some kind of large particle effect over an area, say in my instance with a radius of 600m (Dirty Bomb). I recall that Evo for Arma 1 had something like this. i'm not sure if it was a clever trick involving the scaling of green smoke effects or another technique but it would be of tremendous help to me if i could have some kind of visual indicator for a contaminated zone of this size.

Great script btw, a lovely application for ACE's underutilized gas masks.

Share this post


Link to post
Share on other sites

sxp2high: any clues why the respawn doesn't work, no gas mask is spawned with the unit? We use init line on each player.

Share this post


Link to post
Share on other sites

Is there a way to delete the smoke grenade that spawns at the centre of your radiation zone? I want them to watch the map to see if they're in contaminated area's..

Share this post


Link to post
Share on other sites

Is there a way to add this to a mission where people dont start with gas masks? This way, if they pickup a gas mask, they can use it to be protected? If they dont have one, they take damage. What do I do to make this work? I want the contaminated areas to spawn after a nuke or similar event. It is for a Wasteland server that is running ACE mod.

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  

×