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-24-2003, 09:48 AM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
player[index].darts player[index].bombs

what is index? It used to be like playerdarts and playerbombs that held arrow and bomb count. Whats the new way?
Reply With Quote
  #2  
Old 08-24-2003, 10:00 AM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
it's another way of naming the players?
each player has an index in a level...

it's like the index of showimg. it's just another way of singleling out one thing from another...

NPC Code:

// -- This will grab each player IN the
// -- current level of the NPC and warp them to 30,30;
for(i=0; i<playerscount; i++) {
player[i].x = 30;
player[i].y = 30;
}



^It grabs the player by index, and not account name or anything like that.

I don't know how to explain it :-p.
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #3  
Old 08-24-2003, 11:27 AM
Snakeandy7 Snakeandy7 is offline
"Member ID=2610"
Snakeandy7's Avatar
Join Date: Mar 2003
Posts: 987
Snakeandy7 is on a distinguished road
because he used
for (i=0; i<playerscount; i++){..}
since it begin's with i i'm thinking the index must be i?
__________________
"Freedom is best I tell thee
of all things to be won
then never live within the bond
of slavery my son".


Reply With Quote
  #4  
Old 08-24-2003, 12:06 PM
Thought Thought is offline
PipBoy Extraordinaire!
Thought's Avatar
Join Date: Nov 2001
Location: Long Beach, California.
Posts: 692
Thought is on a distinguished road
Think of it this way, players is a list, let's say it currently looks like this:

NPC Code:
GuyA
GalB
GuyC
GalD



GuyA is position 0, GalB is position 1, and so on.

eg:

NPC Code:
0: GuyA
1: GalB
2: GuyC
3: GalD



An index essentially the position in the list. (Usually -1 since most lists start from a 0 based index, as does Graal)
__________________
Rick ([email protected])
#gscript on FreeNode (#gscript Guild, #gscript Information)
Graal User Statistics

I am now using my new account, Rick.
Reply With Quote
  #5  
Old 08-24-2003, 12:26 PM
Snakeandy7 Snakeandy7 is offline
"Member ID=2610"
Snakeandy7's Avatar
Join Date: Mar 2003
Posts: 987
Snakeandy7 is on a distinguished road
Quote:
Originally posted by Thought
Think of it this way, players is a list, let's say it currently looks like this:

NPC Code:
GuyA
GalB
GuyC
GalD



GuyA is position 0, GalB is position 1, and so on.

eg:

NPC Code:
0: GuyA
1: GalB
2: GuyC
3: GalD



An index essentially the position in the list. (Usually -1 since most lists start from a 0 based index, as does Graal)
Thats quite hard to understand, but i under stood it
__________________
"Freedom is best I tell thee
of all things to be won
then never live within the bond
of slavery my son".


Reply With Quote
  #6  
Old 08-24-2003, 03:18 PM
Benm00t Benm00t is offline
I made a tree!
Benm00t's Avatar
Join Date: Jul 2003
Location: The Intarwebbernetwork!
Posts: 987
Benm00t is on a distinguished road
how would you get the indea of just one person though? If you have their account name that is.
Reply With Quote
  #7  
Old 08-24-2003, 03:35 PM
Snakeandy7 Snakeandy7 is offline
"Member ID=2610"
Snakeandy7's Avatar
Join Date: Mar 2003
Posts: 987
Snakeandy7 is on a distinguished road
Quote:
Originally posted by Benm00t
how would you get the indea of just one person though? If you have their account name that is.
You mean

with(getplayer(account)){
}

?!
__________________
"Freedom is best I tell thee
of all things to be won
then never live within the bond
of slavery my son".


Reply With Quote
  #8  
Old 08-24-2003, 03:39 PM
Benm00t Benm00t is offline
I made a tree!
Benm00t's Avatar
Join Date: Jul 2003
Location: The Intarwebbernetwork!
Posts: 987
Benm00t is on a distinguished road
err... i guess so lol.
Reply With Quote
  #9  
Old 08-24-2003, 07:37 PM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by Benm00t
how would you get the indea of just one person though? If you have their account name that is.
A for loop scanning #a(index) would do what you ask.
__________________
Kat
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 09:38 AM.


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