Forums

Topic: Petit Computer

Posts 5,681 to 5,700 of 9,620

InsertPi

607jf wrote:

Eh besides thats If you finish wich will probbly take awhile.

At the rate I'm going?? Pfffff. Gimme about 3-5 more months and I should be just about done.

BTW I am ALMOST DONE with block IDs! It loads all the textures, and will put different textures for different block IDs. My problem? It immediately changes back to grass when it's overridden by the next frame. A couple more days and I'll have it ready!

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.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

Pixelrobin

So I decided to make an external, PC mml editor for PTC. You can put down some notes and things kinda like garage band and it will output the DATA for it and maybe even a QR code. What should I use to make it? Visual C++, Just BASIC, etc. What?

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

randomous

Oy, this solitaire game is turning out to be a lot more work than I originally thought! All this going back and forth between drawing cards as sprites and drawing them on the GRP... augmenting the touch system to recognize the difference between a tap and a drag (which isn't just measuring TCHTIME)... loading sprites dynamically into the bottom screen sprite sheet. I mean, I have a function to load the sprite I want into the bottom screen's sheet, but I have to call it every time I want to animate a card. Yuck! And after all is said and done... who's actually going to play it? Probably nobody lol. Oh well, I've always wanted to make solitaire.

randomous

Pixelrobin

HELP PLEASE
How can I READ a string?

reading variables works fine, but strongs return a TYPE MISMATCH error.

READ Z$
BLA(X,Y)=Z$

doesnt work either.

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

iprice

Bluerobin2 wrote:

HELP PLEASE
How can I READ a string?

reading variables works fine, but strongs return a TYPE MISMATCH error.

READ Z$
BLA(X,Y)=Z$

doesnt work either.

It's a Type Mismatch because you are using an array that was dimensioned for numerals with a string.

Use BLA$(X,Y)=Z$

Notice the "$" after BLA.

I code, therefore I am.

Pixelrobin

Thanks iPrice, but can you also explain DIM to me?

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

magicsnake

Hi, I have the EU version of petit computer but I have a problem with 32x32 sprites, here is my code :
"loads my custom color :
LOAD"COL1:COLCAR2"
"loads my custom sprites :
LOAD"SPU0:CARD1"
"Settings
SPSET 0,1,0,0,0,0,32,32
SPOFS 0,100,100,0
SPSCALE 0,200,0

and when I run the program it shows a 32*32 sprite but composed of the top 4 16*16 sprites/squares of the sprite sheet instead of the two top 16*16 square plus the 2nd row two 16*16 squares...
example
sprite sheet :
1 2 3 4 5 6 7 8
9 10 11 12 13 14
what I want :
1 2
9 10
what I get :
1 2
3 4

Can someone help me ?

magicsnake

Pixelrobin

@magicsnake did you edit the sprite in 32 by 32 conditions under the sprite part of CHRED?

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

iprice

Bluerobin2 wrote:

Thanks iPrice, but can you also explain DIM to me?

DIM simply sets up a "box" to hold certain a piece of information in. Information can be stored in single or multi-dimensional arrays. A single dimensioned array will be something like DIM HOUSE(NUM) whereas a multi-dimensioned array will be HOUSE(X,Y). HOUSE(NUM) allows you to look up the array using just one number eg HOUSE(7)=23 or HOUSE(14)=3 etc. Multi-dimensioned arrays are excellent for returning a value at a co-ordinate (X,Y) so HOUSE(3,7)=21. With multi-dimensioned arrays you can return a value from a map, grid-reference or location in a game.

Imagine DIM as giving you a number of matchboxes, each will hold one item (either a number or a piece of text). DIM doesn't care what you put into the box as long as you clearly label the type of things you are putting into it. Eg for numbers it just requires DIM NUMBER(XX). This will allow you to hold only numbers in the array. If you want to hold strings (pieces of text) you need to add a $ to the array - eg DIM NUMBER$(19). Then you can use NUMBER$(1)="17" or NUMBER$(1)="HELLO Y'ALL!" The $ clearly identifies the array (matchbox) as holding a piece of text, rather than a number.

When you use DIM you must include the maximum number of "matchboxes" you have to put things in. Computers aren't like humans though - the "matchboxes" in a computer's brain start at number zero - in human terms zero matchboxes mean that there are no matchboxes (and you can't put something in a matchbox that doesn't exist). When using arrays on a computer you have to start at box zero. So an array to hold 20 items would be DIM MATCHBOX(19) = all the matchboxes from 0 to 19. It's still 20 items, but rather than starting from 1 like a human would, the computer starts at 0.

So -
DIM NUM(30) will hold 31 numbers eg. 17 or 24 or 987231

DIM NAME$(30) will hold 31 names or pieces of text eg "FRED" or "JOHN" or "THAT GUY THAT LIVES DOWN THE ROAD"

You can access arrays with NUMBER=NUM(25) or NUM(25)=17 or HI-SCORE$(3)="JAMES" etc. Bare in mind you can't access arrays with a number larger than the maximum number you specified with DIM. If you had DIM NUMBER(10) and tried to use A=NUMBER(15) then you'd get an OUT OF BOUNDS error as you tried to access a "matchbox" that doesn't exist - you only gave the computer 11 matchboxes and then you asked it to open box number 15. It'll get it's knickers in a twist!

The array name is not important, but I always give my arrays names based on what they will store inside them. An array called A() may mean anything - you might know what it means now, but in a week's time you will have forgotten.

Hope that helps.

I code, therefore I am.

Slayer

People are UP now?
Anyway, I'm having issues with my OS. I tried the menu, and putting in this:
Dungeon Adventure
By swordx
Petit Farm
By Morphtorok
Minecraft DS
By IAmAPerson
But it was broken up in run mode. So I ran it in gallery and it went through the name process, displayed the menu briefly, and stopped.

I have nothing really to say about myself.

Pixelrobin

@iprice thanks for all of your help. You should repost that into the tutorial thread.

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

iprice

slayer wrote:

Anyway, I'm having issues with my OS. I tried the menu, and putting in this:

I would be wary of adding games to any OS that you yourself didn't create. The reason being that PTC uses GLOBAL variables - meaning that a value or array can be accessed anywhere in the app at any time. If you have the same variables/arrays in two or more programs, they can cause conflict.

Edited on by iprice

I code, therefore I am.

magicsnake

@Bluerobin2
What do you mean, how do you do that ? arn't the settings I've put in the code enough ?

magicsnake

Pixelrobin

@magicsnake you also can draw the sprites so that they will fit. I had the same problem. In CHRED (or PTCUtilites), make the selection box 2x2 and draw as you normally would but with the selection box double size (32 by 32). When you return to 1x1 (16 by 16), The sprites should appear mixed up. However, loading them with 32 by 32 properties will load them properly.

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

Slayer

iprice wrote:

slayer wrote:

Anyway, I'm having issues with my OS. I tried the menu, and putting in this:

I would be wary of adding games to any OS that you yourself didn't create. The reason being that PTC uses GLOBAL variables - meaning that a value or array can be accessed anywhere in the app at any time. If you have the same variables/arrays in two or more programs, they can cause conflict.

I haven't used any variables or arrays to my knowledge. It's simply a bug due to the fact that I never told it to continue after displaying the menu. The code stopped at where I said to load Dungeon Adventure, Petit Farm, or Minecraft DS...

I have nothing really to say about myself.

iprice

slayer wrote:

I haven't used any variables or arrays to my knowledge. It's simply a bug due to the fact that I never told it to continue after displaying the menu. The code stopped at where I said to load Dungeon Adventure, Petit Farm, or Minecraft DS...

How can you create an OS without a single variable? Or is it simply just a loading menu (without variables :/)?

I code, therefore I am.

magicsnake

@Bluerobin2
So basically I went to CHRED, loaded the sprite, changed 16*16 (2*2) to 8*8 (1*1) and saved it but it doesn't change anything and when I reload the sprite in CHRED it goes back to 2*2 ...
Do I have to redraw the sprite or did I misunderstood you at some point ?

magicsnake

Slayer

iprice wrote:

slayer wrote:

I haven't used any variables or arrays to my knowledge. It's simply a bug due to the fact that I never told it to continue after displaying the menu. The code stopped at where I said to load Dungeon Adventure, Petit Farm, or Minecraft DS...

How can you create an OS without a single variable? Or is it simply just a loading menu (without variables :/)?

Steam DS is pretty simple, right now it's a loading menu, I'm eventually going to add more to make it Steam-like.

I have nothing really to say about myself.

GraphicGenius

I took my time to make this:
Untitled

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. Wait was that just a joke?

3DS Friend Code: 1478-3545-5136 | Nintendo Network ID: GreatGamer123

iprice

programmerpro wrote:

I took my time to make this:
Untitled

I'm not seeing anything

I code, therefore I am.

Please login or sign up to reply to this topic