Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 09-16-2009, 07:27 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
How do you check to see if the players kills increased? That would be sufficient for what Im doing possibly.

Also, stefan, adding an even for that would probably be very very helpful to the entire graal community.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #17  
Old 09-16-2009, 07:38 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Stefan View Post
Theoretically we could add an event for it, something like onPlayerKilled or so. Right now the only way to detect would be to check if the kills increased, although that doesn't tell you who killed who.
It'd be better to pass who has last hit the player(though I'm not objecting to passing also who last killed the player).
Reply With Quote
  #18  
Old 09-16-2009, 07:42 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
I would personally think if you were looking for who killed a player, better to pass through who killed it, rather than checking the hit each time to see if the player died.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #19  
Old 09-16-2009, 07:48 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by sssssssssss View Post
I would personally think if you were looking for who killed a player, better to pass through who killed it, rather than checking the hit each time to see if the player died.
But sometimes it'd be nice to check who hit a player. Therefor, you can kill two birds with one stone by checking when the player dies who last killed them(which undoubtfully would be the last player who hit them). Like I said though, I wouldn't be against both. Default needs more support like this.
Reply With Quote
  #20  
Old 09-16-2009, 09:13 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Quote:
Originally Posted by sssssssssss View Post
How do you check to see if the players kills increased? That would be sufficient for what Im doing possibly.

anyone?
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #21  
Old 09-16-2009, 09:26 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by sssssssssss View Post
anyone?
Loop?
Reply With Quote
  #22  
Old 09-16-2009, 11:19 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
It's not hard to detect who you were killed by if your bow and bomb (unless you use putbomb) have custom scripts for compatibility with gmaps.

I'd imagine if you had a function to find the closest player with the sword animation within range when you the player dies, that would pretty much pinpoint the killer, but it's not a perfect detection method and could produce false positives.

I.e:

PHP Code:
//#CLIENTSIDE
function onPlayerDies() {
  
// Find closest player with sword animation
  // Other Script..

__________________
Quote:
Reply With Quote
  #23  
Old 09-17-2009, 01:45 AM
Deeek Deeek is offline
o_O
Deeek's Avatar
Join Date: Jul 2008
Location: Freeburg, Missouri
Posts: 167
Deeek will become famous soon enough
Does onWasH!t() return any useful parameters?
Edit: WOW, censorship FTL
__________________
God grant me the serenity to accept the things I cannot change, the courage to change the things I can... and the wisdom to know the difference.

Last edited by Deeek; 09-17-2009 at 01:46 AM.. Reason: WOW, censorship FTL
Reply With Quote
  #24  
Old 09-17-2009, 09:45 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
For playerhurt, does this still apply in gs2?

Quote:
when the player is hurt then you can detect that in
scripts by doing if (playerhurt) ...
you can read the variable playerhurtpower to get
the amount of power that the player lost


new npc script variables playerhurtdx and playerhurtdy when the
player is hurt (otherwise they are 0)
Because if so, you could use a simple code in the weapon every single player has that reads if the player gets hurt and player.hearts==0, or use onPlayerDies(), then go to a
Quote:
findnearestplayer(float1, float2)
since the person who hurt the player SHOULD be closest.

Would that work? Am I correct? Or is my logic wrong?
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #25  
Old 09-17-2009, 02:31 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by sssssssssss View Post
since the person who hurt the player SHOULD be closest.

Would that work? Am I correct? Or is my logic wrong?
What if you get killed over range or if you are grouped by several players? (:
__________________
Reply With Quote
  #26  
Old 09-17-2009, 04:14 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Ok, well again I ask if anyone knows how to see if the players kils increase? Wouldn't even know what variable to use for that.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #27  
Old 09-17-2009, 06:02 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
Quote:
Originally Posted by sssssssssss View Post
Ok, well again I ask if anyone knows how to see if the players kils increase? Wouldn't even know what variable to use for that.
player.kills

you could shove it in a timeout in the clientside and send a triggeraction to the server whenever it increases, but it seems messy and likely to fail to me.
Reply With Quote
  #28  
Old 09-19-2009, 02:46 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
onPlayerDies() is only clientside correct? or can it be serverside?
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #29  
Old 09-19-2009, 03:05 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by sssssssssss View Post
onPlayerDies() is only clientside correct? or can it be serverside?
Try it and find out :P
__________________
Quote:
Reply With Quote
  #30  
Old 09-19-2009, 05:59 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
detects clientside
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:26 PM.


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