Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   function onPlayerKills() (https://forums.graalonline.com/forums/showthread.php?t=64664)

Angel_Light 03-10-2006 02:29 PM

function onPlayerKills()
 
I can't find my other thread for this and I can't find it with surch so... w/e. Stefan should really incorporate this command into GS2.


onPlayerKills(specific account/npc id)

I know it would help with pking systems. Stefan if you read this. Please make this command. :'(

Admins 03-10-2006 03:45 PM

For the default hitpoint system ?

jake13jake 03-10-2006 08:54 PM

Well, I would say it would be extremely useful if custom hit systems could use this without lagging the server to death.

Perhaps there could be objectarray.trigger() that could somehow get rid of all the lag created by using a for loop?
like npcs.trigger("PlayerDied",obj_attacker) or npcs.trigger("PlayerKills",obj_deadplayer)
or player.weapons.trigger("Blah",null);

or
temp.triggerthese = findareanpcs(player.x-player.x%64,player.y-player.y%64,64,64);
temp.triggerthese.trigger("PlayerDied",attacker);

ApothiX 03-11-2006 03:17 AM

uh, if you had a custom hit system, you could just send a 'playerkills' message back to the player who killed the one who died. The only thing this would be neat to have in would be the default HP system.

I don't see why you'd really want to alert everyone in the level that someone killed someone else?

jake13jake 03-11-2006 03:31 AM

Quote:

Originally Posted by ApothiX
uh, if you had a custom hit system, you could just send a 'playerkills' message back to the player who killed the one who died. The only thing this would be neat to have in would be the default HP system.

I don't see why you'd really want to alert everyone in the level that someone killed someone else?

Alert everyone in the level???
I mean, the NPCs in the level. Could be used for tracking the amount of kills from a certain time outside of the damage system.

Do you have any idea how to make a custom hit system?

Angel_Light 03-13-2006 05:46 AM

yea jake understands what I'm saying. I mean something like this

if (playerkills) {
player.ap ++;
}

please pardon the GS1 but you undertsnad hopefully

napo_p2p 03-13-2006 11:22 AM

Quote:

Originally Posted by Stefan
For the default hitpoint system ?

It looks like that's what he's suggesting.

I like what jake is saying.

onPlayerKills(obj)
onPlayerDied(obj)

Where obj is a reference to the attacker.

Ajira 03-13-2006 02:42 PM

Quote:

Originally Posted by napo_p2p
It looks like that's what he's suggesting.

I like what jake is saying.

onPlayerKills(obj)
onPlayerDied(obj)

Where obj is a reference to the attacker.

For Kills, obj should refer to the victim. For Died, obj should refer to the attacker.

Skyld 03-13-2006 06:47 PM

Quote:

Originally Posted by Ajira
For Kills, obj should refer to the victim. For Died, obj should refer to the attacker.

Or even better yet, onPlayerKills(attacker, victim) or so.

jake13jake 03-13-2006 09:26 PM

Quote:

Originally Posted by Skyld
Or even better yet, onPlayerKills(attacker, victim) or so.

but player would already be assigned to the attacker object so it would be overkill.

napo_p2p 03-13-2006 09:32 PM

Quote:

Originally Posted by Ajira
For Kills, obj should refer to the victim. For Died, obj should refer to the attacker.

Heh, yeah that's what I wanted to say, but didn't. ^^

Projectshifter 03-14-2006 04:41 PM

I think this has been proposed for a long time, but is there really a need for it? I thought pretty much every server was doing some kind of a custom hit system now?

ApothiX 03-14-2006 05:14 PM

Quote:

Originally Posted by jake13jake
but player would already be assigned to the attacker object so it would be overkill.

You just said you wanted all NPCs in the level to be alerted. So obviously it wouldn't be the 'player' object if an NPC is reading it.

jake13jake 03-14-2006 10:26 PM

Quote:

Originally Posted by ApothiX
You just said you wanted all NPCs in the level to be alerted. So obviously it wouldn't be the 'player' object if an NPC is reading it.

The 'player' object would be implied because the player killing is calling the event. If it were playerdies, then the player dying would be calling the event.

Projectshifter 03-17-2006 01:13 AM

Quote:

Originally Posted by jake13jake
The 'player' object would be implied because the player killing is calling the event. If it were playerdies, then the player dying would be calling the event.

That really doesn't seem to make much sense. You're going to have an NPC in a level that reads onPlayerKills(player)? I'm not sure you're getting the concept of all of this object orientation, onPlayerKills(player) would be a member of what object? If you're wanting to do that, whenever a player is hit you can store the attacker in a string, and if that player dies then trigger to an NPC to calculate it. Otherwise I'm really not seeing the merit of it.

jake13jake 03-17-2006 02:28 AM

Quote:

Originally Posted by Projectshifter
That really doesn't seem to make much sense. You're going to have an NPC in a level that reads onPlayerKills(player)? I'm not sure you're getting the concept of all of this object orientation, onPlayerKills(player) would be a member of what object? If you're wanting to do that, whenever a player is hit you can store the attacker in a string, and if that player dies then trigger to an NPC to calculate it. Otherwise I'm really not seeing the merit of it.

Okay. You let me try to explain.


The "created" event handler doesn't imply a player object assignment:
PHP Code:

function onCreated() {
  
player.chat "blahdeedaregarfg"//doesn't work because no player was involved in the creating


On the other hand, the "playerenters" event handler does imply a player object assignment:
PHP Code:

function onPlayerEnters() {
  
player.chat "blahdeedaregarfg"//works because the player was involved in the entering


It would make sense for the player that was killing to be assigned to the player object of the event handler for "playerkills." However, it would also make sense to know who was killed, so it would make sense for params[0] to contain the player who died's object reference.

In clientside scripting the player object assignment is always assigned to the only clientside player.

Crono 03-17-2006 11:06 AM

I support Mr.Jake's ideas.

Gamerkid7 01-29-2010 06:36 AM

I would really really like to see this functionality added

I've been having a hassle of a time trying to figure out how to determine when a player kills another player with the default hit system, and this would make things so much easier

coreys 01-29-2010 06:59 AM

...you just revived a 4 year old thread.
Good God, man, look at the timestamps before replying.

Immolate 01-29-2010 02:12 PM

Quote:

Originally Posted by coreys (Post 1552961)
...you just revived a 4 year old thread.
Good God, man, look at the timestamps before replying.

There's nothing wrong with reviving a perfectly good suggestion, which I've needed plenty of times, that has not been added yet.

Admins 01-29-2010 03:40 PM

Hmmm could be interesting especially since we are using the classic hitpoint system on iPhone

Immolate 01-29-2010 04:06 PM

Quote:

Originally Posted by Stefan (Post 1553008)
Hmmm could be interesting especially since we are using the classic hitpoint system on iPhone

It'd also be helpful on Final Star so that I don't have to use a work around, since it's needed for the Kills Leaderboard.

DustyPorViva 01-29-2010 04:11 PM

This is a little disappointing :(
This feature and many others for default have been begged for, for so so long... tracking kills, tracking hits, fixed bombs and arrows, and it only gets a higher priority/interest since iPhone uses it?

Meh, least it's getting done I guess.

Admins 01-29-2010 05:37 PM

Ok with the next update of gserver and npcserver there should be a onPlayerKilled(victim,killer).

Immolate 01-29-2010 05:47 PM

Quote:

Originally Posted by Stefan (Post 1553033)
Ok with the next update of gserver and npcserver there should be a onPlayerKilled(victim,killer).

Niiiice.

DustyPorViva 01-29-2010 05:57 PM

What about a way to detect the last person to hurt the player via default hits(sword, arrows, bombs)?

player.lasthitby? It would actually make the new function for detecting who killed the player fairly redundant.


All times are GMT +2. The time now is 05:43 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.