Jump to content
Official BF Editor Forums

Bloody Field Of Vision


alimcleif
 Share

Recommended Posts

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. :D

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 :P Thank in advance :)

Edited by alimcleif
Link to comment
Share on other sites

I was thinking about something like this:

testbig2.jpg

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 :D

Edited by alimcleif
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :P

Edited by Freeze
Link to comment
Share on other sites

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 by Freeze
Link to comment
Share on other sites

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. :P

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 ;)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 5 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...