Author Topic: Lots of Questions (I'm a newb ^_^)  (Read 12434 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Lots of Questions (I'm a newb ^_^)
« Reply #15 on: March 12, 2010, 10:41:50 pm »
Illusiat 2 original version was actually built off Illusiat 1. This is why both game dungeons are almost the same. Illusiat 3 was also built off Illusiat 1 and 2.

Btw looking at other people's code source can help a lot during learning, too, after you checked some tutorials.And obviously, the TI-83+ guidebook, chapter about programming and the parts about boolean logic. http://education.ti.com/educationportal/downloadcenter/SoftwareDetail.do?website=US&tabId=2&appId=6124

I don't recommend taking Illusiat early games as example for coding, though, because the code is very messy. Check different author's source, maybe. As said earlier, RPG Starter kit is a good utility
« Last Edit: March 12, 2010, 10:42:45 pm by DJ Omnimaga »

Offline Cowmaster232

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 12
  • Rating: +0/-0
  • Ti-BASIC newbie
    • View Profile
Re: Lots of Questions (I'm a newb ^_^)
« Reply #16 on: March 12, 2010, 10:46:27 pm »

Matrix:
:[[1,2,1,2,1,2][2,0,0,0,0,1][1,0,0,0,0,2][2,1,2,1,2,1->[A]
:ClrHome
:For(A,1,4
:For(B,1,6
:Output(A,B,sub("=87",1+[A](A,B),1
:End
:End

List:
:{1,2,1,2,1,2,2,0,0,0,0,1,1,0,0,0,0,2,2,1,2,1,2,1->L1
:ClrHome
:For(A,1,4
:For(B,1,6
:Output(A,B,sub("=87",1+L1(6A-6+B),1
:End
:End

String:
:"8787877====88====778787->Str1
:ClrHome
:For(A,1,4
:Output(A,B,sub(Str1,6A-5,6
:End

Once these are all ran you will see
878787
7====8
8====7
787878


Can you explain the 1's 2's and 0's?
And what purpose do the For commands serve in this situation?

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Lots of Questions (I'm a newb ^_^)
« Reply #17 on: March 12, 2010, 10:50:16 pm »
Sure. :)

The 1s,2s,and 0s are references to the different tiles in the map.  The For loop(s) then display either a single character, or a group of 6 characters in the string example.  Basically the For loops let the sub( put the characters on the screen. :)

I'd recommend learning about the sub( command.  It's very important when dealing with strings, which happens quite frequently. :)
http://tibasicdev.wikidot.com/sub

Edit: Here's a more in depth explanation with the matrix:
:[[1,2,1,2,1,2][2,0,0,0,0,1][1,0,0,0,0,2][2,1,2,1,2,1->[A]          //Store the tile data into [A]
:ClrHome           //Clear the homescreen
:For(A,1,4            //This will loop 4 times, making A = 1, 2, 3, and 4 as it adds one to A each time
:For(B,1,6            //This loops 6 times and changes B
:Output(A,B,sub("=87",1+[A](A,B),1                   //This displays a = if the corresponding spot in the matrix is zero, a 8 if the spot is one, and a 7 if the spot is two.  It places it at a spot relying on the values of A and B. :)
:End           //Ending the For(B loop
:End            //End of the For(A loop

Does this help? ;D

Edit x2: Meishe, ninjas are quite frequent when 5 people are viewing a topic. O0
« Last Edit: March 12, 2010, 10:56:17 pm by ztrumpet »

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Lots of Questions (I'm a newb ^_^)
« Reply #18 on: March 12, 2010, 10:53:45 pm »
You know, I never thought about using sub( for displaying maps before. Nice thought.
However, you're working a little too hard on displaying the string map. xP
Nevermind. ;P
« Last Edit: March 12, 2010, 10:54:24 pm by {AP} »

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Lots of Questions (I'm a newb ^_^)
« Reply #19 on: March 12, 2010, 10:54:15 pm »
The 0, 1, and 2's are what lists and matrices can store, they can't hold actual characters like a string. So basically what he is doing is that putting those in and then code later interprets the numbers and places a character where those would be (either an 7, 8, or = in this case). Each number is also a specific character. The For( command is used to display this information. It is running along the string with the help of sub( (you should learn that command, its quite useful if you don't know what it does). I have actually written a couple detailed explanations on movement and collision detection here (collision detection) and here (movement). They might help explain some things too. :)

Dang, I was ninja'd.
« Last Edit: March 12, 2010, 10:54:34 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline trevmeister66

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1009
  • Rating: +14/-5
    • View Profile
Re: Lots of Questions (I'm a newb ^_^)
« Reply #20 on: March 12, 2010, 11:08:05 pm »
You know, I never thought about using sub( for displaying maps before. Nice thought.
However, you're working a little too hard on displaying the string map. xP
Nevermind. ;P
That's true, but you could use sub( to do a map where it moves every time you get near the edge (instead of doing typical full screen moves seen in most RPG's). I think Tifreak's pokemon purple and his RPG Starter Kit #2 both use this setup.
Projects:    nameless RPG: 1.0%  |  Reverse Snake v1.5: 100%  |  Secret Project: 5%  |  DUNGEON: 70%

My MW2 Blog <-- Please visit :)

Offline Cowmaster232

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 12
  • Rating: +0/-0
  • Ti-BASIC newbie
    • View Profile
Re: Lots of Questions (I'm a newb ^_^)
« Reply #21 on: March 12, 2010, 11:32:25 pm »
Sure. :)

The 1s,2s,and 0s are references to the different tiles in the map.  The For loop(s) then display either a single character, or a group of 6 characters in the string example.  Basically the For loops let the sub( put the characters on the screen. :)

I'd recommend learning about the sub( command.  It's very important when dealing with strings, which happens quite frequently. :)
http://tibasicdev.wikidot.com/sub

Edit: Here's a more in depth explanation with the matrix:
:[[1,2,1,2,1,2][2,0,0,0,0,1][1,0,0,0,0,2][2,1,2,1,2,1->[A]          //Store the tile data into [A]
:ClrHome           //Clear the homescreen
:For(A,1,4            //This will loop 4 times, making A = 1, 2, 3, and 4 as it adds one to A each time
:For(B,1,6            //This loops 6 times and changes B
:Output(A,B,sub("=87",1+[A](A,B),1                   //This displays a = if the corresponding spot in the matrix is zero, a 8 if the spot is one, and a 7 if the spot is two.  It places it at a spot relying on the values of A and B. :)
:End           //Ending the For(B loop
:End            //End of the For(A loop

Does this help? ;D

Edit x2: Meishe, ninjas are quite frequent when 5 people are viewing a topic. O0

Yes that helped ;D

I have another question that has nothing to do with maps.
How do you set up stats like health, MP, money, ect. (properly)??   Are they just variables?
« Last Edit: March 12, 2010, 11:32:40 pm by Cowmaster232 »

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Lots of Questions (I'm a newb ^_^)
« Reply #22 on: March 12, 2010, 11:34:54 pm »
Ya I know it's easy to get ninja'd...but I wasn't paying attention to who was viewing :P

For those I'm pretty sure you're best bet is using lists. I could be wrong though.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline trevmeister66

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1009
  • Rating: +14/-5
    • View Profile
Re: Lots of Questions (I'm a newb ^_^)
« Reply #23 on: March 12, 2010, 11:52:58 pm »
Yes, all the stats (ie health, mp, money, strength, etc) are variables, and as meishe said, Lists are a good option for that, but if you don't plan on making too big of an RPG, you can just use the built in A-Z variables, but then you wouldn't be able to easily save your stats (as in have a save feature available for your RPG). That's why you should look into using custom named lists, which are highly unlikely to get written over.
Projects:    nameless RPG: 1.0%  |  Reverse Snake v1.5: 100%  |  Secret Project: 5%  |  DUNGEON: 70%

My MW2 Blog <-- Please visit :)

Offline Cowmaster232

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 12
  • Rating: +0/-0
  • Ti-BASIC newbie
    • View Profile
Re: Lots of Questions (I'm a newb ^_^)
« Reply #24 on: March 12, 2010, 11:59:14 pm »
Yes, all the stats (ie health, mp, money, strength, etc) are variables, and as meishe said, Lists are a good option for that, but if you don't plan on making too big of an RPG, you can just use the built in A-Z variables, but then you wouldn't be able to easily save your stats (as in have a save feature available for your RPG). That's why you should look into using custom named lists, which are highly unlikely to get written over.

Ok thx. How does saving data work? Is it archived?

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Lots of Questions (I'm a newb ^_^)
« Reply #25 on: March 13, 2010, 12:08:35 am »
As stated before, lists are your best bet.

All you'd need to set it up is something like this:
{LEVEL,CURRENT_HP,MAX_HP,CURRENT_MP,MAX_MP,MONEY→LCHAR
e.g.
{1,100,100,75,75,0→LCHAR
(Note: LCHAR can be replaced with any other name, like LSTATS or just LA)

From that point on, you can refer to a stat like this:
Say, if you need to get their level...
LCHAR(1) will get it. From there, say they leveled up just do LCHAR(1)+1→LCHAR(1)
LCHAR(4) will get the current MP and you can see the pattern.

If you want to save, you'll need a separate list for that or if there's only one save, then you can just leave the list as is.
Lists are on the calc regardless of whether you're in a program or not so if you only have one save, then a new char will overwrite the original list, and continuing would just use the list as is.
With multiple saves you'd do something like this:
LCHAR→LSAVE1 (for the first slot)
LCHAR→LSAVE2 (for the second, etc.)

Loading is the opposite,
LSAVE1→LCHAR
etc.

Throughout the program, all you'll need to refer to is LCHAR for stats and such though and only mess with the save files to save or load.
« Last Edit: March 13, 2010, 12:12:00 am by {AP} »

Offline Cowmaster232

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 12
  • Rating: +0/-0
  • Ti-BASIC newbie
    • View Profile
Re: Lots of Questions (I'm a newb ^_^)
« Reply #26 on: March 13, 2010, 01:12:01 am »
As stated before, lists are your best bet.

All you'd need to set it up is something like this:
{LEVEL,CURRENT_HP,MAX_HP,CURRENT_MP,MAX_MP,MONEY→LCHAR
e.g.
{1,100,100,75,75,0→LCHAR
(Note: LCHAR can be replaced with any other name, like LSTATS or just LA)

From that point on, you can refer to a stat like this:
Say, if you need to get their level...
LCHAR(1) will get it. From there, say they leveled up just do LCHAR(1)+1→LCHAR(1)
LCHAR(4) will get the current MP and you can see the pattern.

If you want to save, you'll need a separate list for that or if there's only one save, then you can just leave the list as is.
Lists are on the calc regardless of whether you're in a program or not so if you only have one save, then a new char will overwrite the original list, and continuing would just use the list as is.
With multiple saves you'd do something like this:
LCHAR→LSAVE1 (for the first slot)
LCHAR→LSAVE2 (for the second, etc.)

Loading is the opposite,
LSAVE1→LCHAR
etc.

Throughout the program, all you'll need to refer to is LCHAR for stats and such though and only mess with the save files to save or load.

Thanks, now I understand lists a whole lot better!

What if two programs have a list with the same name?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Lots of Questions (I'm a newb ^_^)
« Reply #27 on: March 13, 2010, 01:15:57 am »
variables in TI-BASIC are global, so you can use the same list everywhere

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Lots of Questions (I'm a newb ^_^)
« Reply #28 on: March 13, 2010, 03:34:26 am »
DJ Omni is right. Lists can be used even outside of a program.

However, if you mean like what if two entirely different programs somehow use the same list, then one program's info will overwrite the other or it'll just try to take information from the list which will most likely result in errors or just plain wrong information unless the lists just somehow sync up. (Example, if you made a sequel that uses the character's data from the original or if you had to separate one game into several chapters due to size.)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Lots of Questions (I'm a newb ^_^)
« Reply #29 on: March 13, 2010, 05:59:28 am »
But, couldn't you techinically rig the lists so you could use them for multiple games as long as your defining everythign correctly?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)