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 04-16-2006, 10:38 PM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Hat system problems

Ok, so im new to gs1 and I dont knwo how to use arrays.....
Well I think hat systems use arrays (right?). Well, Once I set an array how do I add another var to it? And how do I read parts of the array (like when showing what hats you have).
__________________
Reply With Quote
  #2  
Old 04-17-2006, 04:56 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
You could do:
thiso.hatzlist = { 0, 1, 2, 3}; -> as standard hats
Then when you buy a hat, like: hat number 50.. you make the buy script do: client.hat_50 += 1; so for example client.hat_50 is 2 when you bought 2 times hat 50.

After that, to add the hat to the array you do:
for ( i: getstringkeys( "client.hat_"))
thiso.hatzlist.add( client.( "hat_" @ i));

Then thiso.hatzlist would be 0,1,2,3,50

To read a part of the array, do: thiso.hatzlist[ index], the index of an array starts with 0, so thiso.hatzlist[ 4] would say: 50 in this case..
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #3  
Old 04-17-2006, 06:32 PM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
getstringkeys? Never heard of it.

Anyway, you need to note this is GS2. You may not be familiar with a lot of what he showed you.
Reply With Quote
  #4  
Old 04-17-2006, 08:53 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
I use this.hat++ and this.hat -- along with a setting function so that when set, hat#v(this.hat).png is a hat (in gs1)
Reply With Quote
  #5  
Old 04-19-2006, 02:24 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Hat systems are usually string lists. I've seen in another thread of yours that you are not using the new engine, so you should be using the basic stringlist functions:
addstring, removestring, insertstring.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
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 06:14 PM.


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