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
  #1  
Old 12-23-2001, 11:04 PM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
A tip for you all

Instead of using real hardcoded death in your health systems, use the following in your timeout:

if(playerhearts<playerfullhearts){
playerhearts=playerfullhearts;
hitpoints--;
if(hitpoints<1){
disabledefmovement;
setani dead;
sleep 5;
setani idle;
enabledefmovement;
}
}
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #2  
Old 12-23-2001, 11:07 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Using variables for such things wouldn't work, since those aren't stored after the player has logged off of the server.
And if (playerhurt) is more effective then playerhearts<playerfullhearts.
__________________

Reply With Quote
  #3  
Old 12-24-2001, 01:33 AM
mikepg mikepg is offline
Registered User
Join Date: Nov 2001
Location: VA, USA
Posts: 501
mikepg is on a distinguished road
Send a message via AIM to mikepg Send a message via Yahoo to mikepg
hmm, another thing wrong with that script, it would hurt the player the same if the pker was using a sword or an axe.

you'd have to do something along the lines of
NPC Code:

if (playerhearts<playerfullhearts||playerhurt) {
this.hptake=playerfullhearts-playerhearts;
this.hp=strtofloat(#s(client.hp));
this.hp-=this.hptake;
setstring client.hp,#v(this.hp);

if (strtofloat(#s(client.hp))<=0) {
<dying stuff here>
}
}


that should work, but a lot of the time its more efficient if you have things like that in a timeout loop.
__________________
~War Lord Mpg2
Bravo Online's Asst. Staff Manager

"Sittin by the tree, sippin eggnog, waitin on christmas gifts"
Reply With Quote
  #4  
Old 12-24-2001, 02:00 AM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
Oh...yeah, but the exact script wasn't my point. My point was that using disabledefmovement and setani make death work better.
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #5  
Old 12-24-2001, 04:27 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
It is possible to make something like that but why wouldnt you just use the hard coded flags?
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 11:36 PM.


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