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 08-02-2002, 04:34 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
NPC Code:
 
if (playerenters||timeout){
setarray MyArray,4; // creates and array of length 8 starts at 0
MyArray[0] = 23; // sets the first entry in the array to 23;
MyArray[1] = 17; // 2nd entry in the array
MyArray[2] = 32;
MyArray[3] = 2;

for (index=0;index<4;index++){
message MyArray[#v(index)] is equal to #v(MyArray[index]);
sleep 1;
}
timeout=1;
}



I always said I was a poor teacher. But here is a script using an array and a for loop together. Maybe it will make sense when you run it.

I believe it shows how you can use a for loop to access the information in an array. I assure you there are much more complex methods of data retrieval using multiple arrays.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
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:44 PM.


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