Jump to content
johnnyboy

How to create blood stains on ground, bullet hit blood fx, and burning shard fx

Recommended Posts

ceeeb, thank you SO MUCH !!!

 

Being a complete ignorant in vectors, I was looking for some code to stick the 1m texture on a slope. And now I can do it !! :)

 

Since I was trying to put some foot trail on the ground, the direction is important. Here's the code do handle it :

fnc_randomPerpVector = compile
"
 _x1 = _this select 0;
 _y1 = _this select 1;
 _z1 = _this select 2;
 _dir = _this select 3;
 
 if (_z1 == 0) then {_z1 = selectRandom [-0.00000001, 0.00000001];};
 
_h = 450 - _dir;
_dir2 = 0;
if ( _h >= 360) then { _dir2 = _h - 360 ;} else {_dir2 = _h;};

 _x2 = cos _dir2;
 _y2 = sin _dir2;
 _z2 = (-(_x1 * _x2) - (_y1  * _y2)) / _z1;
 
 vectorNormalized [_x2, _y2, _z2]
";


_blood = createVehicle ["UserTexture1m_F",[getPosATL player select 0,getPosATL player select 1,(getPosATL player select 2) + 0.01],[],0,"CAN_COLLIDE"];
_blood setObjectTexture [0,"splash.paa"];
_blood setVectorDirAndUp [(surfaceNormal position _blood) vectorMultiply -1, [(surfaceNormal position _blood) select 0, (surfaceNormal position _blood) select 1, (surfaceNormal position _blood) select 2, getdir player] call fnc_randomPerpVector];

Feel free to improve this quick hack.

 

Share this post


Link to post
Share on other sites

No worries :)

 

For the same result, here's my take on a aligned in specific direction version:

_blood = createVehicle ["UserTexture1m_F", [getPosATL player select 0, getPosATL player select 1, (getPosATL player select 2) + 0.01], [], 0, "CAN_COLLIDE"];
_blood setObjectTexture [0, "blood.paa"];
_blood setVectorDirAndUp [(surfaceNormal position _blood) vectorMultiply -1, [surfaceNormal position _blood, direction player] call fnc_alignedPerpVector];

where fnc_alignedPerpVector is:

fnc_alignedPerpVector = compile
"
  _x1 = _this select 0 select 0;
  _y1 = _this select 0 select 1;
  _z1 = _this select 0 select 2;
  _dir = _this select 1;
 
  if (_z1 == 0) then {_z1 = selectRandom [-0.00000001, 0.00000001];};
 
  _x2 = sin _dir;
  _y2 = cos _dir;
  _z2 = (-(_x1 * _x2) - (_y1  * _y2)) / _z1;
 
  vectorNormalized [_x2, _y2, _z2]
";
  • Like 1

Share this post


Link to post
Share on other sites

i know this is off topic(i cant post a new topic, maybe because i have low post count) but i have a dumb question, im making a mission and making a script to have a scroll menu for the user to select and change his weapons at anytime and same deal with attachments and such. it is working when i open my mission ingame and type execVM "loadouts.sqf"; and i scroll my mouse and click rifles and then it gives me my mk18(code below), however when i put execVM "loadouts.sqf"; in my init.sqf i get the option to select rifle, but when i do nothing happens. any idea why its not working properly when loaded from my init.sqf?

 

player addAction ["rifle", mk18];
mk18 = {
player addWeapon 'srifle_EBR_F'; player addPrimaryWeaponItem "20Rnd_762x51_Mag";
};

Share this post


Link to post
Share on other sites

 

No worries :)

 

For the same result, here's my take on a aligned in specific direction version:

 

 

Far better !! :) 

Thx again !!!!

Share this post


Link to post
Share on other sites

i know this is off topic(i cant post a new topic, maybe because i have low post count) but i have a dumb question, im making a mission and making a script to have a scroll menu for the user to select and change his weapons at anytime and same deal with attachments and such. it is working when i open my mission ingame and type execVM "loadouts.sqf"; and i scroll my mouse and click rifles and then it gives me my mk18(code below), however when i put execVM "loadouts.sqf"; in my init.sqf i get the option to select rifle, but when i do nothing happens. any idea why its not working properly when loaded from my init.sqf?

 

player addAction ["rifle", mk18];
mk18 = {
player addWeapon 'srifle_EBR_F'; player addPrimaryWeaponItem "20Rnd_762x51_Mag";
};

mk18 definition should go before addaction not after

  • Like 1

Share this post


Link to post
Share on other sites

sharing is caring , so this is what i put together with what ive read from this topic and a few others

So credits go to all.

big thanks to KK and davidoss

fnc_bloodbath = {
    params ["_turntable","_largeSplash","_smallSplash"];

    _turntable = createVehicle ["UserTexture1m_F",_this select 0,[],0,"CAN_COLLIDE"];
	_turntable setPosATL [getPosATL _turntable select 0, (getPosATL _turntable select 1)+10, getPosATL _turntable select 2];
    _turntable hideObjectGlobal true;
    _largeSplash = createSimpleObject ["a3\characters_f\blood_splash.p3d", getPosWorld _turntable]; 
    _largeSplash setDir random 360;
    _largeSplash attachTo [_turntable];
	_smallSplash = createSimpleObject ["a3\characters_f\data\slop_00.p3d", getPosWorld _turntable]; 
    _smallSplash setDir random 360;
	_smallSplash attachTo [_turntable];
    _smallSplash setVectorUp surfaceNormal getPosWorld _smallSplash;
    _turntable setDir random 360;

  };

I use this on a hit event handler . it's a little overkill , and  yeah.. I'm hoping someone could use it and maybe clean it up.. what id like to do is randomize the blood size and pos,  

  • Like 1

Share this post


Link to post
Share on other sites

ok redid some of the code both are ok, but I would like to have it use random blood.paa or random p3d.

fnc_bloodbath = {
    params ["_turntable","_largeSplash","_smallSplash"];

    _turntable = createVehicle ["UserTexture1m_F",_this select 0,[],0,"CAN_COLLIDE"];
    _turntable setPosATL [(getPosATL _turntable select 0)+ 2 - floor random 5, (getPosATL _turntable select 1) + 2 - floor random 5,(getPosATL _turntable select 2) + 2 - floor random 5];
    _turntable hideObjectGlobal true;
    _largeSplash = createSimpleObject ["a3\characters_f\blood_splash.p3d", getPosWorld _turntable];                                 //getPosATL _turntable select 2];   <---maybe better             
    _largeSplash setDir random 360;
    _largeSplash attachTo [_turntable];
	_smallSplash = createSimpleObject ["a3\characters_f\data\slop_00.p3d", getPosWorld _turntable]; 
    _smallSplash setDir random 360;
	_smallSplash attachTo [_turntable];
    _smallSplash setVectorUp surfaceNormal getPosWorld _smallSplash;
    _turntable setDir random 360;

  };

Share this post


Link to post
Share on other sites

Guys, I have to resurrect this topic, as I saw this (check minute 1:09): 

 

 

:icon15: This is some amazing looking blood-in-water-effect.

 

Does anyone happen to know how to create something like this?

Share this post


Link to post
Share on other sites
4 hours ago, Undeceived said:

Guys, I have to resurrect this topic, as I saw this (check minute 1:09): 

 

 

:icon15: This is some amazing looking blood-in-water-effect.

 

Does anyone happen to know how to create something like this?

I'd hate to bump this too plus its my first post here because im kind of urged to need blood stains too lol... I wish someone could design a template that we could use in 3den, although i dont care if the pools are small or large... im just making a ravage mission that i need it to be on the walls and such for in a "hospital"...

Share this post


Link to post
Share on other sites
5 hours ago, socs said:

I'd hate to bump this too plus its my first post here because im kind of urged to need blood stains too lol... I wish someone could design a template that we could use in 3den, although i dont care if the pools are small or large... im just making a ravage mission that i need it to be on the walls and such for in a "hospital"...

 

Welcome, socs.

 

Since (I think) the Laws Of War update we (everyone, owning the DLC or not) have proper and good "official" blood stains of different size or type in EDEN editor. :icon14:  They're good looking and easy to use. Just search for blood in the editor and you'll find them.

Share this post


Link to post
Share on other sites
14 hours ago, Undeceived said:

 

Welcome, socs.

 

Since (I think) the Laws Of War update we (everyone, owning the DLC or not) have proper and good "official" blood stains of different size or type in EDEN editor. :icon14:  They're good looking and easy to use. Just search for blood in the editor and you'll find them.

Could you kinda direct me to it? I looked (from what i thought) was everywhere for it and could not find it... Thanks for the welcome as well! Good to see some pretty decent people on forums..

Share this post


Link to post
Share on other sites

Open Eden, press R to open the right hand side list.

Then select the Objects tab (I'm not at my PC right now so I don't remember the exact name of it. But it's not the single units, it's not groups, not modules, not markers, but the last one on the right side - objects, props or whatever it's called).

 

Then press ctrl+f and type in: Blood

 

This should show the textures in the list.

 

That IF these objects are not restricted to DLC owners. But I'm pretty sure they are part of the free platform updates that come with every update.

Share this post


Link to post
Share on other sites
11 hours ago, Undeceived said:

Open Eden, press R to open the right hand side list.

Then select the Objects tab (I'm not at my PC right now so I don't remember the exact name of it. But it's not the single units, it's not groups, not modules, not markers, but the last one on the right side - objects, props or whatever it's called).

 

Then press ctrl+f and type in: Blood

 

This should show the textures in the list.

 

That IF these objects are not restricted to DLC owners. But I'm pretty sure they are part of the free platform updates that come with every update.

Yes i did happen to find them thank you... I also own every dlc up to tanks so im good lol... But again thanks for the help, makes mission editing much easier..

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×