Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   need help (https://forums.graalonline.com/forums/showthread.php?t=47548)

bashjgovers 08-29-2003 01:01 AM

need help
 
how do i make this:

someone touchs a NPC:
all player in room get a message;
all players in room will be warped to X,Y;

Neoreno 08-29-2003 01:06 AM

Read the forum rules. Don't ask for full scripts.

Knuckles 08-29-2003 02:09 AM

Re: need help
 
Quote:

Originally posted by bashjgovers
how do i make this:

someone touchs a NPC:
all player in room get a message;
all players in room will be warped to X,Y;

I'm assuming this is for an event type of thing?

All I can say is... learn the basics of scripting, and the correct syntax, and then try. It'll be easier then you would image.


Look into:
playertouchsme
for loops
playerx, playery
with
getplayer

And try figureing it out yourself.

Quote:

Read the forum rules. Don't ask for full scripts.
He wasnt asking for the script, I don't think... 'cause he said "HOW do I make this".

Riot-Starter 08-29-2003 03:07 AM

Re: Re: need help
 
Quote:

Originally posted by Knuckles

I'm assuming this is for an event type of thing?

All I can say is... learn the basics of scripting, and the correct syntax, and then try. It'll be easier then you would image.


Look into:
playertouchsme
for loops
playerx, playery
with
getplayer

And try figureing it out yourself.

getplayer wouldn't really be needed for this.
playertouchsme
for()
with()
playerx/y
players[index]

protagonist 08-29-2003 05:11 AM

Re: need help
 
Quote:

Originally posted by bashjgovers
how do i make this:

someone touchs a NPC:
all player in room get a message;
all players in room will be warped to X,Y;

What kind of message?

Python523 08-29-2003 05:13 AM

Re: Re: Re: need help
 
Quote:

Originally posted by Riot-Starter

getplayer wouldn't really be needed for this.

some people do getplayer(#a(index))
instead ofplayers[index]

Riot-Starter 08-29-2003 06:06 AM

Re: Re: Re: Re: need help
 
Quote:

Originally posted by Python523


some people do getplayer(#a(index))
instead ofplayers[index]

Hence the "wouldn't really be needed"

Knuckles 08-29-2003 10:34 AM

Re: Re: Re: Re: Re: need help
 
Quote:

Originally posted by Riot-Starter


Hence the "wouldn't really be needed"

I can say the same for your command. o.o

Kaimetsu 08-29-2003 10:42 AM

Re: Re: Re: Re: Re: Re: need help
 
Quote:

Originally posted by Knuckles

I can say the same for your command. o.o

Which? The only thing he recommended that wasn't on your list was players[], which isn't a command and is the simplest, most efficient approach to the situation.

Python523 08-29-2003 03:44 PM

Re: Re: Re: Re: Re: Re: Re: need help
 
Quote:

Originally posted by Kaimetsu


Which? The only thing he recommended that wasn't on your list was players[], which isn't a command and is the simplest, most efficient approach to the situation.

hmm...could be true or couldn't be true, either way the serverside NPC still has to load the player's attribs and make them writeable, I guess it really depends on if it was coded the same way or not, and depends on is the index is converted into an account or not (which is unlikely but yea)

osrs 08-29-2003 05:17 PM

Re: Re: need help
 
Quote:

Originally posted by protagonist


What kind of message?

Probably say2.

bashjgovers 08-29-2003 07:44 PM

yep its for a event

(sorry it wasnt aksing for a script but i need some help :)


i scripted that if someone touchs the NPC a flag will be set, but thats only for the person who touchs the npc isnt it?

protagonist 08-29-2003 11:35 PM

Re: Re: Re: need help
 
Quote:

Originally posted by osrs


Probably say2.

Ah, I thought he might have meant something like sendpm.

Kaimetsu 08-30-2003 05:20 AM

Re: Re: Re: Re: Re: Re: Re: Re: need help
 
Quote:

Originally posted by Python523
hmm...could be true or couldn't be true, either way the serverside NPC still has to load the player's attribs and make them writeable
Assuming it doesn't have them loaded at all times. getplayer has to search through every player on the server. Using player[] just skips that step.

Python523 08-30-2003 05:58 AM

Re: Re: Re: Re: Re: Re: Re: Re: Re: need help
 
Quote:

Originally posted by Kaimetsu


Assuming it doesn't have them loaded at all times. getplayer has to search through every player on the server. Using player[] just skips that step.

Well, I'm assuming there is some 'list' of all the players online, getplayer pulls the players row (as in from a MySQL db) out of that list, which contains all his attribs. Using players[] probably does the same but level based instead of searching through all the accounts, since you can't access all the player's attribs without using a with function thing, get what I'm saying? I could be wrong about my opinion on what it does, if your opinion is different please tell yours :)

Kaimetsu 08-30-2003 06:16 AM

Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: need help
 
Quote:

Originally posted by Python523
Well, I'm assuming there is some 'list' of all the players online, getplayer pulls the players row (as in from a MySQL db) out of that list, which contains all his attribs.
Yes, but it can't just magically grab that element. It needs to search for it based on string comparisons.

Quote:

Using players[] probably does the same but level based instead of searching through all the accounts
There's no searching at all in such a case; the player[] structure is specified explicitly.


All times are GMT +2. The time now is 10:06 AM.

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