Jump to content

Recommended Posts

Hi

probably not possible but I wanted to ask if you can make vehicle/man transparent and fade away?

 

kinda like the VR targets are

 

thx!

Share this post


Link to post
Share on other sites

thx @wogz187 I tried setObjectTexture but couldn't make anything transparent. I think there's layers of surfaces or something

Share this post


Link to post
Share on other sites

thx for the links guys!

I read those but didn't get answer to my question. while some kind of transparency maybe possible is fading out possible?

 

Share this post


Link to post
Share on other sites

Since transparent is possible, maybe multiple states between are also possible. I haven't read through that topic thoroughly to understand exactly what they're doing, so I can't say for sure. 

Share this post


Link to post
Share on other sites

I believe BIS_fnc_VREffectKilled is what you are looking for, @gc8.

I don't want to ruin the surprise how it works...

Spoiler

/*
	Author: Karel Moricky

	Description:
	Delete body of a virtual soldier after he's killed

	Parameter(s):
		0: OBJECT
		1 (Optional): BOOL - true to delete the body right away, false to add KILLED event handler which will delete it after death
		2 (Optional): NUMBER - time in seconds before the body disappears

	Returns:
	BOOL
*/

private ["_unit","_exec","_timeout"];
_unit = _this param [0,objnull,[objnull]];
_exec = _this param [1,false,[false]];
_timeout = _this param [2,_unit getvariable ["bis_fnc_VREffectKilled_timeout",10],[0]];

if !(_exec) then {
	//--- Add effect event handler
	if (isnil {_unit getvariable "bis_fnc_VREffectKilled_killed"}) then {
		_unit setvariable [
			"bis_fnc_VREffectKilled_killed",
			_unit addeventhandler ["killed",{[_this select 0,true] spawn bis_fnc_VREffectKilled}]
		];
		_unit setvariable ["bis_fnc_VREffectKilled_timeout",_timeout];
	};
} else {
	//--- Execute the effect (not when Arsenal is opened)
	sleep _timeout;
	_unit enablesimulation false;
	sleep 0.2;
	if (isnull (missionnamespace getvariable ["BIS_fnc_arsenal_target",objnull])) then {
		for "_i" from 0 to 10 do {
			_unit hideobject true;
			sleep 0.05;
			_unit hideobject false;
			sleep 0.05;
		};
	};
	removebackpack _unit; //--- Remove the backpack first, otherwise it stays on the ground
	deletevehicle _unit;
};
true

 

 

  • Like 1

Share this post


Link to post
Share on other sites

@johnnyboy

I am absolutely shocked you haven't added something like this to your script resume!

 

1. Unit is killed - Turns into "Judgement Day T-1000 Liquid Metal".

2. Body drops to the ground, "slowly disappearing".

3. A puddle is created on old body position.

4. Killer freaks out.

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites

@Maff no luck there, the script just hides dead bodies

thx

Share this post


Link to post
Share on other sites

@gc8What is your use case scenario for unit fading away?  What is the effect supposed to communicate to players?  If we know the purpose, we might be able to suggest an alternative.

Share this post


Link to post
Share on other sites

That's a shame, @gc8.
I'm sure the function is the same one used in the VR Missions.

Nice / Dodgy workaround with the hideobject true / false loop I thought.

 

  • Like 1

Share this post


Link to post
Share on other sites

There is also BIS_fnc_VRSpawnEffect, @gc8.

However the unit isn't entirely invisible.

 

Spoiler

/*
	Author: Josef Zemanek

	Description:
	VR unit spawn effect.

	Parameter(s):
		0: OBJECT - Spawned unit
		1: BOOL (Optional) - Reverse effect (hiding), default FALSE
		2: SCALAR (Optional) - Size of the effect, default 0 (small / character)

	Returns:
	Nothing
*/

private ["_unit", "_reverse", "_size", "_relDir", "_pos", "_block1", "_block2"];

_unit = _this param [0,objNull,[objNull]];
_reverse = _this param [1,FALSE,[TRUE]];
_size = _this param [2,0,[0]];

if (isDedicated) exitWith {};

if !(_reverse) then {
	_unit hideObject TRUE;
	_unit spawn {sleep 0.6; _this hideObject FALSE};
} else {
	_unit hideObject FALSE;
	_unit spawn {sleep 0.6; _this hideObject TRUE};
};

_relDir = [_unit, player] call BIS_fnc_dirTo;

_pos = [getPosATL _unit, 1, _relDir] call BIS_fnc_relPos;
_pos vectorAdd [0,0,1];

_block = (if (_size == 1) then {"UserTexture10m_F"} else {"UserTexture_1x2_F"}) createVehicle _pos;
_block setPosATL _pos;

_unit say3D "Spawn";

_block setDir (_relDir + 180);
if !(_reverse) then {
	_block spawn {
		_i = 0;
		_var = 1 + floor random 3;
		while {_i <= 20} do {
			_i2 = str _i;
			if (_i < 10) then {_i2 = "0" + _i2};
			_this setObjectTexture [0, format ["\A3\Ui_f\data\IGUI\RscTitles\Static\EntityTransit\Variant%2\VR_EntityTransit_%1.paa", _i2, _var]];
			_i = _i + 1;
			sleep 0.05;
		};
		deleteVehicle _this;
	};
} else {
	_block spawn {
		_i = 20;
		_var = 1 + floor random 3;
		while {_i >= 0} do {
			_i2 = str _i;
			if (_i < 10) then {_i2 = "0" + _i2};
			_this setObjectTexture [0, format ["\A3\Ui_f\data\IGUI\RscTitles\Static\EntityTransit\Variant%2\VR_EntityTransit_%1.paa", _i2, _var]];
			_i = _i - 1;
			sleep 0.05;
		};
		deleteVehicle _this;
	};
};

 

 

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, johnnyboy said:

@gc8What is your use case scenario for unit fading away?  What is the effect supposed to communicate to players?  If we know the purpose, we might be able to suggest an alternative.

 

just wanted to vehicles/unit have some fading in/out happening before changing their position via setpos or when deleting/creating them

 

Share this post


Link to post
Share on other sites
58 minutes ago, Maff said:

There is also BIS_fnc_VRSpawnEffect, @gc8.

However the unit isn't entirely invisible.

 

  Reveal hidden contents


/*
	Author: Josef Zemanek

	Description:
	VR unit spawn effect.

	Parameter(s):
		0: OBJECT - Spawned unit
		1: BOOL (Optional) - Reverse effect (hiding), default FALSE
		2: SCALAR (Optional) - Size of the effect, default 0 (small / character)

	Returns:
	Nothing
*/

private ["_unit", "_reverse", "_size", "_relDir", "_pos", "_block1", "_block2"];

_unit = _this param [0,objNull,[objNull]];
_reverse = _this param [1,FALSE,[TRUE]];
_size = _this param [2,0,[0]];

if (isDedicated) exitWith {};

if !(_reverse) then {
	_unit hideObject TRUE;
	_unit spawn {sleep 0.6; _this hideObject FALSE};
} else {
	_unit hideObject FALSE;
	_unit spawn {sleep 0.6; _this hideObject TRUE};
};

_relDir = [_unit, player] call BIS_fnc_dirTo;

_pos = [getPosATL _unit, 1, _relDir] call BIS_fnc_relPos;
_pos vectorAdd [0,0,1];

_block = (if (_size == 1) then {"UserTexture10m_F"} else {"UserTexture_1x2_F"}) createVehicle _pos;
_block setPosATL _pos;

_unit say3D "Spawn";

_block setDir (_relDir + 180);
if !(_reverse) then {
	_block spawn {
		_i = 0;
		_var = 1 + floor random 3;
		while {_i <= 20} do {
			_i2 = str _i;
			if (_i < 10) then {_i2 = "0" + _i2};
			_this setObjectTexture [0, format ["\A3\Ui_f\data\IGUI\RscTitles\Static\EntityTransit\Variant%2\VR_EntityTransit_%1.paa", _i2, _var]];
			_i = _i + 1;
			sleep 0.05;
		};
		deleteVehicle _this;
	};
} else {
	_block spawn {
		_i = 20;
		_var = 1 + floor random 3;
		while {_i >= 0} do {
			_i2 = str _i;
			if (_i < 10) then {_i2 = "0" + _i2};
			_this setObjectTexture [0, format ["\A3\Ui_f\data\IGUI\RscTitles\Static\EntityTransit\Variant%2\VR_EntityTransit_%1.paa", _i2, _var]];
			_i = _i - 1;
			sleep 0.05;
		};
		deleteVehicle _this;
	};
};

 

 

 

Something like that! but I see no effect on changing the size parameter

Share this post


Link to post
Share on other sites
_block = (if (_size == 1) then {"UserTexture10m_F"} else {"UserTexture_1x2_F"}) createVehicle _pos;

You need to use 1 as the third parameter to get the larger effect size, otherwise the function will just select the small UserTexture.

 

 

Share this post


Link to post
Share on other sites
3 minutes ago, Maff said:

_block = (if (_size == 1) then {"UserTexture10m_F"} else {"UserTexture_1x2_F"}) createVehicle _pos;

You need to use 1 as the third parameter to get the larger effect size, otherwise the function will just select the small UserTexture.

 

 

 

oh ok 😄 thx

  • Like 1

Share this post


Link to post
Share on other sites

@gc8,

Quote

just wanted to vehicles/unit have some fading in/out happening before changing their position via setpos or when deleting/creating them


IMHO,
You could replace the model with a custom particle effect when it moves/removes. To make it poof in a cloud of smoke would be relatively easy, I think. To make it dematerialize or "screen-door" or simply fade could be a lot more difficult.

I'm eager to see where this goes.

Have fun!

  • Like 1

Share this post


Link to post
Share on other sites
12 hours ago, wogz187 said:

You could replace the model with a custom particle effect when it moves/removes.

 

honestly I think that would work better at strategy game's building demolish than FPS 🙂

 

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

×