Forums

Topic: Petit Computer

Posts 5,281 to 5,300 of 9,618

InsertPi

programmerpro wrote:

Can someone explain the DATA command? I don't mean arrays I mean graphics. EXPLAIN IT don't just say a certain game has it.

I can explain. DATA is used to store a lot of data in one place. It's similar to what an array does, but it's easier to use. First off, you have to identify the DATA under a label. We'll use @DATA. Next, you put the data like this:

@DATA
DATA "string","string2", etc.

or

DATA constant,constant, etc.

Let's have an example. Here's an example for the splash text:

@SPLASH
DATA "Potatoes!","Randomouscrap!","Read books!"

and so on, but we'll just use this for demonstration purposes. Then we have to identify the data we're using

RESTORE @SPLASH

Now we assign it to an array

DIM ARRAY$(3)
FOR I=0 TO 2
READ ARRAY$(I)
NEXT

Finally, lets use it!

PRINT ARRAY$(RND(3))

Storing numbers in DATA works the same, just use a numerical array and don't put " around the numbers. Storing music in DATA is a totally different story. I'll tell you later...

[Edited by InsertPi]

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

X:

607jf

@slayer I actully got mine off cragslist for $160 with DKCR. (Now back on topic.)

Chao!, Nintendo, Need For Speed, Minecraft And More! 3Ds FC-4742-5514-6521.

Eel

programmerpro wrote:

Morphtorok wrote:

programmerpro wrote:

BonChoi wrote:

programmerpro wrote:

Can someone explain the DATA command? I don't mean arrays I mean graphics. EXPLAIN IT don't just say a certain game has it.

I think the manual explains this.

The manual isn't helpful at all to me.

You can store graphics in DATA commands.... By using arrays. And stuff like that.

Can you still explain the numbers?

Well, when you think about it... Graphics are like... Just big strings of colored dots that make a picture.
Each color has a number, that's what you store in the data arrays.

Bloop.

<My slightly less dead youtube channel>

SMM2 Maker ID: 69R-F81-NLG

My Nintendo: Abgarok

InsertPi

randomous wrote:

@IAmAPerson Thank you! I'm sure there's a better way to do the smooth scrolling credits, but here's what I did:

I started out by printing the credits to the screen with GPUTCHR instead of the usual PNLSTR you'd normally use. In order to get it to scroll, I stored all the lines of credits as a separate string in an array of strings. Then, I would print out each line based on an offset that was continuously increased to pull the credits upwards. I would only print the lines that were currently visible. The problem with that was that trying to print out all those characters to the screen using GPUTCHR took quite a long time. That's probably where the code gets confusing: instead of printing out all the characters, I only print out the line of credits that's on the very bottom, then use GCOPY to copy the entire screen and pull it up one pixel. This way, I only have to print one line of text instead of 18, and GCOPY is a quick function.

If you need a more in-depth explanation, I can try to extract the function and make a sample "credits" program.

Please make a sample program. I don't know how to use GPUTCHR and I can't get GCOPY to work...

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

X:

swordx

Err mah gerd Dungeon Adventure has wayyyyyyy too many variablessssss. This is taking foreverrrr to find them all.

swordx

damolii

BonChoi wrote:

damolii wrote:

IAmAPerson wrote:

@anyone does anyone wanna make more music? I will add credits including anyone who has ever contributed to MCDS

Yay!!! i get to be on credits!!! XD

Your name is in the splash text, too!

Even More Happiness!!! XDXDXD
I don't think I'll be posting regularly anymore though. I have to focus on school now Bye Everyone

[Edited by damolii]

I don't have a 3DS so what do I put here? -Damolii

Hairmanban19

swordx wrote:

Dungeon Adventure Version 1.1 is set to be released tomorrow. This version fixes bugs and adds saves.

Yay! I'll get to make much more progress now!

...

InsertPi

swordx wrote:

Err mah gerd Dungeon Adventure has wayyyyyyy too many variablessssss. This is taking foreverrrr to find them all.

I've found it's easiest to either make a physical list of variables, or arrays.

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

X:

ramstrong

IAmAPerson wrote:

swordx wrote:

Err mah gerd Dungeon Adventure has wayyyyyyy too many variablessssss. This is taking foreverrrr to find them all.

I've found it's easiest to either make a physical list of variables, or arrays.

I don't think he'll be doing that. It makes it too easy, there'll be nothing to complain about. He wants to go through development hell so he can tell everybody about how miserable his programming experience is. Apparently, he's hoping to get sympathy so people won't be too upset when the program is buggy. Right?

slayer wrote:

I tried this and apparently I couldn't load the correct sprite needed:
LOAD "SPU1:WMR1"
This is the error I get:
Cannot locate file
That or it was that it couldn't load...
Either way, I used the sprite color I wanted... Why didn't it load?

You need to be specific on the error message. Maybe you missed it, but there are many reasons that would cause a load to fail, and the error message tells you which of the case is relevant. I suggest that you read the error message carefully, and figure out what it means. Anyway, what does sprite color has anything to do with locating a file?

[Edited by ramstrong]

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

randomous

@IAmAPerson All right, here's an example program for making a credits screen:
Untitled
Alternatively, here's the same program without comments:
Untitled

randomous

ramstrong

programmerpro wrote:

Can someone explain the DATA command? I don't mean arrays I mean graphics. EXPLAIN IT don't just say a certain game has it.

DATA? There's some info on the tutorial thread.
Arrays? Tutorial thread has some info on that, too.
Graphics? I don't know if there's a good tutorial on that one. I did a blogspot on it on my Petit Computer Journal. Also, I know somebody recently did a good explanation of it. (Please repost to Tutorial thread)

You know, most standard questions are answered in Tutorial thread. Maybe we should ask to make it sticky.
And clean up the useless chatters out of it.

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

InsertPi

@randomous ok I've got the credits working with my own stuff in it in the upcoming version of MCDS. Special credit to you. Is it normal for the wet hands song+emotional credits to make me tear up a bit? Or am I just weird...

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

X:

swordx

ramstrong wrote:

IAmAPerson wrote:

swordx wrote:

Err mah gerd Dungeon Adventure has wayyyyyyy too many variablessssss. This is taking foreverrrr to find them all.

I've found it's easiest to either make a physical list of variables, or arrays.

I don't think he'll be doing that. It makes it too easy, there'll be nothing to complain about. He wants to go through development hell so he can tell everybody about how miserable his programming experience is. Apparently, he's hoping to get sympathy so people won't be too upset when the program is buggy. Right?

slayer wrote:

I tried this and apparently I couldn't load the correct sprite needed:
LOAD "SPU1:WMR1"
This is the error I get:
Cannot locate file
That or it was that it couldn't load...
Either way, I used the sprite color I wanted... Why didn't it load?

You need to be specific on the error message. Maybe you missed it, but there are many reasons that would cause a load to fail, and the error message tells you which of the case is relevant. I suggest that you read the error message carefully, and figure out what it means. Anyway, what does sprite color has anything to do with locating a file?

lols I don't need a new excuse for bugs; I already have one! It's called being lazyyyyy, not "development hell". lols Also, please explain to me how I am to save DATA in GRP files. Oh, and I find variables to be much better. You can do more using less space most of the time (although definitely NOT all).

And a simple question, but why would I program if it was miserable? Granted, it can be a monotonous bore at times, but it is, overall, a rather enjoyable experience.

So...in other, less fitting words, leave me alone! Pretends to sob

[Edited by swordx]

swordx

ramstrong

swordx wrote:

Also, please explain to me how I am to save DATA in GRP files.

Petit Computer Journal #12 : Packing, Saving, and Loading Data

The following quote has been edited for clarity

why would I program if it was miserable? it be monotonous bore at times, but it is a rather enjoyable experience.

Ah, yes, I see. You're the kind of masochistic person who likes to bang his head on the wall and pulls out hair. Got your message loud and clear!
EDIT: Masochist = person who enjoys being miserable.

[Edited by ramstrong]

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

iprice

Does anyone know if there's a way to prevent RND being totally random every time it's run? Have I missed that PTC has a SEED/RNDSEED) type function?

An example would be a game where 20 coins are placed randomly on each level, but each time the level is played the coins should be in the same place. In other languages I'd use a seed value to ensure that the random coins were generated in the same way each time. PTC will place the coins randomly every time.

I code, therefore I am.

BonChoi

@IAmAPerson Maybe you can hand-draw the bottom screen?

Programmer for Minecraft DS!

Press B!

iprice

Cheers IAmAPerson.

Time to whip up a random number generator then that I can rely on to not randomly generate random numbers!

I code, therefore I am.

InsertPi

Ok. Panorama is working. Still fixing the bottom screen. Credits are working. 50+ splash text phrases. Beta is lookin good...

Unfortunately, the C++ interpreter won't work... I'll just stop trying and say that PTCom isn't powerful enough...

[Edited by InsertPi]

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

X:

BonChoi

IAmAPerson wrote:

Ok. Panorama is working. Still fixing the bottom screen. Credits are working. 50+ splash text phrases. Beta is lookin good...

Unfortunately, the C++ interpreter won't work... I'll just stop trying and say that PTCom isn't powerful enough...

It's too bad that PTC doesn't have TXT files. Then we would be able to save the splash text outside of the app. LOAD "TXT:SPLASHES"

Programmer for Minecraft DS!

Press B!

Sorry, this topic has been locked.