alimcleif Posted November 18, 2010 Report Share Posted November 18, 2010 (edited) Hi. In my mod soldiers regenerate their healt when not beeing shot at. What I want is the soldiers field of vision to become bloody when he has 20% or less health and I want the blood to gradually disappear when he regenerates. If there is an easy way to do it, I would also like the heartbeats from the end of a round to be heard by the player when he is wounded. Can someone please help figure out how to get this done? ..And please go easy on me, I am definitely not a profesional when it comes to this Thank in advance Edited November 18, 2010 by alimcleif Quote Link to comment Share on other sites More sharing options...
rhysm_08 Posted November 20, 2010 Report Share Posted November 20, 2010 Now that would be a cool feature , Just like BadCo 2, or CoD. Quote Link to comment Share on other sites More sharing options...
alimcleif Posted November 21, 2010 Author Report Share Posted November 21, 2010 That was the plan I can't make it without some help though Quote Link to comment Share on other sites More sharing options...
Freeze Posted November 21, 2010 Report Share Posted November 21, 2010 (edited) You can put an image on top of his field of vision and make it transparent based on his health. Need an image though. Unless you want a plain red overlay. It would have to be at 30 health, though. Can't change that. Edited November 21, 2010 by Freeze Quote Link to comment Share on other sites More sharing options...
alimcleif Posted November 23, 2010 Author Report Share Posted November 23, 2010 (edited) I was thinking about something like this: Is it possible to have two different images on top of each other, like one image when you're wounded and a second image on top of it when you're very wounded? Why does it have to be at 30 health? Anyway, thanks for the reply Edited November 23, 2010 by alimcleif Quote Link to comment Share on other sites More sharing options...
UberWazuSoldier Posted November 24, 2010 Report Share Posted November 24, 2010 Well, there's a HUD variable that turns on when the health is below 30%, and it's responsible for making the health bar go red. So you would make a picture node on the HUD and set it's "show variable" to whatever the name of the one that comes on at 30% health is. You can use the fade-in and fade-out times to make it a more gentle transition, but that's the gist of it. Quote Link to comment Share on other sites More sharing options...
alimcleif Posted November 28, 2010 Author Report Share Posted November 28, 2010 Thanks for the reply, but could you please explain a little more step-by-step? Quote Link to comment Share on other sites More sharing options...
Freeze Posted November 28, 2010 Report Share Posted November 28, 2010 (edited) hudBuilder.createPictureNode BottomLeftPrimaryHealth FOV 0 0 800 600 hudBuilder.setPictureNodeTexture <your texture here> hudBuilder.setNodeAlphaVariable BottomLeftHealthFadedAlpha hudBuilder.setNodeShowVariable PlayerHealthBlink I think something like this would work. Do you want it to show up when you're in a vehicle? On top of the HUD itself? Make an atlas for your new image and a .tai file to put the texture in the menu, then change <your texture here> to the path and shove that in HudElementsPlayer.con in the Player Health section. Or if you're going to put it around somewhere else, make sure it loads before menus like the Commander menu. Wouldn't be easy using the commander assets with a bloody FOV. Edited November 28, 2010 by Freeze Quote Link to comment Share on other sites More sharing options...
mschoeldgen[Xww2] Posted November 29, 2010 Report Share Posted November 29, 2010 Unfortunately the 30% seem to be hardcoded. If anyone knows how to change the value to ,lets say ,10% i'd be eager to know Quote Link to comment Share on other sites More sharing options...
Freeze Posted November 29, 2010 Report Share Posted November 29, 2010 (edited) This might be a little limited and far fetched, but I think I know a way to get it to work on certain health values. hudBuilder.setPictureNodeVariableTexture This lets us set textures to a variable that we can't otherwise access... There is a PlayerHealth variable that is used in the bar node to show how much HP the player has. So what if we tried... hudBuilder.setPictureNodeVariableTexture PlayerHealth At 100 health, it would use a picture in the texture root directory called 100. But if we don't have a texture called "100" in the root directory, it will just be invisible. So what if we only added textures from, let's say, 20 -> 0? Would that be a quick workaround to make it occur on custom health values? Of course, you would have to make a new atlas and copy and paste some lines in the .tai so it saves the same texture as a "number" name several times, and your texture can't have a .tga extension suffix. Not to mention a bit unclean. You might even get an error upon the HUD realizing a texture doesn't exist (although you could put an invisible texture as a quick fix). Just doing some out of the box thinking here. Edited November 29, 2010 by Freeze Quote Link to comment Share on other sites More sharing options...
alimcleif Posted December 2, 2010 Author Report Share Posted December 2, 2010 hudBuilder.createPictureNode BottomLeftPrimaryHealth FOV 0 0 800 600 hudBuilder.setPictureNodeTexture <your texture here> hudBuilder.setNodeAlphaVariable BottomLeftHealthFadedAlpha hudBuilder.setNodeShowVariable PlayerHealthBlink I think something like this would work. Do you want it to show up when you're in a vehicle? On top of the HUD itself? Make an atlas for your new image and a .tai file to put the texture in the menu, then change <your texture here> to the path and shove that in HudElementsPlayer.con in the Player Health section. Or if you're going to put it around somewhere else, make sure it loads before menus like the Commander menu. Wouldn't be easy using the commander assets with a bloody FOV. Sorry to be such a noob but which file am I going to add these lines to?:S Yes I would like it to show up when in a vehicle. I have diabled commander in my mod, so that's not going to be an issue Quote Link to comment Share on other sites More sharing options...
Freeze Posted December 2, 2010 Report Share Posted December 2, 2010 Sorry to be such a noob but which file am I going to add these lines to?:S Yes I would like it to show up when in a vehicle. I have diabled commander in my mod, so that's not going to be an issue Well the HUD has layers based on what was made first and last. If you want the thing to show up underneath all the HUD icons (weapon ammo, scoreboard, health bar, etc.) then you should add it before anything else is loaded. i.e. the first HUD is GeneralHudSettings.con, so you would put it at the bottom of that if you want it to be "underneath" the HUD itself. rem ----------------------------------------- Top Layer Hud ------------------------------------------------------------------------------ hudBuilder.createSplitNode TopLayer TopLayerHud hudBuilder.setNodeShowVariable ShowIngameHud hudBuilder.setNodeInTime 2 hudBuilder.setNodeOutTime 2 hudBuilder.addNodeAlphaShowEffect rem ----------------------------------------- Bloody FOV ------------------------------------------------------------------------------ hudBuilder.createPictureNode IngameHud FOV 0 0 800 600 hudBuilder.setPictureNodeTexture <your texture here> hudBuilder.setNodeAlphaVariable BottomLeftHealthFadedAlpha hudBuilder.setNodeShowVariable PlayerHealthBlink Quote Link to comment Share on other sites More sharing options...
ostrich_policy Posted December 9, 2010 Report Share Posted December 9, 2010 Just to inform you: it works, but it kind of 'blinks' in and out. Quote Link to comment Share on other sites More sharing options...
UTSA}LeafyCargo Posted January 7, 2011 Report Share Posted January 7, 2011 Just to inform you: it works, but it kind of 'blinks' in and out. thats because you have this line in the code telling it to blink > hudBuilder.setNodeShowVariable PlayerHealthBlink <<<< Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.