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
  #16  
Old 04-06-2006, 11:24 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by ApothiX
Why are you guys all using dynamic-named variables as opposed to a 3-Dimensional array?
I tend to stay away from 3D arrays because they tend to get really long, and updating them via RC can cut them off.

At least for now, anyways.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #17  
Old 04-07-2006, 01:44 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by ApothiX
Why are you guys all using dynamic-named variables as opposed to a 3-Dimensional array?

this.apartments[this.apartments.size()].add({owner, locked, other crap, ...});

is how I would do it, then you access it like: this.apartments[apartmentid][0]; to get the owner.

Quote:
Originally Posted by napo_p2p
I tend to stay away from 3D arrays because they tend to get really long, and updating them via RC can cut them off.

At least for now, anyways.
Problems with 3-dimensional arrays:
1. the standard object functions don't update the string value outputs for mult-dimensional arrays (unless Stefan's fixed that since February).
2. what nappy said.

I mean, because of #1, I used 2 pairs of parallel arrays for my rank system on Classic. However, with 3000+ accounts a month entering the server, it lags the hell out of me when I open the script's flags. I get around this by simply downloading the text file from the NPC folder.

The thing that you have to be careful the most about when you use dynamic variable names is that they don't have spaces in them. You could probably get around this (for programming ease of use) by replacing the spaces with underscores or simply trimming the strings that make up the dynamic variable.
Reply With Quote
  #18  
Old 04-07-2006, 03:15 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally Posted by ApothiX
Why are you guys all using dynamic-named variables as opposed to a 3-Dimensional array?
Multi-level arrays, but it really doesn't make a difference if you'ure using multilevel arrays or using dynamically named arrays. The problem is that they can get confusing if you try and manually edit them and they are complicated. It's more a matter of personal preference though. At least in GScript you can kind of see them, in any other language they're all but impossible to manually read without running loops or complicated checks to print them out
__________________
Who has time for life these days?
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 06:56 PM.


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