Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   players[index].var (https://forums.graalonline.com/forums/showthread.php?t=28526)

BBflat 05-04-2002 06:33 AM

players[index].var
 
In my past experiences with the players[] array, I haven't had pleasant experiences. I couldn't do things like manipulate players' hearts and things, and I have no idea why. Someone please explain why not, and suggest a way to do it instead. Here's what I had originally...

for (i = 0; i < playerscount; i++)
{
players[i].hearts = 3;
}

What's wrong? Thanks.

Saga2001 05-04-2002 09:35 AM

-FooL-

Isn't players[i].hearts read only?

If it is, you could try something like...


for (i=0;i<playerscount;i++)
hurt 3-players[i].hearts,players[i].x+1.5,players[i].y+1.5;

Which probably won't get them to 3 every time, considering it's a Friday and my brain is suffering from schoolicidis... but you get the idea...

BBflat 05-04-2002 09:09 PM

I suppose it would. With hitplayer, it would'nt be too hard, I guess. However, will that set everyone in the level's hearts to 3, or are player indeces server-wide? And why would the variables be read-only? I have never heard of a const variable in Graal. Actually, I have, a few, but why would he make the players[] variables const?

BBflat 05-04-2002 09:15 PM

A security thing, you say. How so? What a pain. If the indeces are level wide, how does it decide what index each player gets? All I know is that if you are playing, you are player 0.


All times are GMT +2. The time now is 12:26 PM.

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