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 01-21-2005, 01:50 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Player Detection

Anyone else notice that ...

NPC Code:

for(this.p=0;this.p<playerscount;this.p++) {
if (mousex in |players[this.p].x,players[this.p].x+3| && mousey in |players[this.p].y,players[this.p].y+3|) {



...is also triggered when you click on npcs?
__________________

Reply With Quote
  #2  
Old 01-21-2005, 01:51 PM
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
showcharacter npcs are contained in the clientside players array
Reply With Quote
  #3  
Old 01-21-2005, 02:09 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
i kinda figured , but shouldn't this be changed
__________________

Reply With Quote
  #4  
Old 01-21-2005, 02:13 PM
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
You can easily distinguish between the 2 by seeing if the acct name is blank or not... I dunno... I like being able to find showcharacter npcs
__________________
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 01-21-2005, 02:24 PM
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
Quote:
Originally Posted by ZeroTrack
i kinda figured , but shouldn't this be changed
I don't know. Should it?
Reply With Quote
  #6  
Old 01-21-2005, 03:03 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
i think so , i mean yea its easy to get around but have charater npcs and players in the same array is kind of limiting no?
__________________

Reply With Quote
  #7  
Old 01-21-2005, 07:52 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
if (strlen(#a(i))>0) {
script
}
Reply With Quote
  #8  
Old 01-21-2005, 08:44 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
or add to the if flag
NPC Code:

if (mousex in |players[this.p].x,players[this.p].x+3| && mousey in |players[this.p].y,players[this.p].y+3|&&players.[this.p].id>-1)


__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #9  
Old 01-22-2005, 12:06 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
Quote:
Originally Posted by ZeroTrack
i think so , i mean yea its easy to get around but have charater npcs and players in the same array is kind of limiting no?
How is it limiting if it has more potential?
Reply With Quote
  #10  
Old 01-22-2005, 12:22 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
more potential? how so?
__________________

Reply With Quote
  #11  
Old 01-22-2005, 12:26 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
Quote:
Originally Posted by ZeroTrack
more potential? how so?
Because in addition to being able to access the players, you also are able to access the showcharacter NPCs? More is not less, man, especially when it's trivial to figure out whether you're dealing with a player or an NPC.
Reply With Quote
  #12  
Old 01-22-2005, 12:58 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
i just assumed accessing players and charater npc's should be in seperate arrays to make the array shorter for both this way it would know what array to access this way it wouldnt get players confused with charater npcs, considering there non player charaters
__________________

Reply With Quote
  #13  
Old 01-22-2005, 01:04 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Just add what I said, showcharacter npcs have an id of -1.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #14  
Old 01-22-2005, 01:08 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by falco10291029
Just add what I said, showcharacter npcs have an id of -1.
read up please, i know how to get rid of it , this thread wasn't started as a "help im stuck i can't figure that npcs dont have ids or accountnames" its more of a why is this post being a programer im addicted to asking why =p, thank you for your concern just the same though
__________________

Reply With Quote
  #15  
Old 01-22-2005, 01:30 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Hehe, the reason is because there's no reaosn to add a second command when a simple flag can be added
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #16  
Old 01-22-2005, 01:47 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
it wouldnt be a second command =/ the arrays are built in
__________________

Reply With Quote
  #17  
Old 01-22-2005, 02:49 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
bah you know what I mean. And if you dont I dunno how you learned to script
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #18  
Old 01-22-2005, 03:06 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by falco10291029
And if you dont I dunno how you learned to script
He learned to script from me yelling at him on Bravo.
Reply With Quote
  #19  
Old 01-22-2005, 03:15 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
That explains it....I mean....that explains it...wait....
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #20  
Old 01-22-2005, 03:59 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Slash-P2P
He learned to script from me yelling at him on Bravo.
haha sorry to burst your bubble i started scripting on Delpheria, and if you dont know that server you cant talk ish =p(yes slash i've been scripting longer than you =p) , btw how does using correct terminology constitue me not knowing howto script? and how long have u been scripting falco cause if you look back 2 months in forums you were posting seriously nub posts
__________________

Reply With Quote
  #21  
Old 01-22-2005, 04:25 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
I have been scripting for about....2 months

EDIT: Actually it's probably more like 4.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #22  
Old 01-22-2005, 05:05 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
Quote:
Originally Posted by falco10291029
bah you know what I mean. And if you dont I dunno how you learned to script
Quote:
Originally Posted by falco10291029
Hehe, the reason is because there's no reaosn to add a second command when a simple flag can be added
"There's no reason to add a second array when a simple variable can be compared."

There is a big difference between the two statements.

Also: using incorrect terminology especially when knowing better is considered giving bad advice. Don't expect every visitor to this forum to understand that you meant something vastly different from what you said.
Reply With Quote
  #23  
Old 01-22-2005, 05:13 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
OK sorry I forgot noobs looked at it too, I'll be good
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #24  
Old 01-22-2005, 05:54 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by ZeroTrack
haha sorry to burst your bubble i started scripting on Delpheria, and if you dont know that server you cant talk ish =p(yes slash i've been scripting longer than you =p) ,
I did encourage you to script though .
I started scripting on Frolic when I was like 11. So thats like 4 years ago.

So what if you've scripted longer...Mr. sern_oldbie.
I rock and you're jealous.
Reply With Quote
  #25  
Old 01-22-2005, 06:21 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Slash-P2P
So what if you've scripted longer...Mr. sern_oldbie.
I rock and you're jealous.
my first account ever was sernone1
others are (in order) sern_oldbie,Ethic_Sern,SernOne,ZeroTrack,Sern(i just got this one 4 days ago) =p

so yea you wish you did lol the person who inspried me was Saban cause i wanted a job there and i didnt know howto script yet so he said learn so i started reading all the noob bibles when they were still on the main site and all the npc docs in the graal folder =p
__________________

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 12:26 AM.


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