Jump to content
Sign in to follow this  
Daniel

Scripted Gas Masks

Recommended Posts

Hi

I'm working on a multiplayer scenario where the squad has to don gas masks once a siren sounds or they'll gradually take damage. I'm using the gasmask identities from Shnapdrossel's Mercenary pack.

So far using my own limited knowledge, i've managed to give a "Don Gas Mask" action menu option to all players, that runs an individual .sqs for each player which sets their identity to "gasmask2". I reckon I can implement an animation (if I can find one suitable) and some sort of sound effect myself.

I've also tried delving into triggered resources to make some sort of overlay with limited success (managed to get binoculars to pop up!).

I'm after opinions on the best methods to do the following:

  • Create a mask lens overlay to slightly limit peripheral vision, but still have access to the action menu.
  • Cause gradual damage to players that haven't donned their respirator.

Thanks!

Share this post


Link to post
Share on other sites

Create a mask lens overlay to slightly limit peripheral vision, but still have access to the action menu.

i guess this can be done with a simple dialog.. maybe a "titletext resource"

Cause gradual damage to players that haven't donned their respirator.

a loop ?

while {(!mask)} do
{
   player setdammage X;
   sleep X;
};

Share this post


Link to post
Share on other sites

Thanks for the quick response nuxil! Got my scripting hat on, will report back.

Share this post


Link to post
Share on other sites

titletext resource seems like the way to go for the lenses, just need to find a good working example to rip apart.

Could you please put that loop code into a wider context? Still a bit of a noob at applying this sort of thing.

Mainly:

How to make sure it loops once you've applied some damage (managed to kill a player instantly using that code at least, didn't seem to be looping at lower damages).

How do I define mask for multiple players?

Should I be using an .sqs, .sqf, etc? :p As you can see i'm still boggled by a lot of this, just trying to bring a concept to life.

Share this post


Link to post
Share on other sites

Im off to bed. if no one helps you. i guess i can tomorrow,

Share this post


Link to post
Share on other sites

Would be very much appreciated. At the moment i'm just trying to put together a description.ext that brings up a .paa image in game. A simple example description.ext would be awesome.

Share this post


Link to post
Share on other sites

yes offcource.. i forgot all about you :p

here is a short example on how you can make a hpp file for title

description.ext

class RscTitles
{
#include "GasMask.hpp"
};

GasMask.hpp

#define YOURNICK_GASMASK_IDD	10000
class YOURNICK_GASMASK
{
idd = YOURNICK_GASMASK_IDD;
movingEnable =  false;
duration     =  9999;
fadein       =  1;
fadeout      =  1;
name = "GasMask";
onLoad="uiNamespace setVariable ['YOURNICK_GASMASK_Display', _this select 0]; [] execvm 'YOUR_MAIN_SCRIPT.sqf'";
controlsBackground[]={};
objects[]={};
controls[]={YOURNICK_GASMASK_PIC};
class YOURNICK_GASMASK_PIC
{
	idc = -1;
	type = 0;
	style = 48;
	colorText[] = {0, 0, 0, 1};
	font = "Bitstream";
	colorBackground[] = {0, 0, 0, 0};
	text="GasMask.paa";
	sizeEx = 0.015;
	x = SafeZoneX;
	y = SafeZoneY;
	w = SafeZoneW;
	h = SafeZoneH;
};
};

now you just call your interface by using

titleRsc["YOURNICK_GASMASK", "PLAIN"];

and the main script is also loaded. since its started with onLoad.

however. there is a problem using titleRsc

if you using titleText["", "PLAIN"]; or simmelar when you have th gasmas hud open.. you will clear the screen. no more hud. you need to reloade it then with titleRsc["YOURNICK_GASMASK", "PLAIN"];

Edited by nuxil

Share this post


Link to post
Share on other sites

Excellent, thanks nuxil! That works ok, used it to bring up a sample .paa of a weapon sight.

Problem now is I get the following error when trying to use my own GasMask.paa file.

errorvl.jpg

I'll try and hunt down some .paa tutorials.

Share this post


Link to post
Share on other sites

make sure you can divide your with & hight of your picture by 2 and not get desimals..

example

pixels

2x2 is ok..

2x4 is ok.

1x3 is not

Edited by nuxil

Share this post


Link to post
Share on other sites

Thought that might be the case too, resized it to 1000x500 but still getting the same error.

Share this post


Link to post
Share on other sites

try and make it

1024x512

if you still have issues,

put your image on dump.no and i can paa it for you

Share this post


Link to post
Share on other sites

Awesome! Thanks, works like a charm, looks pretty good for a first knock up too.

gasx.jpg

Edited by Daniel

Share this post


Link to post
Share on other sites

Nice Ilike the look of this now we start to go down the Chemical warfare route now imagine mados missles detonating bombs at a altitude fo say 300m with a disoersion radius of say 1000m then add some gas effect(a light smoke i guess) and then may be make that drifft across the battle field. My litle brain is ticking away many thanks for this little gem.Kudos [CAS] Daniel and all that helped get it working

has anyone got a sample mission with this working ?

Edited by 28thCDM

Share this post


Link to post
Share on other sites
a loop ?

while {(!mask)} do
{
   player setdammage X;
   sleep X;
};

But your loop always give the player the same damage ;)

Use this instead:

_unit = player;

While {!mask} do 
{
   _unit setDamage ((getDammage _unit) + 0.1);
   sleep 1;
};

Share this post


Link to post
Share on other sites

Just curious, are the sides covered when using a wider aspect ratio?

Share this post


Link to post
Share on other sites
Just curious, are the sides covered when using a wider aspect ratio?

it should be as long as you define the size with SafeZone

x = SafeZoneX;
y = SafeZoneY;
w = SafeZoneW;
h = SafeZoneH;

But your loop always give the player the same damage

umm. it was not realy a code to be used.it was just to give the general idea.

Edited by nuxil

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  

×