header general

[Help] Low health fade/blood splatter effect

  • BadMojo
  • BadMojo's Avatar
  • Wicked
  • Wicked
More
7 years 7 months ago #31 by BadMojo
Replied by BadMojo on topic My childish questioning again....
Hmmm... Ill experiment with that.. It does seem like alot of work though to get this working straight out of the box, and for compatibility this could be a problem.. But Ill experiment with it and see how it goes.

Please Log in or Create an account to join the conversation.

  • Blue Shadow
  • Blue Shadow's Avatar
  • Administrator
  • Administrator
More
7 years 7 months ago - 7 years 7 months ago #32 by Blue Shadow
Replied by Blue Shadow on topic My childish questioning again....

CaptainManiac wrote: I tested it on Zandronum 3 alpha and the nice bloodsplatter script is found and run only on map01,in map12 it gives this error.

The ACS code is imbedded in MAP01, which means it'll only work in that map. The solution is to have the code in a library .

@BadMojo: The WAD does work in Zandronum 3.0 alpha (at least in the build that I have).
Last edit: 7 years 7 months ago by Blue Shadow.

Please Log in or Create an account to join the conversation.

  • BadMojo
  • BadMojo's Avatar
  • Wicked
  • Wicked
More
7 years 7 months ago #33 by BadMojo
Replied by BadMojo on topic My childish questioning again....
Hmm, It didnt work for me on the latest build of zandronum.. The error message was about ACS_NamedExecute , I only gathered that it was because zandronum uses an old build of zdoom and doesnt support that yet (but, my knowledge on the source port is very slim, so I could be very wrong).

On the note of having the code in a library, is there any chance of an example wad?

Please Log in or Create an account to join the conversation.

  • Blue Shadow
  • Blue Shadow's Avatar
  • Administrator
  • Administrator
More
7 years 7 months ago #34 by Blue Shadow
Replied by Blue Shadow on topic My childish questioning again....

BadMojo wrote: On the note of having the code in a library, is there any chance of an example wad?

https://www.dropbox.com/s/57mj0vfuexlfnpz/acslib_demo.wad?dl=1

Please Log in or Create an account to join the conversation.

  • CaptainManiac
  • CaptainManiac's Avatar Topic Author
  • Cacodemon
  • Cacodemon
More
7 years 7 months ago - 7 years 7 months ago #35 by CaptainManiac
Replied by CaptainManiac on topic My childish questioning again....
I had first GzDoom 1.8.02 then i updated it by replacing the files to gzdoom 1.9.1 and yesterday i updated it to gzdoom 2.3 again with replacing the files.The configurations are the same.BadMojo,your bloodsplatter effect really worked on Zan3.0 alpha(at least on the version i have,have not updated Zandronum to the latest version yet).I tried to make CVAR for enabling and disabling the effect in case this effect is used by modders for their mod,but then the effect does not come up.
Code:
script 1 enter { int fadeDecimal = 0.0; //The decimal of the fade int phealth = GetActorProperty(0,APROP_HEALTH); //the health point goes here delay(10); if(phealth <= 50 && phealth > 40) { fadeDecimal = 0.2; delay(10); FadeTo(128,128,128,fadeDecimal,1.0); //below 50:fades to 20% grey delay(10); } else if(phealth <= 40 && phealth >30) { fadeDecimal = 0.3; FadeTo(128,128,128,fadeDecimal,1.0); //below 40:fades to 30% grey and... SetHudSize(1024,768,0); Setfont("M_BLUD"); delay(10); HudMessage(s:"A";HUDMSG_FADEINOUT|HUDMSG_ALPHA,0,CR_WHITE, 0.5,-0.5,0.4,3.0,0.5);//..draws an blood on screen image delay(10); } else if(phealth <=20 && phealth >10) { fadeDecimal = 0.6; FadeTo(255,0,0,fadeDecimal,1.0); //below 20:60% red fading } else if(phealth <= 30 && phealth > 20) { fadeDecimal = 0.4; FadeTo(255,0,0,fadeDecimal,1.0); //below 30:40% red fading } else if(phealth <= 10 && phealth > 1) { fadeDecimal = 0.8; delay(10); FadeTo(255,0,0,fadeDecimal,1.0); //below 10%:a 80% fading(you see hard) delay(10); } else if(phealth <= 1|phealth == 0) { fadeDecimal = 0.9; delay(10); FadeTo(255,0,0,fadeDecimal,1.0); //90% fade on death delay(10); } else { fadeDecimal = 0.0; FadeTo(255,255,255,fadeDecimal,1.0); //resets everything when the above condtions are not met } delay(10); restart; }
If i dare to add on CVARINFO that
Code:
User bool fd_enable = true;
or that
Code:
User bool fd_enable;
and change the code like that
Code:
script 1 enter { int fadeDecimal = 0.0; //The decimal of the fade int phealth = GetActorProperty(0,APROP_HEALTH); //the health point goes here bool enabled = GetCvar("fd_enable"); while(enabled) { delay(10); if(phealth <= 50 && phealth > 40) { fadeDecimal = 0.2; delay(10); FadeTo(128,128,128,fadeDecimal,1.0); //below 50:fades to 20% grey delay(10); } else if(phealth <= 40 && phealth >30) { fadeDecimal = 0.3; FadeTo(128,128,128,fadeDecimal,1.0); //below 40:fades to 30% grey and... SetHudSize(1024,768,0); Setfont("M_BLUD"); delay(10); HudMessage(s:"A";HUDMSG_FADEINOUT|HUDMSG_ALPHA,0,CR_WHITE, 0.5,-0.5,0.4,3.0,0.5);//..draws an blood on screen image delay(10); } else if(phealth <=20 && phealth >10) { fadeDecimal = 0.6; FadeTo(255,0,0,fadeDecimal,1.0); //below 20:60% red fading } else if(phealth <= 30 && phealth > 20) { fadeDecimal = 0.4; FadeTo(255,0,0,fadeDecimal,1.0); //below 30:40% red fading } else if(phealth <= 10 && phealth > 1) { fadeDecimal = 0.8; delay(10); FadeTo(255,0,0,fadeDecimal,1.0); //below 10%:a 80% fading(you see hard) delay(10); } else if(phealth <= 1|phealth == 0) { fadeDecimal = 0.9; delay(10); FadeTo(255,0,0,fadeDecimal,1.0); //90% fade on death delay(10); } else { fadeDecimal = 0.0; FadeTo(255,255,255,fadeDecimal,1.0); //resets everything when the above condtions are not met } } delay(10); restart; }
It does not work anymore,neither the CVAR is "true" nor is "false".
Last edit: 7 years 7 months ago by CaptainManiac. Reason: I make too many mistakes.I really need to take care of my writing skills

Please Log in or Create an account to join the conversation.

  • BadMojo
  • BadMojo's Avatar
  • Wicked
  • Wicked
More
7 years 7 months ago - 7 years 7 months ago #36 by BadMojo
Replied by BadMojo on topic My childish questioning again....
@Blue Shadow Thanks for the example, it makes sense now and works :)

Edit: also, Im not sure if this is the latest version of zandronum (2.1.2).. but it was the one of the front page, I wasnt gonna go any deeper than that. But this is the error message I get when trying to run this through that

Execution could not continue.

Script error, "BLOODSPLAT.zip:bloodsplat.wad:DECORATE" line 53:
Invalid state parameter acs_namedexecute

I know you said something about having version 3.0 and it working on that, so maybe Ive just downloaded an outdated version.

@ CaptainManiac

Did your code even compile? I couldnt get "bool enabled = GetCVar("fd_enable");" to compile, so I removed it and just typed it out where necessary, heres what I have come up with in my version, also including the library thing that Blue Shadow was talking about: https://www.dropbox.com/s/267l6avk62rh08e/BLOODSPLAT.zip?dl=0

Ive defaulted fd_enable to TRUE, so that it works straight out of the box, but if you type the command in the console "fd_enable 0" it will disable it and visa versa.

Ive also replaced that while loop with an if statement, the script already loops as it is, so it doesnt hurt to do that.

Also, take note of my intensity values, Ive lowered them to half of what they were, MagicWazard is right about it being too much.

EDIT 2:
Ok so Ive just realized version 3.0 of zandronum is a devbuild, so that makes sense why our version isnt working... @CaptainManiac, If you want it to work in zandronum Id probably suggest downloading that build... Otherwise, imho id just go with gzdoom if this isnt for multiplayer purposes.
Last edit: 7 years 7 months ago by BadMojo. Reason: just nitpicking at my spelling

Please Log in or Create an account to join the conversation.

  • CaptainManiac
  • CaptainManiac's Avatar Topic Author
  • Cacodemon
  • Cacodemon
More
7 years 7 months ago #37 by CaptainManiac
Replied by CaptainManiac on topic My childish questioning again....
BadMonjo,your code is fully working.I thrashed my code,but modified you code to make the intense limit to 0.6(0.8 to 1.0 blinds the screen and forces the player to run and hide from monsters).I will send the modofication of your code as attachment.The changes are minor.I have also asked for help at Doomworld and i think people that must be credited there are Buu342,scifista42 and MaxED if we are going to publish it.Do you have Doomworld account or not?Can we publish it somewhere?I think it is ready now.
PS:Sorry for changing your code

Please Log in or Create an account to join the conversation.

  • BadMojo
  • BadMojo's Avatar
  • Wicked
  • Wicked
More
7 years 7 months ago - 7 years 7 months ago #38 by BadMojo
Replied by BadMojo on topic My childish questioning again....
No need to apologize for changing my code, It is your project after all ;)
Yea I think I have a doomworld account, but you can submit it here in the sfx shoppe under the other category as a modders resource if you want, but its up to you. you could do both really.

But as for it being ready... I think it could do with some more work to be honest, some better graphics would be good.. But Ill need some time to do them (if you wanted something original). Id also suggest getting some feedback from it first too before anything major.

As for feedback from me, something has to be done about the blood splats not utilizing the whole screen, as it stands it only uses a small portion of the screen.. Ive experimented with that a little bit with no prevail, but Im sure I could get it right after some tweaking. Perhaps create a submission for it here and see what other sort of feedback you get.. Im not sure how doomworld handles it, But its entirely up to you as to whether or not you think its ready.

Edit: Huh, I just looked at the thread you started about this on the doomworld forums, looks like someone has come up with an even more simplified version than mine... After looking at that, Im sure we could do better on the current version (or at least the last version you had posted here).. Theres alot of improvements to be done I think after seeing that.
Last edit: 7 years 7 months ago by BadMojo.

Please Log in or Create an account to join the conversation.

  • CaptainManiac
  • CaptainManiac's Avatar Topic Author
  • Cacodemon
  • Cacodemon
More
7 years 7 months ago #39 by CaptainManiac
Replied by CaptainManiac on topic My childish questioning again....
I think the blood images in screen does no overlap.I tested it on Brutal Doom 64 and it works except the blood images do not show on hurt.
I do not think the blood images make problems with the player and are good,so no more are needed(In The Saboteur this fading was combined with regeneartion system(which i do not want to implement now) and the effect itself was made with a whole OpenGl/DirectX Shader)).As i tested it on Classic Doom it spawns on the whole screen,except the statusbar,i think i can fix this by adding HUDMSG_LAYER_OVERHUD flag,but i am not sure the statusbar will be shown if there are many bloodsplat images.I will publish it,crediting all who helped me,including you.

Please Log in or Create an account to join the conversation.