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 08-27-2001, 09:43 PM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
Question Prevent hurting

Is there any easy way to prevent baddy/player/npc from hurting the player?
__________________
Reply With Quote
  #2  
Old 08-27-2001, 10:04 PM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Um. Make a timeout that continually set's the player's hearts to a certain amount, or set their AP to 100 =P
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #3  
Old 08-27-2001, 10:16 PM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
if (playertouchsme) {toweapons Immortal;
}
if (weaponfired&&!this.on) {set this.on;
setcharprop #c,On.;
}
else
if (weaponfired&&this.on) {unset this.on;
setcharprop #c,Off.
}
while (this.on) {
if (playerhearts<playerfullhearts) {playerhearts=playerfullhearts;}

or something
Reply With Quote
  #4  
Old 08-27-2001, 10:25 PM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
i tested this offline and it worked
PHP Code:
// NPC made by Merlin
if (playertouchsme) {toweapons Invincable;
}
if (
weaponfired&&!this.on) {
set this.on;
setplayerprop #c,On.;
}
else
if (
weaponfired&&this.on) {
unset 
this.on;
setplayerprop #c,Off.;
}
while (
this.on) {
if (
playerhearts<playerfullhearts) {
playerhearts=playerfullhearts;
}

Reply With Quote
  #5  
Old 08-27-2001, 10:47 PM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
I know there's more to getting hit and flying back, but I was wondering if there was a way around it. I wanted to have armor power, sword power, defense power, and attack power, all effect how much damage was done or if the equiped armor would prevent the damage.
__________________
Reply With Quote
  #6  
Old 08-27-2001, 11:30 PM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
Is there anyway to prevent the player from flying back?
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #7  
Old 08-27-2001, 11:32 PM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
Quote:
Originally posted by ownerofbabylon
Is there anyway to prevent the player from flying back?
disableofmovement?
Reply With Quote
  #8  
Old 08-27-2001, 11:33 PM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
would that work well? I mean u would have to disable and re enable pretty fast to be realistic.
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #9  
Old 08-27-2001, 11:38 PM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
if (washit) {disableofmovement;
sleep.5;
enablemovement;
}
there would be trouble of they logged off right after being hit
i think im not really good at scripting ;\
Reply With Quote
  #10  
Old 08-28-2001, 12:01 AM
Guest
Posts: n/a
if (playerhurt) {
playerhearts=playerhearts;
disabledefmovement;
sleep 10000000000000000000000000000000000000;
enabledefmovement;
}
Reply With Quote
  #11  
Old 08-28-2001, 01:39 AM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
Alright so
1. Rescript movement with keydown
2. Script my own damage system.

Thanks Kaimetsu, and to everyone else who helped.
__________________
Reply With Quote
  #12  
Old 08-28-2001, 02:25 AM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
Ugh

I've been trying to rescript movement but it wont work. I do the keydown(0) {playerdir=0;setani walk;y+=.5}
I know I'm doing something wrong, I just can't find it. Any it's no use saying I suck at scripting, I already know that.
__________________
Reply With Quote
  #13  
Old 08-28-2001, 02:41 AM
Guest
Posts: n/a
it will be more like:

NPC Code:

// NPC made by I c e P i c k
if (created || playerenters) {
this.createx=int(x);
this.createy=int(y);
}
if (playertouchsme) {toweapons weaponname;
this.playerhearts=playerhearts;
}
if (weaponfired) {
this.mode = (this.mode+1)%2;
timeout = .05;
}
if (timeout && this.mode==1) {
players[this.id].hearts=this.playerhearts;
timeout = .5;
}

Reply With Quote
  #14  
Old 08-28-2001, 02:50 AM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
That doesnt work, it makes you die every 3 seconds or so.
__________________
Reply With Quote
  #15  
Old 08-28-2001, 03:01 AM
Brady2 Brady2 is offline
Registered User
Brady2's Avatar
Join Date: Mar 2001
Location: Phoenix, AZ and Wichita Falls, TX
Posts: 924
Brady2 is on a distinguished road
Jadis:

XDaKreepX, in his godlike ways, made a weapon to keep the player from being hurt. (Meaning the player was not moved back).
Reply With Quote
  #16  
Old 08-28-2001, 03:26 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
if youre going to make armor then all you simply have to do is check to see if the player got hurt . then you of course need to know his hearts before he got hurt and you would need to compare like if hes got armor it doesnt hurt
here i didnt test this but im just like giving a base

NPC Code:


if (!isweapon&&playerenters&&!hasweapon(-armor)) { toweapons -armor; setstring armor,100;}

if (playerhurt) {
this.armorcheck=strtofloat(#s(armor));
if (this.armorcheck>0) {
playerhearts+=.5;
this.armorcheck=abs(this.armorcheck-5);
setstring armor,#s(this.armorcheck);
}
}



considering that baddies do .5 dmg else u have to set string of the current ammount of the player health then check it over or whatever..
okay bye
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #17  
Old 08-28-2001, 05:38 AM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
I didn't test it but it'll probaly work. Thank alot, by the way. Anyone know if there is a command to check if a player hits another player? Sorta like a playerhitsplayer.
__________________
Reply With Quote
  #18  
Old 08-28-2001, 05:50 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
if (playertouchsanother)
Reply With Quote
  #19  
Old 08-28-2001, 06:07 AM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
Isn't it playertouchother and it's for npc's.

But is there a playertouchanother? and if it was wouldnt it deal with touching and not hitting them?
__________________
Reply With Quote
  #20  
Old 08-28-2001, 07:06 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
if(playerenters) noplayerkilling;
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #21  
Old 08-28-2001, 07:13 AM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
Ha. I need it to detect being hit, fly back, and then lower the player's client.hp string. Dont think nopkzone would help.
__________________
Reply With Quote
  #22  
Old 08-28-2001, 10:32 PM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Quote:
Originally posted by ownerofbabylon
Is there anyway to prevent the player from flying back?
Well, in a script that I once wrote (trashed because it was too buggy), I stored that player's X and Y values.
NPC Code:

if (washit) {
playerhearts=playerfullhearts;
playerx=this.x;
playery=this.y;
setani idle,;
timeout=0.05;
}


Now, you will need a timeout to set the player X and Y.
NPC Code:

if (timeout) {
this.x=playerx;
this.y=playery;
timeout=0.05;
}


Try that.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #23  
Old 08-29-2001, 03:35 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~The Fool~

if (playerhurt){
this.x=playerx;
this.y=playery;
players[0].hearts+=.5;
timeout=.05;
}
if (timeout && strequals(#m,hurt)){
playerx=this.x;
playery=this.y;
timeout=.05;
}


Could that possibly work? o.0
The player will fall backwards just a *tiny* bit (I'm estimating about... .2 or so...), but not much... 0.o
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #24  
Old 08-29-2001, 08:59 AM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
I need the player to fly back, I just want them not to be hurt unless the attacker's weapon power>players defense and armor.
__________________
Reply With Quote
  #25  
Old 08-30-2001, 02:50 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

Well why didn't you say so in the first place!

Anyway, try this...

if (playerenters){
toweapons -blahblah;
setstring armorpower,5;
destroy;
}
if (isweapon){
if (playerhurt){
playerhearts+=.5;
if (strtofloat(#s(armorpower))<Whatever it is you're using as the enemy power here){
playerhearts-=I'll let you do the math here ;
}
}
}

You'll hafta do what's in blue though, since I have no clue what you're using for your enemy strength, and the ratio you want of armor:enemy strength damage o.0
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #26  
Old 08-30-2001, 03:15 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
Like I said, I didn't know what he was using for the enemy strength variable, and what amounts he wanted for the damage. He could want .5 for every 1 over, or 1 for every .5... I'm not a mind-reader Kaimetsu
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #27  
Old 08-30-2001, 03:23 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
*sighs* Now you're wanting me to give him a script he didn't ask for?

Sheesh, do I have amnesia or something? *goes back to read posts*

I believe he said

Quote:
I need the player to fly back, I just want them not to be hurt unless the attacker's weapon power>players defense and armor.
Implying that he already has the hurting script, just lacked the actual "hurt" part of the script.
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #28  
Old 08-30-2001, 03:48 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
I quote again

Quote:
I just want them not to be hurt unless the attacker's weapon power>players defense and armor.
I don't see "I just want to transfer the enemies strength to the player, and I want them not to be..."

In there... sure, it is the hardest part.

Really the only section he could be talking about? Now you know exactly what he was thinking when he asked that question?

Step right up, one and all! The amazing Kaimetsu will astound and amaze by reading your mind!
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #29  
Old 08-30-2001, 04:04 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
Alright Kaimetsu, since I don't have the braincells to...


YOU do it.

*giggles like a school girl and runs off* Mwaha

[edit]
Oh, by the way... you're a fun person to argue with Kaimetsu
[/edit]
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #30  
Old 08-30-2001, 04:21 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
Bad Script Monkey, arguing with people about helping somebody then not helping them yourself and saving about 10 posts worth of space... tsk tsk... mwehe
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #31  
Old 08-30-2001, 04:24 AM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
Kaimetsu does read minds ! I wanted to know how to detect the other players attacking power. I stated it in another post. Thanks for trying to help Adrenaline, but I already had that part of the script working perfectly.
__________________
Reply With Quote
  #32  
Old 08-30-2001, 04:37 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
I see an ego swelling
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #33  
Old 08-30-2001, 04:37 AM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
Quote:
Originally posted by Kaimetsu


And thus, I win.
No need for gloating/bragging/stating the obvious.

Adren:I find it very nice of you to try to help me, given are past history wasnt too...friendly.
__________________
Reply With Quote
  #34  
Old 08-30-2001, 04:50 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
Beating down your adverseries? Scripting is about SCRIPTING! =/

And plus, what does it hurt to help somebody?

... or are you just scared somebody might become better than you?
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #35  
Old 08-30-2001, 04:50 AM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
Gloating is fun, but it can get you in some pretty nasty situa-ma-ations.
__________________
Reply With Quote
  #36  
Old 08-30-2001, 08:16 PM
oscarjf1 oscarjf1 is offline
Registered User
Join Date: Aug 2001
Location: I live in the US
Posts: 107
oscarjf1 is on a distinguished road
Send a message via AIM to oscarjf1
Cool .....

I think I'm a pretty good scripter myself. I dont go around bragging "Im the best, Youre a n00b cause you need help" because i need help with some stuff too. Some people are better at some things than others. Like myself, Im kinda new with arrays, so i asked for help with them. It doesnt mean that i couldnt complete the script i was working on, to be just as good as someone elses script, but i wanted to try a new angle of approach to it. Im sure even you have to ask for help from time to time...and people dont call you a newb scripter, do they? Its just like anything else, the more practice you have at it, the better you are. If someone needs help, I try to help them.... if i know how. If i dont...i will say i dont, or just not post.

Anyway...I posted on page 2 of this... or maybe even 1, and didnt bother to read the following pages until the last, because it takes too damn long, so if im off topic, just disreguard my post, lol.
__________________
I speek on behalf of my staff.
~laterz

Lagoonia Staff
-Tiki God Of Power
Reply With Quote
  #37  
Old 08-31-2001, 12:57 AM
oscarjf1 oscarjf1 is offline
Registered User
Join Date: Aug 2001
Location: I live in the US
Posts: 107
oscarjf1 is on a distinguished road
Send a message via AIM to oscarjf1
true, true

Youre right. But rubbing it in people's faces just makes them mad
__________________
I speek on behalf of my staff.
~laterz

Lagoonia Staff
-Tiki God Of Power
Reply With Quote
  #38  
Old 08-31-2001, 05:38 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
Quote:
Anybody who could ever get better than me wouldn't come here asking the stupid newbie questions that they do.
I'm seeing a big ego again... surely you had to ask a question or two when you started scripting?

Sheesh, just like learnin the alphabet for the first time, people new to scripting have to learn someplace...
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
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 03:10 PM.


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