Daniel 0 Posted November 25, 2009 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
nuxil 2 Posted November 25, 2009 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
Daniel 0 Posted November 25, 2009 Thanks for the quick response nuxil! Got my scripting hat on, will report back. Share this post Link to post Share on other sites
Daniel 0 Posted November 25, 2009 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
nuxil 2 Posted November 25, 2009 Im off to bed. if no one helps you. i guess i can tomorrow, Share this post Link to post Share on other sites
Daniel 0 Posted November 28, 2009 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
nuxil 2 Posted November 28, 2009 (edited) 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 November 28, 2009 by nuxil Share this post Link to post Share on other sites
Daniel 0 Posted November 28, 2009 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. I'll try and hunt down some .paa tutorials. Share this post Link to post Share on other sites
nuxil 2 Posted November 28, 2009 (edited) 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 November 28, 2009 by nuxil Share this post Link to post Share on other sites
Daniel 0 Posted November 28, 2009 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
nuxil 2 Posted November 28, 2009 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
Daniel 0 Posted November 28, 2009 Cheers, have a look at that please. http://dump.no/files/eec59dc76c02/gasmask.png Share this post Link to post Share on other sites
nuxil 2 Posted November 28, 2009 try it.. i did not load it up in arma to test.. but it should work also your size was 1028 x 512 i resized it to correct size. 1024 x 512 i also made the white part transparant. http://dump.no/files/547a7c78116c/gasmask.paa Share this post Link to post Share on other sites
Daniel 0 Posted November 28, 2009 (edited) Awesome! Thanks, works like a charm, looks pretty good for a first knock up too. Edited November 29, 2009 by Daniel Share this post Link to post Share on other sites
28thCDM 10 Posted December 6, 2009 (edited) 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 December 6, 2009 by 28thCDM Share this post Link to post Share on other sites
Cyborg11 10 Posted December 6, 2009 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
celery 8 Posted December 6, 2009 Just curious, are the sides covered when using a wider aspect ratio? Share this post Link to post Share on other sites
nuxil 2 Posted December 6, 2009 (edited) 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 December 6, 2009 by nuxil Share this post Link to post Share on other sites