Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-15-2007, 11:10 PM
HolySheepy HolySheepy is offline
Registered User
Join Date: Apr 2007
Posts: 68
HolySheepy is on a distinguished road
Array problems

Hi,

so i did

PHP Code:
function onCreated()
  {
  
this.includelevels = { "test.nw" };
  
player.chat this.includelevels.indexplayer.level );
  } 
it says -1

PHP Code:
function onCreated()
  {
  
this.includelevels = { "test.nw" };
  
player.chat this.includelevels];
  } 
it says test.nw

PHP Code:
function onCreated()
  {
  
this.includelevels = { "test.nw" };
  
player.chat this.includelevels] == player.level;
  } 
it says 1

PHP Code:
function onCreated()
  {
  
this.includelevels = { "test.nw", };
  
player.chat this.includelevels.indexplayer.level );
  } 
it says -1

PHP Code:
function onCreated()
  {
  
this.includelevels = { "test.nw""blub.nw" };
  
player.chat this.includelevels.indexplayer.level );
  } 
it says -1

PHP Code:
function onCreated()
  {
  
this.includelevels = { };
  
this.includelevels.add"test.nw" );
  
player.chat this.includelevels.indexplayer.level );
  } 
it says 0

so why? i dont wanna add every single level with add() Oo
and the { } worked fine like a week ago
Reply With Quote
  #2  
Old 07-15-2007, 11:27 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Tack on .name to 'player.level'.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #3  
Old 07-15-2007, 11:35 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
player.level is an object.
__________________
Reply With Quote
  #4  
Old 07-16-2007, 12:24 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Out of observation, I don't mean to be rude....but, your styling is completely retarded. O.o At first glance I hardly understood what it was doing.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #5  
Old 07-16-2007, 02:47 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
As the other's already stated, try using player.level.name instead of player.level. Should do the trick!
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 07-16-2007, 04:07 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by killerogue View Post
Out of observation, I don't mean to be rude....but, your styling is completely retarded. O.o At first glance I hardly understood what it was doing.


Yeah, I told him I disliked his styling as well for it didn't make much sense but that's his own personal preference. The problem comes when other people have to edit his work, for they're forced to deal with his styling.
Reply With Quote
  #7  
Old 07-16-2007, 09:55 AM
HolySheepy HolySheepy is offline
Registered User
Join Date: Apr 2007
Posts: 68
HolySheepy is on a distinguished road
Quote:
Originally Posted by Gambet View Post
Yeah, I told him I disliked his styling as well for it didn't make much sense but that's his own personal preference. The problem comes when other people have to edit his work, for they're forced to deal with his styling.
well dunno, but for me my styling makes more sense than yours :P
but thanks for helping

a year ago i had styling like
PHP Code:
function meh() {
  
blubcommands

or
PHP Code:
function meh()
{
  
blubcommands;

then i started working for a serv, the previous scripter quit and he styled it like im doing it now, i first found it hard to read, but after editing some scripts i liked that style and now i think its easier to read than the other styles i posted above :o
oh yeah thats a feature request, brb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:30 AM.


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