DSiWare Forum

Topic: Petit Computer

Showing 1,861 to 1,880 of 2,789

AuthorMessage
Avatar

Discostew

1,861. Posted: Tue 19th Mar 2013 18:38 GMT

bigdog00 wrote:

Can someone please help me with READ, DATA, and ARRAY commands? Thanks in advanced!

READ works by reading a segment of a DATA line. You do this by calling RESTORE @label, where @label is a name that starts a set of DATA lines, like so


RESTORE @MYDATA
READ AVAR1
READ AVAR2
READ AVAR3,AVAR4,AVAR5,AVAR6
PRINT AVAR1,AVAR2,AVAR3,AVAR4,AVAR5,AVAR6
END

@MYDATA
DATA 0
DATA 1,2
DATA 1,2,3


The code above sets the "read" position to the first DATA line after the label, and each READ statement load a variable (or group like the 3rd one does), and then it prints them all out as "0 1 2 1 2 3". You can have multiple sections that have DATA lines in it. If you want to access a different data set, then assign a label in front of it, and use RESTORE to set the read position to it.

Arrays are like variables, except they also have an index so you can use the same name for a group of values by changing the index. If you plan on having an array that can hold more than 10 elements, then you'll need to define them. Defining an array locks the element count to it, so you can't access an element greater than what was assigned, nor can you define it again unless you use CLEAR, which in turn wipes out ALL variables, so decide beforehand just how big you want the array to be


'Resets all variables and arrays, or else if you
'ran this program again after running it once, it would error at the DIM line
CLEAR

AN_ARRAY(0)=10: ' Works
AN_ARRAY(1)=3: 'Works too
AN_ARRAY(13)=5: 'Does not work

DIM ARRAY2(60): 'Assigns 60 elements to this name, ranging from 0-59
ARRAY2(0)=6: 'Works
ARRAY2(45)=49: 'Works
ARRAY(67)=2: 'Does not work

PRINT AN_ARRAY(0),ARRAY2(45)
END


This would print "10 49"

Edited on Tue 19th March, 2013 @ 18:41 by Discostew

"What fun is there in making sense?"

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

AuthorMessage
Avatar

justlink

1,862. Posted: Tue 19th Mar 2013 20:24 GMT

i think making a zelda game is one of the hardest thing to do you using basic. This is because of all the things that need added. For example, are there sidequests, or will u not include them and make everything a must have for the game.

justlink

AuthorMessage
Avatar

Discostew

1,863. Posted: Tue 19th Mar 2013 20:37 GMT

justlink wrote:

i think making a zelda game is one of the hardest thing to do you using basic. This is because of all the things that need added. For example, are there sidequests, or will u not include them and make everything a must have for the game.

As far as 2D Zelda games are concerned, the only "sidequest" stuff I can think of involve finding pieces of heart and other little items like the jars in Zelda 3.

"What fun is there in making sense?"

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

AuthorMessage
Avatar

justlink

1,864. Posted: Tue 19th Mar 2013 20:47 GMT

question how do you use mem$.

if you add me then tell me so i add you
my fc is 5112-4809-1631

Edited on Tue 19th March, 2013 @ 20:50 by justlink

justlink

AuthorMessage
Avatar

Discostew

1,865. Posted: Tue 19th Mar 2013 21:09 GMT

Think of MEM$ as a normal string that is up to 256 characters long. The difference between MEM$ and strings is that you can use the SAVE/LOAD commands for it.

"What fun is there in making sense?"

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

AuthorMessage
Avatar

0SP_ZELDAiii

1,866. Posted: Tue 19th Mar 2013 21:11 GMT

swordx wrote:

0SP_ZELDAiii wrote:

swordx wrote:

0SP_ZELDAiii wrote:

i've been told by a lot of my local friends that my story is too dark for a zelda title. i always intended it to be dark, but maybe it's too dark? i hold the zelda series very close to my heart, and i would not dream of tainting the series. i've decided not to call it Zelda iii. i'm still making it, but i'll have to skin the game with a different setting, list of characters, etc. i'm still making the game, and if you want, you can try and connect the dots to find out which character is linked to which. the story is pretty much identical to my Zelda iii project, the only difference being that names are different.

Good. I always enjoy original games more than fan-made spin-offs of already existing franchises. I'm excited to see your game. Will it be top-down or side-scrolling?

One of the games I'm working on is top-down. The engine is good, but it has a bug or two that can't be fixed without redoing the coding, so I'll have to wait for Dungeon Adventure 3 to fix it.

By the way, a video of Dungeon Adventure 2 will be released within the next month. It will only show a little bit of combat. There will NOT be any demos for this game.

it will be top down with side scrolling portions, like in Link's Awakening. i am working on sprites, but i am new to sprites, so they look really bad. i don't want to post them here until i'm satisfied with them. and since this isnt Zelda iii, i have to redesign them D;

Do what I did and start from pre-built sprites, then edit them. I made a girl with ponytails from the basic boy, and I'm TERRIBLE at art, so it helps a lot. You should also ask people if they can make you sprites.

one of my friends is already on the case with character design (he's also my man for map design and character/land names). from there, i think i'll manage sprites. thanks for the tip though!

which is better? to be born a hero, or to be born evil and overcome that nature?

3DS Friend Code: 1032-1301-2772 | Nintendo Network ID: Milkman12

AuthorMessage
Avatar

0SP_ZELDAiii

1,867. Posted: Tue 19th Mar 2013 21:11 GMT

swordx wrote:

0SP_ZELDAiii wrote:

swordx wrote:

0SP_ZELDAiii wrote:

i've been told by a lot of my local friends that my story is too dark for a zelda title. i always intended it to be dark, but maybe it's too dark? i hold the zelda series very close to my heart, and i would not dream of tainting the series. i've decided not to call it Zelda iii. i'm still making it, but i'll have to skin the game with a different setting, list of characters, etc. i'm still making the game, and if you want, you can try and connect the dots to find out which character is linked to which. the story is pretty much identical to my Zelda iii project, the only difference being that names are different.

Good. I always enjoy original games more than fan-made spin-offs of already existing franchises. I'm excited to see your game. Will it be top-down or side-scrolling?

One of the games I'm working on is top-down. The engine is good, but it has a bug or two that can't be fixed without redoing the coding, so I'll have to wait for Dungeon Adventure 3 to fix it.

By the way, a video of Dungeon Adventure 2 will be released within the next month. It will only show a little bit of combat. There will NOT be any demos for this game.

it will be top down with side scrolling portions, like in Link's Awakening. i am working on sprites, but i am new to sprites, so they look really bad. i don't want to post them here until i'm satisfied with them. and since this isnt Zelda iii, i have to redesign them D;

Do what I did and start from pre-built sprites, then edit them. I made a girl with ponytails from the basic boy, and I'm TERRIBLE at art, so it helps a lot. You should also ask people if they can make you sprites.

one of my friends is already on the case with character design (he's also my man for map design and character/land names). from there, i think i'll manage sprites. thanks for the tip though!

which is better? to be born a hero, or to be born evil and overcome that nature?

3DS Friend Code: 1032-1301-2772 | Nintendo Network ID: Milkman12

AuthorMessage
Avatar

justlink

1,868. Posted: Tue 19th Mar 2013 21:16 GMT

@Discostew plz show me an example

justlink

AuthorMessage
Avatar

Discostew

1,869. Posted: Tue 19th Mar 2013 21:37 GMT

justlink wrote:

@Discostew plz show me an example

Alright.


'Saving
SOMESTRING$="This is a string"
MEM$=SOMESTRING$
SAVE "MEM:MYSTR"
END

'Loading
LOAD "MEM:MYSTR",FALSE
SOMESTRING$=MEM$
PRINT SOMESTRING$
END


The loading code loads the string "This is a string" into a regular string, but then that string is copied to MEM$, and then saved using the save command. The saving code loads up the MEM file (the FALSE at the end dismisses the dialog that pops up when loading), and then I assign the MEM$ to a regular string, which is then sent to be printed on the screen. In fact, you don't even need that additional string if you wanted. You can read/write to MEM$ directly.

"What fun is there in making sense?"

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

AuthorMessage
Avatar

justlink

1,870. Posted: Tue 19th Mar 2013 22:02 GMT

OMG! Thank you so much. that wrked perfectly. i mean i changed the names to match wat i had. when im done with it, ill try to post qrs. its a face book like app called petit book.

@Discostew
plz add me i added u

Edited on Tue 19th March, 2013 @ 22:04 by justlink

justlink

AuthorMessage
Avatar

justlink

1,871. Posted: Tue 19th Mar 2013 22:54 GMT

@swordx
are you almost done with your zelda like game, or are you busy with another game. Also, wasn't the first zelda game a basic made?

justlink

AuthorMessage
Avatar

swordx

1,872. Posted: Tue 19th Mar 2013 23:56 GMT

justlink wrote:

@swordx
are you almost done with your zelda like game, or are you busy with another game. Also, wasn't the first zelda game a basic made?

My Zelda-like game has about 2000 lines of coding. The first area (forest + temple + town) is near completion. The forest itself is done, but the town and dungeon need a little more time. Don't expect any of my games to be released until this upcoming Summer/Fall. My Spring Break starts this weekend, so I'll program a lot during that time.

Edited on Tue 19th March, 2013 @ 23:57 by swordx

swordx

AuthorMessage
Avatar

Bluerobin2

1,873. Posted: Tue 19th Mar 2013 23:56 GMT

@Discostew so that is how you do it. thanks! But another question from me this time, can you save multiple variables in a single MEM?

Houston, We have a Syntax Error.

Blog: bluerobin2.blogspot.com
Backloggery: backloggery.com/bluerobin2

I LIKE PIXEL ART
5÷0=BOOOOOM

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

swordx

1,874. Posted: Tue 19th Mar 2013 23:58 GMT

bluerobin2 wrote:

@Discostew so that is how you do it. thanks! But another question from me this time, can you save multiple variables in a single MEM?

I know that this isn't directed towards me, but yes, you can. But I don't remember how to explain how to do it...

swordx

AuthorMessage
Avatar

0SP_ZELDAiii

1,875. Posted: Wed 20th Mar 2013 00:32 GMT

justlink wrote:

i think making a zelda game is one of the hardest thing to do you using basic. This is because of all the things that need added. For example, are there sidequests, or will u not include them and make everything a must have for the game.

well, it all really depends on the size and content of the game.

which is better? to be born a hero, or to be born evil and overcome that nature?

3DS Friend Code: 1032-1301-2772 | Nintendo Network ID: Milkman12

AuthorMessage
Avatar

justlink

1,876. Posted: Wed 20th Mar 2013 01:07 GMT

you know wat, i don't appreciate your attitude!

no just kidding. ok, another question @swordx. So how did you get so you could have your character move across different backgrounds. Does it sidescroll like mario, or change when reaching a certain area. And, what code allows you to do that. Sorry about all the questions, i'm a pretty much a beginner at this and learn by example.

justlink

AuthorMessage
Avatar

hairmanban19

1,877. Posted: Wed 20th Mar 2013 02:19 GMT

swordx wrote:

justlink wrote:

@swordx
are you almost done with your zelda like game, or are you busy with another game. Also, wasn't the first zelda game a basic made?

My Zelda-like game has about 2000 lines of coding. The first area (forest + temple + town) is near completion. The forest itself is done, but the town and dungeon need a little more time. Don't expect any of my games to be released until this upcoming Summer/Fall. My Spring Break starts this weekend, so I'll program a lot during that time.

I can not wait for your Zelda-like game! How many dungeons will there be in it?

Edited on Wed 20th March, 2013 @ 02:20 by hairmanban19

Monster Hunter 3 Ultimate! Zelda! Minecraft! Petit Computer! Adventure Time!

3DS Friend Code: 3136-7615-5907

AuthorMessage
Avatar

Discostew

1,878. Posted: Wed 20th Mar 2013 02:38 GMT

bluerobin2 wrote:

@Discostew so that is how you do it. thanks! But another question from me this time, can you save multiple variables in a single MEM?

You can as strings (in which your numbers get converted using STR$), but what you need is some method to separate them within the 256 character MEM$ string. Assume you have "/" as your delimiting character. You can then concatenate strings together, and then save them as MEM files. When you want to load them from MEM, you would need a parser such as the following...

Use INSTR to find the delimiting character, and get its position
Use LEFT$ to grab the left portion of the string containing the first variable, and set the string as the remaining part using RIGHT$, both excluding the "/" character found using INSTR
The string after being set with RIGHT$ now excludes the first variable, so the 2nd variable now becomes the first in the full string. Repeat the above 2 steps to grab all remaining variables. Convert number strings with VAL.


CLEAR
LOAD "MEM:MYSTR",FALSE
DIM STRARR$(257)
NUMSTR=0
@GRABNEXT
SPOS=INSTR(MEM$,"/")
IF SPOS==-1 GOTO @FINISHEXT
STRARR$(NUMSTR)=LEFT$(MEM$,SPOS)
MEM$=RIGHT$(MEM$,LEN(MEM$)-SPOS-1)
NUMSTR=NUMSTR+1
GOTO @GRABNEXT
@FINISHEXT
STRARR$(NUMSTR)=MEM$
NUMSTR=NUMSTR+1

FOR I=0 TO NUMSTR-1
PRINT STRARR$(I)
NEXT


If MEM$ contains "This/is/a/string", then the output would be

This
is
a
string

If MEM$ contains "This/is not a/string", then the output would be

This
is not a
string

WARNING:
I have not tested the above code, so let me know if problems arise.

"What fun is there in making sense?"

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

AuthorMessage
Avatar

Bluerobin2

1,879. Posted: Wed 20th Mar 2013 05:15 GMT

@Discostew thanks! And a quick question to everyone. If you have the battlewood demo, How do you think I can improve it?
Battlewood is planned to have the following:
-A save/load systen (Thanks to Discostew)
-Two primary weopons: A bow which has limited arrows and a sword that you can use as a backup to the bow
-A shop which you can visit between battles
-(Maybe) Custom sprites
-A more detailed but humorously twisting story
-pause option
-MORE ENEMIES (Please stop bugging me about that. It will come. Eventually :) )
Also, I would like someone[s] to give ideas for the story if you would like to. Also, since pretty much all of you helped in some way so can I put your club nintendp usernames in the credits? Say no if you would not like your username there. Thank you all, and from where I am, good night.

Edited on Wed 20th March, 2013 @ 05:17 by Bluerobin2

Houston, We have a Syntax Error.

Blog: bluerobin2.blogspot.com
Backloggery: backloggery.com/bluerobin2

I LIKE PIXEL ART
5÷0=BOOOOOM

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

justlink

1,880. Posted: Wed 20th Mar 2013 11:34 GMT

I have not played "Battlewood" but its sounds cool. The way to increase the fun of playing would be to lengthen the playing time by adding more diverse enemies. Another way to increase the fun, include a choice to be girl or boy, so both can play and enjoy it as much.

justlink