Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Player Detection (https://forums.graalonline.com/forums/showthread.php?t=57205)

ZeroTrack 01-21-2005 01:50 PM

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?

Lance 01-21-2005 01:51 PM

showcharacter npcs are contained in the clientside players array

ZeroTrack 01-21-2005 02:09 PM

i kinda figured , but shouldn't this be changed

Polo 01-21-2005 02:13 PM

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 :)

Lance 01-21-2005 02:24 PM

Quote:

Originally Posted by ZeroTrack
i kinda figured , but shouldn't this be changed

I don't know. Should it?

ZeroTrack 01-21-2005 03:03 PM

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?

Slash-P2P 01-21-2005 07:52 PM

if (strlen(#a(i))>0) {
script
}

falco10291029 01-21-2005 08:44 PM

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)



Lance 01-22-2005 12:06 AM

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?

ZeroTrack 01-22-2005 12:22 AM

more potential? how so?

Lance 01-22-2005 12:26 AM

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.

ZeroTrack 01-22-2005 12:58 AM

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

falco10291029 01-22-2005 01:04 AM

Just add what I said, showcharacter npcs have an id of -1.

ZeroTrack 01-22-2005 01:08 AM

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

falco10291029 01-22-2005 01:30 AM

Hehe, the reason is because there's no reaosn to add a second command when a simple flag can be added ;)

ZeroTrack 01-22-2005 01:47 AM

it wouldnt be a second command =/ the arrays are built in

falco10291029 01-22-2005 02:49 AM

bah you know what I mean. And if you dont I dunno how you learned to script ;)

Slash-P2P 01-22-2005 03:06 AM

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.

falco10291029 01-22-2005 03:15 AM

That explains it....I mean....that explains it...wait....

ZeroTrack 01-22-2005 03:59 AM

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 :)

falco10291029 01-22-2005 04:25 AM

I have been scripting for about....2 months ;)

EDIT: Actually it's probably more like 4.

Lance 01-22-2005 05:05 AM

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.

falco10291029 01-22-2005 05:13 AM

OK sorry I forgot noobs looked at it too, I'll be good :(

Slash-P2P 01-22-2005 05:54 AM

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.

ZeroTrack 01-22-2005 06:21 PM

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


All times are GMT +2. The time now is 01:32 AM.

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