Graal Forums  

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

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-06-2002, 08:47 AM
SaijinGohan SaijinGohan is offline
Registered User
SaijinGohan's Avatar
Join Date: Jul 2001
Location: U.S.A - Ohio
Posts: 536
SaijinGohan is on a distinguished road
Send a message via AIM to SaijinGohan Send a message via MSN to SaijinGohan
Question String Arrays

I am trying to become a better scripter and I have learned variable arrays and I came up with this script as a test:

// NPC made by SaijinGohan
if (created) {
this.test = {random(1,20),random(1,20),
random(1,20),random(1,20),random(1,20),
random(1,20),random(1,20),random(1,20),
random(1,20),random(1,20)};
timeout = 1;
}
if (timeout) {
a = this.test[random(1,9)];
message #v(a);
timeout = 1;
}

Will anyone teach me string arrays or manipulate this test to use string arrays?

__________________

Job: A Legend

And you think that you have played Graal forever? Ha!
  #2  
Old 03-06-2002, 10:34 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
I think this is your basic string array:
setarray name,size;
so
if (created){
setarray test,3;
}
if (playerchats&&strequals(#c,test1)){
test[0]=1;
}
if (playerchats&&strequals(#c,test2)){
test[1]=1;
}
if (playerchats&&strequals(#c,test3)){
test[2]=1;
}
That's just a basic thing with arrays
[EDIT]
here's your script converted into string arrays
if (created) {
setarray test,10;
for(i=0;i<=10;i++)
{sleep.05;
test[i]=random(4,20);
timeout = .05;
}}
if (timeout) {
a = test[random(1,9)];
message #v(a);
timeout = .05;
}
[/EDIT]

Last edited by Python523; 03-06-2002 at 10:44 AM..
  #3  
Old 03-06-2002, 11:00 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by Kaimetsu


No, that's just a normal array. I considered telling this guy the actual definition, but just look at his account name. There's no way I can help a "SaijinGohan"!
O, ok, I just skimmed the newfeatures2001.txt and found what he ment, I didn't know that the addstring, removestring, deletestring, ext were considered arrays, I always considered them normal strings
Closed Thread


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 01:20 AM.


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