[FilterScript] Blood splatter from gunshots!
#1

Blood Splatter!

This script will change gunshots forever. Using ColAndreas and some simple math this script will splatter blood in the direction of the gunshots. The distance varies between 0 and 5. When the distance is 0 the blood will obviously go no where. When it is 1 - 5 it will splatter on any wall beyond the player being shot. The blood fades away within 2 seconds after it is splattered.
__________________________________________________ __________________________________________________

Screenshots:




__________________________________________________ __________________________________________________

Changelog:
  • 1.0.1 - Initial Release
  • 1.0.2 - Timer Optimization
  • 1.0.3 - Normal Leveling (produces random difference from the walls to prevent texture overlapping)
  • 1.0.4 - Removes y_iterate and blood limit.
  • 1.0.5 - Return value in ONWS to allow damage.
__________________________________________________ __________________________________________________

Requirements:
  • ColAndreas thanks to Pottus, Chris, and Slice (ColAndreas is the center of this FS).
  • Streamer, thanks to Incognito (using streamer since bullets shoot fast, there will be hundreds of blood objects).
  • FloatRand, thanks to Y-Less (better than my float random function).
  • *Removed*y_iterate, thanks to Y-Less (using y_iterate to handle the streamer ID's so we don't need gigantic, inefficient methods).
__________________________________________________ __________________________________________________

Bugs, Concerns, and Questions:
  • Streaming based on player movement will make it look weird. To fix, change the streamer update mode in your gamemode.
  • The ColAndreas world is based on YOUR world. For this script to work you need to have a world to begin with, if you use the San Andreas map (of course most of you do) just do CA_Init in your gamemode.
  • The blood isn't showing sometimes? It's random. It's a 5 out of 11 chance of being splattered. And as noted in the description, those 5 chances represent distances (if it's a 1, the blood will only splatter 1 unit away; 5, 5 units; and all those in between).
__________________________________________________ __________________________________________________

BloodSplatter 1.0.5
Reply
#2

Yet an amazing release from you crayder , that's a great use of ColAndreas.
Reply
#3

You can do this without the need for any variables at all actually do it like this.

Code:
forward FadeBlood(objectid, alpha, time);
public FadeBlood(objectid, alpha, time)
{
    alpha -= 5;
    if(alpha) {
        SetDynamicObjectMaterial(objectid, 0, -1, "none", "none", 0xFF0000 | (alpha << 24));
        SetTimerEx("FadeBlood", time, false, "iii", objectid, alpha, time);
    }
	else {
        DestroyDynamicObject(objectid);
    }
}
Reply
#4

Oh wow, nice one mate, i'll be using this
Reply
#5

Quote:
Originally Posted by Pottus
View Post
You can do this without the need for any variables at all actually do it like this.

Code:
forward FadeBlood(objectid, alpha, time);
public FadeBlood(objectid, alpha, time)
{
    alpha -= 5;
    if(alpha) {
        SetDynamicObjectMaterial(objectid, 0, -1, "none", "none", 0xFF0000 | (alpha << 24));
        SetTimerEx("FadeBlood", time, false, "iii", objectid, alpha, time);
    }
	else {
        DestroyDynamicObject(objectid);
    }
}
Yeah but what's the harm in two variables in a super small filterscript...?

Still no problem, will do (edit; done in 1.0.1).

__________________________


v1.0.2: Normal leveling to prevent texture overlapping.
Reply
#6

Excellent, I will definitely be implementing this. Thanks!
Reply
#7

Well you really don't need the iterator or any variables actually just supply the object id instead of index.
Reply
#8

Quote:
Originally Posted by Pottus
View Post
Well you really don't need the iterator or any variables actually just supply the object id instead of index.
The point of the iterator is to limit the number of blood objects there can be.
Reply
#9

You don't need to worry about limiting them though since they disappear pretty quickly.
Reply
#10

Quote:
Originally Posted by Pottus
View Post
You don't need to worry about limiting them though since they disappear pretty quickly.
Point taken. I have a feeling a lot of people are going to complain about ackslimit crashes...

I'm going to make them stay solid for a second before fading too. Like the ones in GTA (the ones that go on the ground when you are shot).
Reply
#11

Awesome FS !!!
Reply
#12

Awesome Man
I'll Using This ... Very Nice !!
Reply
#13

Not bad , not good , it's great. Great job
Reply
#14

Great.
Reply
#15

Awesome. Nice work Crayder
Reply
#16

What the........ Amazing..... Amazing work. Thanks Crayder... +REP.
Reply
#17

Creative.
Reply
#18

Very nice!!!
Reply
#19

looks cool,
Reply
#20

Great job.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)