Topic:   Arrays in Silver Creator   (Read 2273 times)


0 Members and 1 Guest are viewing this topic.

Johna100


  • GMG Newbie

  • *

  • no avatar

  • Posts: 25

  • Gan is so awesome.
    • View Profile
Arrays in Silver Creator
« on: February 03, 2013, 04:52:57 PM »
Im working on a game in Silver Creator that uses Arrays. I can't get the arrays to work. When I use a string array it says that string arrays are not supported. Also I was wondering how to use the data from the array once it is set. And I would like to know how to let a variable decide what piece of data is selected. And final if you have some example code of arrays being used properly that would be good. Thanks.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4361
    • View Profile
Re: Arrays in Silver Creator
« Reply #1 on: February 03, 2013, 05:42:49 PM »
I'm looking into it. It's been a while since I coded in Sc and the documentation could use some work.

Johna100


  • GMG Newbie

  • *

  • no avatar

  • Posts: 25

  • Gan is so awesome.
    • View Profile
Re: Arrays in Silver Creator
« Reply #2 on: February 03, 2013, 05:44:50 PM »
Thanks. Im using v1.6b3

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4361
    • View Profile
Re: Arrays in Silver Creator
« Reply #3 on: February 03, 2013, 06:48:09 PM »
Ah! You must use the unofficial latest SilverCreator release. I've attached it to this post.

Here we go:
Code: [Select]
DIM myArray$(0)  //Create the array
//Now fill it with greatness
APPENDARRAY myArray$, "We're no strangers to love"
APPENDARRAY myArray$, "You know the rules and so do I"
APPENDARRAY myArray$, "A full commitment's what I'm thinking of"
APPENDARRAY myArray$, "You wouldn't get this from any other guy"
APPENDARRAY myArray$, " "
APPENDARRAY myArray$, "I just wanna tell you how I'm feeling"
APPENDARRAY myArray$, "Gotta make you understand"
APPENDARRAY myArray$, " "
APPENDARRAY myArray$, "Never gonna give you up"
APPENDARRAY myArray$, "Never gonna let you down"
APPENDARRAY myArray$, "Never gonna let you down, Never gonna run around and desert you"
APPENDARRAY myArray$, "Never gonna make you cry"
APPENDARRAY myArray$, "Never gonna say goodbye"
APPENDARRAY myArray$, "Never gonna tell a lie and hurt you"
//Now loop over what's in it
FOR i = 1 to COUNTARRAY(myArray$)
   //Print off the greatness
   PRINT STR$(i) + " " + myArray$(i)
NEXT

//Cheat sheet
// - DIM myArray$(0) // Creates a string array with 0 items
// - COUNTARRAY(myArray$) : Gets the length of the array
// - myArray$(i) : Gets the stuff out of the array as index i
// - APPENDARRAY myArray$, "Stuff" : Adds a string into the array
// - STR$(i) : Converts a number to a string
// Hint: $ at the end of the variable means it is a string variable

Hope that satisfied what you need! And welcome to the GMG!  ;D

Johna100


  • GMG Newbie

  • *

  • no avatar

  • Posts: 25

  • Gan is so awesome.
    • View Profile
Re: Arrays in Silver Creator
« Reply #4 on: February 03, 2013, 07:39:25 PM »
Thank you for your time and help.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2353

  • It's a secret to everyone...
    • View Profile
Re: Arrays in Silver Creator
« Reply #5 on: February 04, 2013, 11:08:06 AM »
Good to see new members here, may I ask what you're trying to make?
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Johna100


  • GMG Newbie

  • *

  • no avatar

  • Posts: 25

  • Gan is so awesome.
    • View Profile
Re: Arrays in Silver Creator
« Reply #6 on: February 04, 2013, 03:11:05 PM »
Im making a text based RPG and I needed arrays for the weapon equip system.

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
    • View Profile
Re: Arrays in Silver Creator
« Reply #7 on: February 27, 2013, 08:06:51 PM »
Keep us updated. I've been so busy with school and debate that I haven't been able to program in forever. Looking at someone elses programming is the next best thing though  ;D
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Johna100


  • GMG Newbie

  • *

  • no avatar

  • Posts: 25

  • Gan is so awesome.
    • View Profile
Re: Arrays in Silver Creator
« Reply #8 on: May 26, 2013, 12:56:43 PM »
I have a topic titled DungeonRealms game progress that I will use to post updates.
« Last Edit: May 26, 2013, 12:58:27 PM by Johna100 »

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2353

  • It's a secret to everyone...
    • View Profile
Re: Arrays in Silver Creator
« Reply #9 on: July 25, 2018, 07:09:28 AM »
Woah, nice necro. I've never seen someone pick out a support question from 5 years ago. I check this site sometimes but I didn't expect to see a new user!

 Weird, this thread was up when I was barely out of high school.
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4361
    • View Profile
Re: Arrays in Silver Creator
« Reply #10 on: September 09, 2018, 07:24:35 AM »
That guy was a spammer. Saying he coded a weight watchers website in SilverCreator. Pretty clever deception.