Jump to content
  • 0

Modifying Halvhjearne's Killfeed


natoed

Question

from here

Greeting to All,

Whist I love the killfeed, its lacking as epoch has grown. Wanting to add killed/eaten by zombie to the killfeed.

First of just adding ryan's zombie then added sm zombz and epoch's zombies.

I've tried a couple of time but failing hard.

I just can not get my head around all the nested if and else statements, most likely have inserted code in the wrong spot again.

so here's what I've got so far from line 143 (notepad ++).

File in question - halv_fnc_playerdied.sqf

Any and all help would be great, thanks

 

cheers

natoed

 

  Reveal hidden contents

 

 

 

Edited by natoed
updated
Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 1

Here's your test code.

  Reveal hidden contents
Link to comment
Share on other sites

  • 0

In your case the _victim (Player Killed) will not be the _killer (The One who killed the player). Line 144. The if it is in had already checked that the killer was not the player so it's also redundant.

 

Here's how I would try it.

			_loc_message = format["[KillFeed]: PKILL: %1 | %2",_message,_killerType];
			// Ryan Zeds
			if ((gettext (configFile >> 'CfgVehicles' >> _killerType >> 'author')) isEqualTo "Ryan")then{
			{
				_message = format["%1 was eaten by zombies",_victimName];
				_hint = parseText format["<t align='Center'shadow='2'>%1</t>",_message];
				_dyntxt = format["<t size='0.70'align='left'shadow='1'>%1</t>",_message];
				_loc_message = format["[KillFeed]: PKILL: %1 was eaten by zombies| '%2' - '%3'", _victimName,_killer,_weapon];
			};
		};
	};		
}else{

 

You already have the typeOf killer so just see if it is a Ryan zed, if so player was killed by a zed.
No need to get nearEntities as it won't run if the _killer isn't a zed. Also bad code as someone getting shot while standing near a zed might report a zed kill.
I also believe _player is undefined in that if.

 

EDIT: Looking at Ryan's Zeds code if they aren't dealing direct damage they may not come back as the killer. Would need to see what is being returned in the handler to fix that. (if so)

Link to comment
Share on other sites

  • 0

@TheVampire

Thanks for your time and input, unfortunately the code above stop the killfeed from working(no errors in server or client rpt's)

However I did note that 1 x }; was missing from your code, I added it back like below

			_loc_message = format["[KillFeed]: PKILL: %1 | %2",_message,_killerType];
			// Killed by Ryan's Zombie 
			if ((gettext (configFile >> 'CfgVehicles' >> _killerType >> 'author')) isEqualTo "Ryan")then{
				{
				_message = format["%1 was eaten by zombies",_victimName];
				_hint = parseText format["<t align='Center'shadow='2'>%1</t>",_message];
				_dyntxt = format["<t size='0.70'align='left'shadow='1'>%1</t>",_message];
				_loc_message = format["[KillFeed]: PKILL: %1 was eaten by zombies| '%2' - '%3'", _victimName,_killer,_weapon];
				};
			};
		};
	};		
}else{

with the bracket and semicolon in-place the killfeed would work as expected thou the killed by ryan's zombie didn't work just rolled through to  "player died for an unknown reason!"

I'll keep trying thanks again.

cheers

natoed

Link to comment
Share on other sites

  • 0

I have a feeling that the Killer is null with zeds. They used to use setDamage and now use setHit on the Body.

Can you uncomment this line and give me the details of what it logs?

//diag_log format["[KillFeed] halv_fnc_playerdied.sqf server function triggered for player %1 and killer %2",_player,_killer];

 

Link to comment
Share on other sites

  • 0

halv_fnc_playerdied.sqf  - unedited with line 13 uncomment

server rpt

10:37:26 "[KillFeed] halv_fnc_playerdied.sqf server function triggered for player B Alpha 1-1:1 (DRINK natoed) REMOTE and killer B Alpha 1-1:1 (DRINK natoed) REMOTE"
10:37:26 "[KillFeed]: PKILL: DRINK natoed died for an unknown reason! | 'B Alpha 1-1:1 (DRINK natoed) REMOTE' - 'Rollins_F'"

 

client rpt

10:37:26 Performance warning: SimpleSerialization::Read 'HalvPV_player_message' is using type of ,'TEXT' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types
10:37:26 "Half_fnc_message_players.sqf  _sender B Alpha 1-1:1 (DRINK natoed) | _type hint | _message DRINK natoed died for an unknown reason!"
10:37:26 Performance warning: SimpleSerialization::Read 'HalvPV_player_message' is using type of ,'TEXT' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types
10:37:26 "Half_fnc_message_players.sqf  _sender B Alpha 1-1:1 (DRINK natoed) | _type hintSilent | _message DRINK natoed died for an unknown reason!"

 

Link to comment
Share on other sites

  • 0

I should have you another script by the time you're on tomorrow.

The code you had to check for zeds should be decent but it needs to go elsewhere.

The area your code needs to be is after the section by the //if player is killer area. Check for a near zed using nearObjects "Man" select 1, check if that's a zed, if so died to zeds. Cant type it up on mobile.

Link to comment
Share on other sites

  • 0

thx Vamp

It errors out tho and killfeed rolls thought to player died for an unknown reason!

10:46:45 Error in expression <timName,_killer,_weapon];


_nearZed = (nearestObjects [(getPos _victim), ["Man">
10:46:45   Error position: <nearestObjects [(getPos _victim), ["Man">
10:46:45   Error 0 elements provided, 3 expected
10:46:45 File mpmissions\__cur_mp.Altis\2dmin\addons\messages\halv_fnc_playerdied.sqf, line 149
10:46:45 "[KillFeed]: PKILL: DRINK natoed died for an unknown reason!| 'B Alpha 1-1:1 (DRINK natoed) REMOTE' - ''"

I don't want take up anymore of your time Vamp and thank you for your help. (looking forward to the new VEMF btw)

I will come back to it at later point  when I have learnt more.

So for a quick work-around  yes its piss weak and lame but it will do for now  I'll edit the following

}else{
	//if player is killer
	_message = format["%1 died for an unknown reason!",name _player];
	_hint = parseText format["<t align='Center'shadow='2'>%1</t>",_message];
	_dyntxt = format["<t size='0.70'align='left'shadow='1'>%1</t>",_message];
	_loc_message = format["[KillFeed]: PKILL: %1 died for an unknown reason!| '%2' - '%3'", _victimName,_killer,_weapon];

to this

}else{
	//if player is killer
	_message = format["%1 died for an unknown reason!<br/>Maybe a Zombie...",name _player];
	_hint = parseText format["<t align='Center'shadow='2'>%1</t>",_message];
	_dyntxt = format["<t size='0.70'align='left'shadow='1'>%1</t>",_message];
	_loc_message = format["[KillFeed]: PKILL: %1 died for an unknown reason!<br/>Maybe a Zombie...| '%2' - '%3'", _victimName,_killer,_weapon];

many thanks

natoed

Link to comment
Share on other sites

  • 0
  On 6/16/2017 at 2:12 AM, TheVampire said:

Change

(getPos _victim)

To

(getPos _player)

(_victim must be null)

Expand  

On the money Vamp and thank you again

for anybody else wanting killed by zombies with Halvhjearne's Killfeed

halv_fnc_playerdied.sqf  dont forget the thank @TheVampire

 

  Reveal hidden contents

 

big smile on my face

cheers

natoed

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...