Author Topic: Blood like in UT *NEW VERSION*  (Read 6960 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Blood like in UT *NEW VERSION*
« on: December 24, 2007, 10:19:05 am »
Script Name: UT Blood
Script Description: If you get hurt, the screen turns (transparent) red. On respawn it turns white.
Original Author(s): Example by Avkon, script by Mr
Core Version: 2.6.3
Code: [Select]
// let the screen turn red but transpartent on damage for 0.3 seconds
function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
 // Victim = Player Damaged // Shooter = Player doing the damage
  DrawText(Victim,'||',30,RGB(255,0,0),40,-2500,-500);
  result := Damage;
end;

// let the screen turn white on respawn for 0.5 seconds
procedure OnPlayerRespawn(ID: Byte);
begin
  DrawText(ID,'||',50,RGB(255,255,255),40,-2500,-500);
end;
Whole code in the zip attachment!

Hi all,

I saw Avkon's example and thought: Why don't make a script for Soldat, that let it look like UT?
So i scripted a bit and here it is ;D
I wish you a lot of fun with this script ... and i wish you a merry Christmas *g*

Installing this script is not hard:
Download the zip attachment, copy it in the script folder and start (or recompile) the server.



18.05.08 -> New Version

 - Player can switch the blood and respawn effect on and off
 - Compatible to other scripts, so if the player gets one-hit-killed, no, if over 4 players get on-hit-killed (by a script?!), the server won't crash anymore (Yes, I'm setting up an R/S server, and on cap, all die  [pigtail] )
 - R/S compatible


Command:
/blood [on|off] - Turns the blood effect on or off (every player can do this for himself)

The standard value is on, if you want to change it to off, just set Players[ID].ENABLED := true; to false.

Code: [Select]
procedure OnJoinGame(ID, Team: byte);
Begin
 Players[ID].ENABLED := true;
 Players[ID].FIRSTSPAWN := false;
end;

And now, have fun! Code in the zip attachment.
« Last Edit: May 18, 2008, 05:41:51 am by Mr »

Offline Will

  • Flagrunner
  • ****
  • Posts: 910
Re: Blood like in UT
« Reply #1 on: December 24, 2007, 10:33:37 am »
what about when you pick up the medikit

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: Blood like in UT
« Reply #2 on: December 24, 2007, 10:38:57 am »
hmm yes good idea, i will work on this tomorrow, first i check yout my pressents :D
so, tomorrow or this evening i will work on it.

but, wich color i should take for this?
mb a green-white mix?

whatever - you can customize it so or so

Offline Will

  • Flagrunner
  • ****
  • Posts: 910
Re: Blood like in UT
« Reply #3 on: December 24, 2007, 11:18:18 am »
good, good :P

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: Blood like in UT
« Reply #4 on: December 24, 2007, 11:36:19 am »
hmm i got a problem:

there is no event like: OnBonusPickup ....
how to run sth if a healt pack (bonus 1) is picked up?

i just know how to give the bonus 1 (healt pack) ... and http://enesce.com/help/ don't has a answer for me, too.
so i ask it now here.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Blood like in UT
« Reply #5 on: December 24, 2007, 10:02:46 pm »
you could possibly use getplayerstat for that (if XY > ### and < ### then ***) or wutever

ask the guy that made Berserker mod (forgot who, just search 'Berserker Mod')
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: Blood like in UT
« Reply #6 on: December 25, 2007, 07:29:36 am »
hmm, this is a good idea, but .... in getplayerstat is nothing to check the activ bonus.
and i dont know how to work with XY ... i think these are just positions of the player, or am i wrong?

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: Blood like in UT
« Reply #7 on: December 25, 2007, 03:59:25 pm »
u are right, there is no way to check this.
the way beserker mode works (it kills u if u touch a beserker) is by forcing 50% health in the beginning of the map, and checking in apponidle if your health went up. if it did, u took a bonus.

Offline Will

  • Flagrunner
  • ****
  • Posts: 910
Re: Blood like in UT
« Reply #8 on: December 25, 2007, 04:45:09 pm »
so just check if the health went up...

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: Blood like in UT
« Reply #9 on: December 25, 2007, 05:19:49 pm »
it wouldnt be instant. it cal take up to 0.9 second to show the flash, which might be kinda weird. but ye, u could try it.

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: Blood like in UT
« Reply #10 on: December 26, 2007, 03:05:50 am »
k, i will work this evening on it.
but isnt it hard for the cpu to check always on idle the healt of all players? wouldnt this cause lags?

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: Blood like in UT
« Reply #11 on: December 26, 2007, 07:39:13 am »
yes, that is quite cpu-intensive. just try and see if theres too much lag.

Offline Gnintendo

  • Major
  • *
  • Posts: 61
Re: Blood like in UT
« Reply #12 on: December 26, 2007, 09:02:51 am »
hmm i got a problem:

there is no event like: OnBonusPickup ....
how to run sth if a healt pack (bonus 1) is picked up?

i just know how to give the bonus 1 (healt pack) ... and http://enesce.com/help/ don't has a answer for me, too.
so i ask it now here.
use givebonus and make a new variable that's true when givebonus is there.

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: Blood like in UT
« Reply #13 on: December 26, 2007, 01:39:23 pm »
he wants it to be triggered when someone picks up a medkit..

Offline Szewczuq

  • Soldier
  • **
  • Posts: 115
  • WOOH! ROCKS ON MY HEAD!
    • POLISH GAMERS COMMUNITY
Re: Blood like in UT
« Reply #14 on: December 26, 2007, 07:56:13 pm »
hehe usefull script :D:D



Offline Thinkto urself

  • Flagrunner
  • ****
  • Posts: 619
  • grrrrr
    • sup
Re: Blood like in UT
« Reply #15 on: January 02, 2008, 11:20:28 pm »
This is amazing... Can't believe no one ever thought of it!

"An anomaly of the sea, shrouded in ubiquitous clouds, a mystery to the man as black holes to the world's smartest physicists"

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: Blood like in UT
« Reply #16 on: January 31, 2008, 11:50:18 am »
But what about OnPlayerDamage , does it works when you get healthkit?
KAWAAAAAAAIIIIIIIIII

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: Blood like in UT
« Reply #17 on: January 31, 2008, 11:58:32 am »
hmm .... no

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: Blood like in UT
« Reply #18 on: February 01, 2008, 07:25:04 am »
heh, but that script bugged a bit... not all people see red/white screen...just for them || shows in another place, can you explain why?.. cuz i am working on my Hippa mod, and wanna make BLIND effect... well, for me it works well, but other people dont see it...
KAWAAAAAAAIIIIIIIIII

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: Blood like in UT
« Reply #19 on: February 01, 2008, 07:37:44 am »
I'm using the script on my server .... and it works without problems. only the old PCs are lagging a bit :-P
i tried all resultions .... it's working fine.

mb the graphic drivers are too old? just update them and try it again ;)