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 12-21-2007, 08:31 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
array[i] in array

Okay, I was helping someone with a script and came across a problem.
I load all the levels from the gmap file into an array. Good, done.
Then I have a set of levels the player has been in. Good, that works(sort of...).
Now it's time to compare the levels the player has been in, with the levels of the gmap. Not good, it won't work and I have no idea why.

This is part of the script, and variables that are loaded.
Quote:
Originally Posted by this.mapinfo[1]
be_a01.nw,be_b01.nw,be_c01.nw,be_d01.nw,be_e01.nw, be_f01.nw,be_g01.nw,be_h01.nw,be_i01.nw,be_j01.nw, be_k01.nw,be_l01.nw,
Quote:
Originally Posted by client.mapviewed[i]
be_a01.nw,be_k01.nw,be_l01.nw
PHP Code:
  for (i=0;i<client.mapviewed.size();i++) {
    if (
client.mapviewed[iin this.mapinfo[1]) {
      echo(
"test");
    }
  } 
It will not echo test. If I put an echo before the if check it fires correctly, so it's not the loop. Any idea what's going on?
Reply With Quote
  #2  
Old 12-21-2007, 08:46 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
maybe try...
PHP Code:
for (temp.lvlclient.mapviewed) {
  if (
temp.lvl in this.mapinfo[1]) {
    echo(
"test");
  }

__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #3  
Old 12-21-2007, 08:53 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Also, after some help we've deduced that reconnecting fixes it... BUT, I have to reconnect everytime client.mapviewed is updated to take effect, that doesn't make any sense.
And there's no reason that should work, but I'll try it.
EDIT: no, that doesn't change a thing.
Reply With Quote
  #4  
Old 12-21-2007, 09:38 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Well, after a LONG time debugging, the problem was simple. Thanks to holysheepy for finding it.
It's not shown in the post, but I was using player.level. bzz, wrong.
Should have used player.level.name... sucks.
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 08:28 PM.


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