DSiWare Forum

Topic: Petit Computer

Showing 6,481 to 6,500 of 9,486

AuthorMessage
Avatar

Pootrick2

6,481. Posted:

Can anyone make The Legend Of Zelda PTC page on the petit computer wiki. Because it was confusing for me for some reason

I LOVE petit computer AND anything Zelda/Minecraft related (i own all zelda games)

3DS FC=0919-9700-5328

3DS Friend Code: 0919-9700-5328 | Nintendo Network ID: Pootrick2 | Twitter: Pootrick2ithink

AuthorMessage
Avatar

randomous

6,482. Posted:

@IAmAPerson Hexadecimal is just a different way of representing numbers. Our regular number system goes:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10.... 99, 100... 999, 1000

Notice that we increase the number of digits on the tenth number (then 100th, then 1000th); this is because we use the decimal system, or base 10. This means that each digit can represent an extra power of 10 values, so 1 digit can represent 10^1 values, 2 digits can represent 10^2, etc. Hexadecimal is base 16, so we don't increase the number of digits until we reach the 16th number. This means that each hex digit can represent an extra power of 16 values, so 1 digit can represent 16^1 values, 2 digits can represet 16^2 or 256, etc. This means we need to "make up" some digits:
1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10.... FF, 100.... FFF, 1000

In this case, A has the decimal value 10, B has the decimal value 11, etc. 10 in hexadecimal has the value 16 in decimal. 100 has the value 256.

I didn't really explain it well, so here's the Wikipedia page (which may actually be more confusing): http://en.wikipedia.org/wiki/Hexadecimal

In Petit Computer, the HEX command will just take a decimal value (say 17) and convert it into a hexadecimal string (which is &H11; the &H signifies that the number should be interpreted as 11 in hex, not 11 in decimal). Hexadecimal is particularly useful in computer programming (and thus Petit Computer) because each digit of hex can represent 4 bits. Hey, you know what else is 4 bits? The information that makes up sprites! Remember, a sprite pixel can only contain one of 16 colors, so each pixel can be represented by 4 bits. This is why you use HEX to represent the data in a sprite... it's just easier that way. Also, 2 hex digits can represent a full byte, which can take on the values of 0-255 (which is also useful).

Edited on by randomous

randomous

AuthorMessage
Avatar

Gimmemorecoinz

6,483. Posted:

Discostew wrote:

@Gimmemorecoinz

Getting tiles from a 2D array that makes up your level is simple. If you are using level-based coordinates (not tile-based coordinates) to grab the tiles, you must convert to tile-space by dividing the level-space coordinates by the pixel size of the tiles. So, if the tiles are 8x8, then you divide the level-space coordinates by 8 to make them into tile-space. You then just take the result and use them to grab the tiles in the array.

TILE=LVLARRAY(POSX/8,POSY/8)

Don't worry about using FLOOR when inputting values into arrays like this, because it rounds down the inputs automatically. Using FLOOR on these only wastes time.

For the 2nd part of your question (as seeing you're using my tutorial), BGCX and BGCY are meant for representing the top-left corner of the viewable area of the map. Using them for setting tiles would only result in setting tiles based on those coordinates. You could theoretically use them to be able to set tiles in a specific part of the viewable area (like in the middle as you asked) by doing something like this — LVLARRAY((BGCX+128)/8,(BGCY+96)/8)=TILE — but this'll set tiles relative to the screen vs the level itself, so every time the BG layer shifts, the "middle" ends up changing. Maybe that's what you want, so I won't argue. In my opinion, always try to set tiles based on the level itself. It is simply the more manageable method imo. Just like with my project, everything is based in level-space. If I want to get tiles for collision purposes, I convert from level-space to tile-space by dividing the coordinates by 16 (since my tiles are 16x16, made up of a 2x2 8x8 tile section). If I'm placing a sprite on screen, I convert from level-space to screen-space by offsetting the position by the position of the "camera".

I'm trying to make it so a sprite on the screen (the 'player' ) is able to place tiles right now. I want the tiles to be placed, basically right where the 'player' sprite is. I'm thinking of making a terraria clone or something that uses very LARGE maps. I could even increase the size of the array, by the looks of it.
Hmmhmm.. any tips on how I should handle a player sprite in this?

Got a project? PM ME on here!
Youtube: lostkitty64x
Want help with coding? PM ME! PM ME PM ME!! XD
FC: WIll post later.
Systems I own: ds lite, 3DS, PC/gaming, steam platform. I play alot of games. Just ask ! Minecraft anyone? :D

AuthorMessage
Avatar

Pootrick2

6,484. Posted:

I just got PTCUTLITIES does anyone know how to load a png into the character editor
Quick response Plzzzz

Edited on by Pootrick2

I LOVE petit computer AND anything Zelda/Minecraft related (i own all zelda games)

3DS FC=0919-9700-5328

3DS Friend Code: 0919-9700-5328 | Nintendo Network ID: Pootrick2 | Twitter: Pootrick2ithink

AuthorMessage
Avatar

Discostew

6,485. Posted:

Gimmemorecoinz wrote:

Discostew wrote:

@Gimmemorecoinz

Getting tiles from a 2D array that makes up your level is simple. If you are using level-based coordinates (not tile-based coordinates) to grab the tiles, you must convert to tile-space by dividing the level-space coordinates by the pixel size of the tiles. So, if the tiles are 8x8, then you divide the level-space coordinates by 8 to make them into tile-space. You then just take the result and use them to grab the tiles in the array.

TILE=LVLARRAY(POSX/8,POSY/8)

Don't worry about using FLOOR when inputting values into arrays like this, because it rounds down the inputs automatically. Using FLOOR on these only wastes time.

For the 2nd part of your question (as seeing you're using my tutorial), BGCX and BGCY are meant for representing the top-left corner of the viewable area of the map. Using them for setting tiles would only result in setting tiles based on those coordinates. You could theoretically use them to be able to set tiles in a specific part of the viewable area (like in the middle as you asked) by doing something like this — LVLARRAY((BGCX+128)/8,(BGCY+96)/8)=TILE — but this'll set tiles relative to the screen vs the level itself, so every time the BG layer shifts, the "middle" ends up changing. Maybe that's what you want, so I won't argue. In my opinion, always try to set tiles based on the level itself. It is simply the more manageable method imo. Just like with my project, everything is based in level-space. If I want to get tiles for collision purposes, I convert from level-space to tile-space by dividing the coordinates by 16 (since my tiles are 16x16, made up of a 2x2 8x8 tile section). If I'm placing a sprite on screen, I convert from level-space to screen-space by offsetting the position by the position of the "camera".

I'm trying to make it so a sprite on the screen (the 'player' ) is able to place tiles right now. I want the tiles to be placed, basically right where the 'player' sprite is. I'm thinking of making a terraria clone or something that uses very LARGE maps. I could even increase the size of the array, by the looks of it.
Hmmhmm.. any tips on how I should handle a player sprite in this?

With placing tiles where the sprite is, what you should do is take the player's position (which I assume is level-based that gets converted to screen-space for displaying it), and work off of that, offsetting that position based on which direction the sprite is located (in level-space), and then convert to tile-space (divide coordinates by 8).

"What fun is there in making sense?"
Lazer Light Studios - Home of the MM2 PTC project

Pokemon 3DS Friend Safari - Ice - Spheal, Sneasel, Lapras

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

AuthorMessage
Avatar

InsertPi

6,486. Posted:

Pootrick2 wrote:

I just got PTCUTLITIES does anyone know how to load a png into the character editor
Quick response Plzzzz

@Pootrick2 go to the CHR editor, click the box next to Load Standard CHR and select BGF0. Here you can easily edit it, OR you can click Load with current palette. Select your image, and you're done! Click Make QR Code and I'm sure you'll know what to do from there.

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: @PhilLovesPi

AuthorMessage
Avatar

Pootrick2

6,487. Posted:

Thanks your a life saver

I LOVE petit computer AND anything Zelda/Minecraft related (i own all zelda games)

3DS FC=0919-9700-5328

3DS Friend Code: 0919-9700-5328 | Nintendo Network ID: Pootrick2 | Twitter: Pootrick2ithink

AuthorMessage
Avatar

InsertPi

6,488. Posted:

Pootrick2 wrote:

Thanks your a life saver

no problem.

I'm gonna start working on render distance in a few days (maybe Saturday) so that the lag on 64x64 worlds will be fixed (Along will a lot of lag period). If you REALLY wanna see lag, load a 64x64 world, look left until you see then entire map, then switch to quality 1. If you get 0.2+ FPS, you're lucky.

Edited on 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.

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

AuthorMessage
Avatar

Pootrick2

6,489. Posted:

http://www.spriters-resource.com/ best website ever for sprites
@Discostew You would like this one http://www.spriters-resource.com/pc_computer/mushroomkingdomf...

Edited on by Pootrick2

I LOVE petit computer AND anything Zelda/Minecraft related (i own all zelda games)

3DS FC=0919-9700-5328

3DS Friend Code: 0919-9700-5328 | Nintendo Network ID: Pootrick2 | Twitter: Pootrick2ithink

AuthorMessage
Avatar

InsertPi

6,490. Posted:

@randomous how do you use the command where you can save a file of a name of your choice (like the screenshot system in village) and can you load a file with a name of your choice? I'm gonna start working on more worlds for MCDS.

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: @PhilLovesPi

AuthorMessage
Avatar

calc84maniac

6,491. Posted:

IAmAPerson wrote:

@randomous how do you use the command where you can save a file of a name of your choice (like the screenshot system in village) and can you load a file with a name of your choice? I'm gonna start working on more worlds for MCDS.

It's the same as normal SAVE and LOAD, but you supply a custom string instead of a hardcoded one. Basically something like: SAVE "GRP:"+NAME$

calc84maniac

AuthorMessage
Avatar

LeviCelJir

6,492. Posted:

Leviceljir wrote:

@IAmAPerson Can I change the sky to black? or red? or green? If so, how???

Hi I'm Levi and I like Bloopys :^)

AuthorMessage
Avatar

twinArmageddons

6,493. Posted:

Leviceljir wrote:

Leviceljir wrote:

@IAmAPerson Can I change the sky to black? or red? or green? If so, how???

look for a GFILL in the code and just mess with the numbers until you get the desired results

get in loser we're going titan hunting

3DS Friend Code: 2879-0639-8952 | Nintendo Network ID: merp_aottg

AuthorMessage
Avatar

ChangeV

6,494. Posted:

randomous wrote:

I'm sure @Discostew has already thought of this (probably ages ago too), and I'm sure others have as well, but I just thought of it myself and thought I'd share.

I've made a program that shows how to animate all BG tiles that take on a certain value. For instance, if you're making an RPG and you've got some SCR file with water or torches in it, you can call some of the functions I've made in the program below and all torch/water tiles will animate according to the information you provide (as long as you've drawn the animation). The cool part is that no matter how many instances of the tile are currently on the BG, the animation will take the same impact on time. The animation will use the BGs directly next to the base BG, just like animated sprites.

It works by reading in the tile information (using CHRREAD) for the BG tiles you specify to animate, as well as the frames that follow (according to your specification). It then goes through and updates the base BG tile (using CHRSET) whenever it realizes that it's reached the time limit for that particular animation.

In order to use it yourself, just get rid of the "DEMO" section, but include all the rest of the code in your project. Make sure that any BG tile you want to animate is followed by the animation frames (just like a sprite sheet animation). Figure out which BG tiles you'd like to animate, then stick their IDs in the "BGCHR" data section (get rid of the old data). Make sure you put a -1 after the last ID, this is important! Next, figure out how many frames you'd like the BG tiles to animate through, and put that in the "BGFRAME" section. Finally, decide how much time you'd like between each frame and put it in the "BGTIME" section. This is all the same data you'd use to animate sprites and such.

Let's look at an example. In the demo program provided, BGCHR has the following data:
40,520,-1

This means that we want BG tile 40 and 520 to be animated (whenever they appear, no matter what). The -1 specifies the end of the data section. Next, we've got BGFRAME:
3,4

Notice there's no -1 here; you don't need -1 on any data section unless it's BGCHR (it's just a semantic I chose). These numbers mean that BG tile 40 will have 3 frames of animation, while BG tile 520 will have 4. Finally, BGTIME:
15,4

This means that BG tile 40 will change frames once every 15 game frames, or VSYNC 1's. BG tile 520 will change frames once every 4 game frames.

If you need help with it, or just don't understand what this is all about, please let me know!

Untitled

my Exerion look-alike also uses BG animation for fake 3D scroll.
I posted 2 places long ago (this thread page 259, and tutorial thread) but I guess no one read it yet.
http://www.nintendolife.com/forums/dsiware/petit_computer?sta...
http://www.nintendolife.com/forums/dsiware/petit_computer_tut...

ChangeV

AuthorMessage
Avatar

LeviCelJir

6,495. Posted:

twinArmageddons wrote:

Leviceljir wrote:

Leviceljir wrote:

@IAmAPerson Can I change the sky to black? or red? or green? If so, how???

look for a GFILL in the code and just mess with the numbers until you get the desired results

there are a lot gfills in the code...

Hi I'm Levi and I like Bloopys :^)

AuthorMessage
Avatar

mystman12

6,496. Posted:

Can anyone tell me how to use PTCutilities to create QR codes?

I don't believe it! I won't believe it! There isn't a pinball right here! What kind of world do we live in, where there isn't a pinball right here? Well, I'm going to do my part! I'm gonna— umm... build a pinball! - Homestar Runner (Sort of)
Future Pinball blog
Infinite Office for PTC!

3DS Friend Code: 0259-0292-5888 | Nintendo Network ID: mystman12 | Twitter: mystman12

AuthorMessage
Avatar

twinArmageddons

6,497. Posted:

@Leviceljir just mess with all of them

get in loser we're going titan hunting

3DS Friend Code: 2879-0639-8952 | Nintendo Network ID: merp_aottg

AuthorMessage
Avatar

InsertPi

6,498. Posted:

twinArmageddons wrote:

@Leviceljir just mess with all of them

NONONO!!! Don't do that! That'll seriously screw something up. The GFILLs on lines 78 and 79 are the ones for the floor and sky.

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: @PhilLovesPi

AuthorMessage
Avatar

twinArmageddons

6,499. Posted:

IAmAPerson wrote:

twinArmageddons wrote:

@Leviceljir just mess with all of them

NONONO!!! Don't do that! That'll seriously screw something up. The GFILLs on lines 78 and 79 are the ones for the floor and sky.

whoopsy lol
now i'm tempted to do that... e-e

Edited on by twinArmageddons

get in loser we're going titan hunting

3DS Friend Code: 2879-0639-8952 | Nintendo Network ID: merp_aottg

AuthorMessage
Avatar

LeviCelJir

6,500. Posted:

twinArmageddons wrote:

IAmAPerson wrote:

twinArmageddons wrote:

@Leviceljir just mess with all of them

NONONO!!! Don't do that! That'll seriously screw something up. The GFILLs on lines 78 and 79 are the ones for the floor and sky.

whoopsy lol
now i'm tempted to do that... e-e

well good thing i ignored you... i don't even wanna know what happens when you start randomly messing with it :p

Hi I'm Levi and I like Bloopys :^)