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 05-04-2002, 06:33 AM
BBflat BBflat is offline
Registered User
BBflat's Avatar
Join Date: Apr 2002
Location: United States of America
Posts: 573
BBflat is on a distinguished road
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.
__________________
I am a .sig virus. Please put me in your .sig so I can continue to replicate.
Reply With Quote
  #2  
Old 05-04-2002, 09:35 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
-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...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #3  
Old 05-04-2002, 09:09 PM
BBflat BBflat is offline
Registered User
BBflat's Avatar
Join Date: Apr 2002
Location: United States of America
Posts: 573
BBflat is on a distinguished road
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?
__________________
I am a .sig virus. Please put me in your .sig so I can continue to replicate.
Reply With Quote
  #4  
Old 05-04-2002, 09:15 PM
BBflat BBflat is offline
Registered User
BBflat's Avatar
Join Date: Apr 2002
Location: United States of America
Posts: 573
BBflat is on a distinguished road
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.
__________________
I am a .sig virus. Please put me in your .sig so I can continue to replicate.
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 12:10 AM.


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