This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's
TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.
TI-Basic =>
TI-BASIC
Author |
Message |
|
KARTOONCHRIS
Newbie
Joined: 16 Feb 2004 Posts: 23
|
Posted: 17 Feb 2004 11:42:25 am Post subject: |
|
|
ok, im making an rpg for my ti-83 plus se and i need an inventory list for the character. like when you collect something its added to you inventory list and you can use it. ive seensome where you use the dim( command but i didn't understand it well. if you can help or explain this to me or give me some good links i would really appreciate it, thanx |
|
Back to top |
|
|
Ray Kremer
Member
Joined: 16 Feb 2004 Posts: 237
|
Posted: 17 Feb 2004 02:38:21 pm Post subject: |
|
|
Use a list.
Say L1 = {1,3,0,7}
That could mean that you've got 1 bomb, 3 red potions, 0 magic gems, and 7 arrows. |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 17 Feb 2004 04:36:18 pm Post subject: |
|
|
dim explained:
If you want a lsit to contain X elements, you can use dim to make it so:
X->dim(L1)
Similarly, you can check how many elements a lsit has, for example:
{1,2,3,4,5,6,7,8}->L1
Disp dim(L1) //this would display how many elements there are in L1, 8 in this case
You can use also use strings, matrices, or even normal variables (A-Ø) to store an inventory to, but lists and strings are the best. |
|
Back to top |
|
|
Awesome1
Advanced Member
Joined: 28 Jan 2004 Posts: 269
|
Posted: 20 Feb 2004 07:20:42 pm Post subject: |
|
|
Outa curiosity, would it be possible to make the program recognize the string and load the proper functions for example "game save" for an rpg or a game? Im not making any just wonderin' because i make BASIC basic programs and that would be useful if u want to give an option for the user to save settings if the program had any...?!? |
|
Back to top |
|
|
Babyboy
Advanced Member
Joined: 11 Jun 2003 Posts: 499
|
Posted: 20 Feb 2004 07:46:34 pm Post subject: |
|
|
like this?
Code: If L1 //check for L1
Then
If L1(1)=1 //saved game if 1
Goto CO //goto the place to continue the game, the way i am doing it, I have another var for location, like map 1 is LSTAT(14)=1 etc and it goes there instead.
End
Note: save points are a bad idea! noone has the time, i believe, to find a save point, it was a big fall of the final fantasy games and should not be emulated!
Last edited by Guest on 20 Feb 2004 07:47:31 pm; edited 1 time in total |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 20 Feb 2004 07:51:29 pm Post subject: |
|
|
well:
Code: //user wants to save
A->LSAVE(1 //lets say this is how much life the guy has, can never be 0 (at least the user wont be able to save with it being 0, as the game will run the necissary restart stuff)
B->LSAVE(2
//continue to save vars to the list, lets say we save 8 vars
Stop //quit the program
then put this at the front:
Code: 8->dim(LSAVE
If LSAVE(1 //remember, life has to be non zero at time of save
Then
LSAVE(1->A
LSAVE(2->B
//restore all vars and jump to main routine
End
//startup routine here (splash screen, etc)
|
|
Back to top |
|
|
Fr0sty
Member
Joined: 27 Nov 2003 Posts: 202
|
Posted: 20 Feb 2004 10:36:11 pm Post subject: |
|
|
I made my game so that it always makes a new list every time you run it and whenever you saved a game it unarchived the save list, saved it, then rearchived it. It will never save unless you save it and if your ram gets cleared, you still have your save file. The program will create the lists at the start of the game, but it kinda gets confused if you manually delete the lists. |
|
Back to top |
|
|
|
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
»
Go to Registration page