Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Index???!!! (https://forums.graalonline.com/forums/showthread.php?t=14787)

Bhala 10-17-2001 05:44 AM

Index???!!!
 
Ok Ok I need to know how to get the right index for things... If I knew how to do that then i would know how to do a bunch of other things

Metal-Slug 10-17-2001 05:59 AM

it is set like this.index or whatever, i think, also, Bhala, i want to start a guild, but it no let me :(

SSRobgeta 10-17-2001 07:33 AM

Quote:

Originally posted by Metal-Slug
it is set like this.index or whatever, i think, also, Bhala, i want to start a guild, but it no let me :(
WHAT?!?!:confused:

Xaviar 10-20-2001 02:34 AM

I hope Kai gets his acount re-upgraded soon ;)

Jerom 10-20-2001 03:53 AM

Quote:

Originally posted by Xaviar
I hope Kai gets his acount re-upgraded soon ;)
Kaimetsu lost his account :(
Well why the heck doesn't anyone let him use their account?

KJS 10-20-2001 04:12 AM

Re: Index???!!!
 
Quote:

Originally posted by Bhala
Ok Ok I need to know how to get the right index for things... If I knew how to do that then i would know how to do a bunch of other things
well there is commands for finding the index of the current thing (like the current npc that is doing the script)...

otherwise usually people do like loops to effect like all the npcs/players..

or you can do like vars with npcs like level.blah = blah

and make it equil the other npcs index...

humm I think I am sounding kinda confuzing but I hope you understand me

btedji 10-20-2001 04:20 AM

there is no image[index].x type commands yet

Xaviar 10-20-2001 06:02 AM

Quote:

Originally posted by btedji
there is no image[index].x type commands yet
What would be neato would be if we could
players[index].nonsystemvarname = 10;
cause that would simplify alot of things :D

btedji 10-20-2001 08:37 AM

Quote:

Originally posted by Xaviar


What would be neato would be if we could
players[index].nonsystemvarname = 10;
cause that would simplify alot of things :D

or better yet players[id].varname

that would be sooooo cool

Shard_IceFire 10-20-2001 08:43 AM

Quote:

Originally posted by btedji


or better yet players[id].varname

that would be sooooo cool

Um...
uh...
...
...




Ok.

btedji 10-20-2001 08:46 AM

Quote:

Originally posted by Shard_IceFire

Um...
uh...
...
...




Ok.

then it would be soooo much easier to get other player data

Thak2 10-20-2001 09:25 AM

Doesn't testnpc, and testplayer, and the other test commands return the value of the index?

KJS 10-20-2001 10:32 AM

Quote:

Originally posted by Thak2
Doesn't testnpc, and testplayer, and the other test commands return the value of the index?
that works if you know the x and y of the npc

ownerofbabylon 10-20-2001 11:28 AM

what is [id] for?

Xaviar 10-20-2001 08:32 PM

Quote:

Originally posted by ownerofbabylon
what is [id] for?
If I'm not mistaken, theres no difference between id, and index..But because of the way he said it, I'm not quite sure...

ownerofbabylon 10-20-2001 08:40 PM

im just wondering what id and index are used for. I have a basic idea but arent there like special ones for special NPCs? like 0 is the current NPC and in some command if its over like 250 then something is different... :(

Xaviar 10-20-2001 08:43 PM

Quote:

Originally posted by ownerofbabylon
im just wondering what id and index are used for. I have a basic idea but arent there like special ones for special NPCs? like 0 is the current NPC and in some command if its over like 250 then something is different... :(
You use indexes to tell the difference between npcs/players/images/baddies in a level. Say there was like 20 baddies in a level for one of those lame quests, you couldn't just do baddy.x could you? How would you know which baddy you'd be affecting? (Oh, and its compus, not baddy, in real gscript, by the way..) You use compus[0].x to find the x of the first baddy, compus[1].x to find the x of the second baddy, and so forth...Did I explain that well enough for you?

ownerofbabylon 10-20-2001 11:43 PM

yup accept how are they assigned? the first COMPUS you lay down will be 0 and the next is 1?

Xaviar 10-20-2001 11:51 PM

Quote:

Originally posted by ownerofbabylon
yup accept how are they assigned? the first COMPUS you lay down will be 0 and the next is 1?
Umm...I'm not to sure about that, it's the first compus graal processes gets 0, the next gets 1, etc...I'm not sure the order it recognizes them in...But take players as a different example, if the script is running clientside, the player running the script is always 0 (or is that just with weapons? someone correct me..), and the players after that are assigned indexes as they enter, so the first player in would be 1 (0, if I was wrong about the non-weapon npc's), the next would be 2 (1, same reason), etc..

ownerofbabylon 10-21-2001 12:31 AM

wow so you could actually make a script happen to like the 3 person to enter the room?

Xaviar 10-21-2001 12:44 AM

Quote:

Originally posted by ownerofbabylon
wow so you could actually make a script happen to like the 3 person to enter the room?
Yea, but you don't need indexes to do that, just:

if (playerenters) {
this.count++;
if (this.count==3) {
this.count = 0;
playerrupees += 5;
}
}

That'll give 5g to every 3rd person to walk into the level

btedji 10-21-2001 04:16 AM

Quote:

Originally posted by Xaviar


If I'm not mistaken, theres no difference between id, and index..But because of the way he said it, I'm not quite sure...

each player has a unique server id

but the index is only for the players on the current level

btedji 10-21-2001 04:17 AM

Quote:

Originally posted by Xaviar


Yea, but you don't need indexes to do that, just:

if (playerenters) {
this.count++;
if (this.count==3) {
this.count = 0;
playerrupees += 5;
}
}

That'll give 5g to every 3rd person to walk into the level

that would only work if the same player entered the level 3 times

Xaviar 10-21-2001 04:56 AM

Quote:

Originally posted by btedji


that would only work if the same player entered the level 3 times

Oh yea, unless its p2p...My bad...


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

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