Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-17-2005, 11:11 PM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
Question custom kills system

How would I script a custom kills system? I can't find a way to check if the player you attack dies. Any ideas?
Reply With Quote
  #2  
Old 08-17-2005, 11:14 PM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
Why not just use the built in playerkills/playerdeaths vars? They can be edited via script.
__________________

Current Maloria Event: (click to go to it)
Reply With Quote
  #3  
Old 08-17-2005, 11:19 PM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
On Galactic Nations we use custom weapons. The deaths register but the kills don't. I'm trying to find a way to fix that.
Reply With Quote
  #4  
Old 08-18-2005, 01:20 AM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
Classic uses a totally custom hit detection/killing system that emulates the built in stuff. We do ours by doing hit detection via the server, thus the server handles when ach player is hit, and as a result, when they die or kill someone.
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #5  
Old 08-18-2005, 06:21 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
If you follow Stefan's suggestions for a hitpoint system, you could (would) just code it into your hpfunctions class when the player's hurt.
Reply With Quote
  #6  
Old 08-20-2005, 08:51 PM
Sacred Shadow Sacred Shadow is offline
Developer
Join Date: Dec 2004
Posts: 129
Sacred Shadow is on a distinguished road
If the player hp'sstring is: client.playerhp this would work.
if (actionserverside) {
if (strequals(#p(0),stats)) {
setstring clientr.deaths,#v(strtofloat(#s(clientr.deaths)) + 1);
with(getplayer(#p(1))) {
setstring clientr.kills,#v(strtofloat(#s(clientr.kills)) + 1);
}
}
}
//#CLIENTSIDE
if (actionWEAPONACTION) {
if (strtofloat(#s(client.playerhp)) == 0) {
triggeraction 0,0,serverside,WEAPON-NAME,stats,#p(1),;
}
}

so the weapon trigger should be something like this:
triggeraction playerx + 1.5 + vecx(playerdir)*2,playery + 1.5 + vecy(playerdir)*2,WEAPONACTION,#a;
when the weapon is fired. I'm not possitive this will work, and I didn't test it offline.
Reply With Quote
  #7  
Old 08-20-2005, 10:18 PM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
It works. Thanks .
Reply With Quote
  #8  
Old 08-21-2005, 04:33 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally Posted by Sacred Shadow
stuff.
It is not advisable to do it that way... as Lance said, Stefan's way (doing it serverside with the hpfunctions class, etc) is the best and your way can be insecure depending on how one would impliment it
Reply With Quote
  #9  
Old 08-21-2005, 04:50 AM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
Quote:
Originally Posted by Python523
It is not advisable to do it that way... as Lance said, Stefan's way (doing it serverside with the hpfunctions class, etc) is the best and your way can be insecure depending on how one would impliment it
How would it be insecure?
Reply With Quote
  #10  
Old 08-21-2005, 04:53 AM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Because anything on the clientside can be edited with memory editing programs. Including the triggeraction parameters. You have to do it serverside.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #11  
Old 08-21-2005, 05:00 AM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
Quote:
Originally Posted by konidias
Because anything on the clientside can be edited with memory editing programs. Including the triggeraction parameters. You have to do it serverside.
That's not a good enough reason not to do it that way. If scripts that use clientside are insecure then how am I supposed to make a secure server? It's not possible because most scripts need clientside to work so why worry about this one script? Anyone else have a reason?
Reply With Quote
  #12  
Old 08-21-2005, 05:12 AM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
You're a fool if you think that it's not important to have a serverside damage system. Important things like damage to players, dealing with items, and dealing with stats all need to be serverside. If this concept is too hard for you to grasp, then give up and stop asking stupid questions.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #13  
Old 08-21-2005, 06:58 AM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
Quote:
Originally Posted by konidias
You're a fool if you think that it's not important to have a serverside damage system. Important things like damage to players, dealing with items, and dealing with stats all need to be serverside. If this concept is too hard for you to grasp, then give up and stop asking stupid questions.
Instead of telling me I'm wrong, try helping. The only way I can think of is to have some of the script clientsided and use triggeraction. If thats too insecure then tell me how I could do it serverside.
Reply With Quote
  #14  
Old 08-21-2005, 09:03 AM
ForgottenLegacy ForgottenLegacy is offline
-Backtoscripts-
Join Date: Aug 2003
Location: California
Posts: 289
ForgottenLegacy is on a distinguished road
Send a message via AIM to ForgottenLegacy
Quote:
Originally Posted by konidias
You're a fool if you think that it's not important to have a serverside damage system. Important things like damage to players, dealing with items, and dealing with stats all need to be serverside. If this concept is too hard for you to grasp, then give up and stop asking stupid questions.
Konidas, instead of insulting the poor fellow, offer him some advice such as why you think it's important and don't cut his ego down to size. Pretty much, that's what scripters ride on--their ego. So yeah. Offer some help instead of cutting him to shreds?

And I honestly do think a damage system, by someone who knows EXACTLY what their doing, can be done mostly clientside aside from the setting the strings and vars for the other player, but even then, this can be a trigger to the other player and done serverside. o-o Thousands of ways to script one thing, all of them are right, not all of them are efficient. Depends on the scripter and the use.
__________________
"The higher you fly, the harder it is to breathe."

[Kaidenn] Maybe I will somehow take control of Lance's body when he isn't looking, have him log onto Kingdoms, update one script, and leave.
[Kaidenn] And leave him exactly where I found him, unchanged and completely unnaware of what just took place the last two minutes.
[GrowlZ] Lance: You might want to lock your bedroom door tonight
Reply With Quote
  #15  
Old 08-21-2005, 01:33 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by konidias
Because anything on the clientside can be edited with memory editing programs. Including the triggeraction parameters. You have to do it serverside.
That's more then enough advice for him to change it.

What more can you say to help him understand it?
__________________
Reply With Quote
  #16  
Old 08-21-2005, 03:56 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Quote:
Originally Posted by raiden0899
Instead of telling me I'm wrong, try helping. The only way I can think of is to have some of the script clientsided and use triggeraction. If thats too insecure then tell me how I could do it serverside.
Instead of telling me that isn't a good enough reason, like you are the all knowing scripter, maybe you should have asked me why it's a good enough reason.

Everything doesn't have to be serverside, just the important stuff. Stuff like a GUI is going to be clientside, but it should be reading from clientr variables for the stats it displays.

If you're going to have weapons that do various damage, you can't have those damages set as parameters in the triggeraction. You have to detect what type of attack it is serverside. Otherwise a cheater could edit the damage value of the clientside damage trigger to make the weapon more powerful.

You should also never use client. strings for storing important data. You HAVE to use clientr., the r being "read only" which means the client can only read a clientr string, but cannot edit it.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #17  
Old 08-21-2005, 05:59 PM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
I said it wasn't a good enough reason because most scripts need clientside. No script with clientside is going to be 100% secure. If I can't use triggeraction in this script because it's too insecure what should I use? I never said I was an all knowing scripter. I just don't see any other way to do it. Maybe if you told me what you would do we could make some progress here.
Reply With Quote
  #18  
Old 08-21-2005, 08:42 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
I would use a system similar to what Stefan has posted. I think you're confused about what I mean involving clientside being unsafe...

I realize a lot of scripts need to be clientside. But those scripts are not going to affect other players. Sure, someone could use a memory editing program to change their GUI display, or change some signs and stuff, but they should not be able to change important variables like weapon damage and health and stuff. That's all I'm saying. Obviously you can't script EVERYTHING serverside. Only the stuff that is important.

In fact, if you come across a situation where something NEEDS to be serverside and you can't figure out how to make it serverside, you should STILL figure out how to do it serverside, because resorting to clientside is not an option if you care about your server.

But by all means, you can script it all clientside and then deal with hackers ruining your server in a matter of days.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #19  
Old 08-21-2005, 09:07 PM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
I just finished the script and the only triggeraction parameter I used was #a. The rest of the script (calculating the damage, hurting the player, and changing kills/deaths) is serverside.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 11:34 PM.


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