Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2015-03-18 22:53:14

AK712
Member
Joined: 2015-02-16
Posts: 94

Check if User Died by Spikes or Fire

Hello everyone,

I am trying to get a death count in a level with spikes, fire, and portals. I heard that m.Type == "tele" would work, but because there are portals, it would be inaccurate. Does anyone know a better way of doing this?

Thanks,
AK712


O4DmNuI.png

Offline

#2 2015-03-18 23:04:02

Jabatheblob1
Member
Joined: 2015-03-01
Posts: 856

Re: Check if User Died by Spikes or Fire

There's one death message, which is tell. To tell if a user died by spikes or fire you would need to track their movement and then check where they died and check which block is at that X and Y


If you would like me to make a bot for you, go here.

Offline

Wooted by:

#3 2015-03-19 09:12:53

realmaster42
Formerly marcoantonimsantos
From: ̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍
Joined: 2015-02-20
Posts: 1,380
Website

Re: Check if User Died by Spikes or Fire

Jabatheblob1 wrote:

There's one death message, which is tell. To tell if a user died by spikes or fire you would need to track their movement and then check where they died and check which block is at that X and Y

Unless you are better than everyone, that way is almost impossible to do.


http://i.imgur.com/bjvgH5L.png?1

Offline

#4 2015-03-19 11:09:03, last edited by DarkDragon4900 (2015-03-19 11:10:30)

DarkDragon4900
Member
Joined: 2015-03-17
Posts: 251

Re: Check if User Died by Spikes or Fire

marcoantonimsantos wrote:

Unless you are better than everyone, that way is almost impossible to do.

Step 1 - Get the player's x and y right before death.
Step 2 - Check if they're identical to the block's x and y.
Doesn't look like it's impossible to me.

Offline

Wooted by:

#5 2015-03-19 17:25:21, last edited by Jabatheblob1 (2015-03-19 17:29:33)

Jabatheblob1
Member
Joined: 2015-03-01
Posts: 856

Re: Check if User Died by Spikes or Fire

It's not impossible or terribly hard, i haven't messed with ee physics in a while but i can try to show you how to do that when i get back from spring break.
[Edit]:

/*# tele - Owner reset the world
[0] <Boolean> True = used /reset command, False = Someone got killed by hazard
[1] <Integer> UserID
[2] <Integer> SpawnPosX
[3] <Integer> SpawnPosY
[..] If more users exists*/
if(m.type == "tele")
{
	if(!m.GetBoolean(0))
	{
		if(users.ContainsKey(m.GetInt(1)))
		{	
			string username = users[m.GetInt(1)];
			if(blocks[0,m.GetInt(2), m.GetInt(3)] == SpikeId)
			{
				//Player was killed by spike
			}
			else if(blocks[0,m.GetInt(2), m.GetInt(3)] == FireId)
			{
				//Player was killed by fire
			}
		}
	}
}

Sorry i looked at the messages again and it looks like they added an X and Y message to tele...


If you would like me to make a bot for you, go here.

Offline

#6 2015-03-19 17:39:06, last edited by DarkDragon4900 (2015-03-19 17:42:39)

DarkDragon4900
Member
Joined: 2015-03-17
Posts: 251

Re: Check if User Died by Spikes or Fire

The X and Y specify where the player spawns though.

[Edit] The X and Y at #tele contain the coords the player spawns at, since it is sent once the player is "teleported" back to the spawn.
While the coords at #kill specify the death location, so that should do it.

#tele Player was teleported
[0]  ‹bool› (true) - #kill exists
[1]  ‹int› User ID
[2]  ‹int› Spawn X
[3]  ‹int› Spawn Y
[..] If more users exist

#kill Player died *CHECK*
[0]  ‹int› User ID
[1]  ‹int› Spawn X
[2]  ‹int› Spawn Y

Offline

#7 2015-03-19 18:09:34

Jabatheblob1
Member
Joined: 2015-03-01
Posts: 856

Re: Check if User Died by Spikes or Fire

I didn't even know there was a kill message //forums.everybodyedits.com/img/smilies/tongue


If you would like me to make a bot for you, go here.

Offline

#8 2015-03-21 01:09:36

Priddle
Member
From: The Netherlands
Joined: 2015-02-15
Posts: 454

Re: Check if User Died by Spikes or Fire

I might make something for this. //forums.everybodyedits.com/img/smilies/tongue

Offline

Priddle1426896576485049

Board footer

Powered by FluxBB

[ Started around 1732490611.297 - Generated in 0.049 seconds, 12 queries executed - Memory usage: 1.49 MiB (Peak: 1.62 MiB) ]