Forums

Topic: Petit Computer

Posts 941 to 960 of 9,620

pHUNTERq

Discostew wrote:

Are you trying to access the GRP section like an array (with a range from 0 to 49151), indexing it with a single value? Try the following line...

VALUE=GSPOIT(IDX AND 255,IDX / 256)

Where IDX is the value that ranges from 0 to 49151. Increment IDX to get the very next byte, whether that is the next pixel on the line, or the first pixel on the next line.

About your method earlier. 2x3 may equal 6, but with a GRP file, acting like an image, getting data at (2,3) would actually use the formula ((y * 256)+x), making it ((3*256)+2)=770. So, with the line I displayed earlier, you can set IDX to 770, and increment IDX after you read each byte, and it'll increment sequentially, because 770 AND 255 = 2, and 770 / 256 = 3.0078 (but the GSPOIT function only accepts integers, so it floors it automatically to 3).

Alright, I implemented that into my program, it seems to be loading fine, but now I want to place a tile, or one pixel, within that 400 pixel range. So I would use the equation you said before to get the starting position, but then, what would I use to place that one pixel? Oh, and one more thing, I don't get how your using AND, I didn't know it could give numerical values, I thought it was just true or false. How does AND work? Or how does OR, XOR and NOT work with giving numerical values?

3DS Friend Code: 2105-8964-7467

shadowwinds

hello i need help building a ai like one from legend of zelda that will target and try to kill the player

omnomnomnom metaphorical cake
3ds friend code: 4640-0397-5198
current petit computer prodject: peticle:the epic pet battleing game

Discostew

pHUNTERq wrote:

Discostew wrote:

Are you trying to access the GRP section like an array (with a range from 0 to 49151), indexing it with a single value? Try the following line...

VALUE=GSPOIT(IDX AND 255,IDX / 256)

Where IDX is the value that ranges from 0 to 49151. Increment IDX to get the very next byte, whether that is the next pixel on the line, or the first pixel on the next line.

About your method earlier. 2x3 may equal 6, but with a GRP file, acting like an image, getting data at (2,3) would actually use the formula ((y * 256)+x), making it ((3*256)+2)=770. So, with the line I displayed earlier, you can set IDX to 770, and increment IDX after you read each byte, and it'll increment sequentially, because 770 AND 255 = 2, and 770 / 256 = 3.0078 (but the GSPOIT function only accepts integers, so it floors it automatically to 3).

Alright, I implemented that into my program, it seems to be loading fine, but now I want to place a tile, or one pixel, within that 400 pixel range. So I would use the equation you said before to get the starting position, but then, what would I use to place that one pixel? Oh, and one more thing, I don't get how your using AND, I didn't know it could give numerical values, I thought it was just true or false. How does AND work? Or how does OR, XOR and NOT work with giving numerical values?

Ok, GSPOIT is meant for reading, but for writing, you use GSET

GSET x-coor, y-coor, color

x-coor ranges from 0 to 255
y-coor ranges from 0 to 191
color ranges from 0 to 255 (meant to be a color from the palette)

To write like you would read (using IDX), do it like this

GSET IDX AND 255, IDX / 256, VALUE

As for AND, OR, etc. here is an easy to read interpretation of these bitwise operations (bit shifts not supports in Petit Computer).

http://en.wikipedia.org/wiki/Bitwise_operation

The reason why the use of AND would result in TRUE or FALSE is because with bitwise operations, a number that does not equal 0 is considered TRUE, and any number that equals 0 is considered FALSE. You'll have to read up on binary representation of numbers to understand why it works (though the link above should help with that).

Edited on by Discostew

Discostew

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

pHUNTERq

Alright thanks Disco

I'll have to start getting my feet wet in binary stuff, it seems useful.

In the meantime I'm going to fool around with random generation and see if I can randomly generate rooms or something. Might prove useful for my editor if someone doesn't feel like making a map, so they can just hit the random button and it will make one for them. I'll post whatever I come up with in the QR thread.

3DS Friend Code: 2105-8964-7467

Javo118

pHUNTERq wrote:

Alright thanks Disco

I'll have to start getting my feet wet in binary stuff, it seems useful.

In the meantime I'm going to fool around with random generation and see if I can randomly generate rooms or something. Might prove useful for my editor if someone doesn't feel like making a map, so they can just hit the random button and it will make one for them. I'll post whatever I come up with in the QR thread.

I just post a MapMaker on the QR threat, but I'm very inrterested on your generator, maybe it can help me for my v1.1 =)

btw i want to add you as friend on my 3ds, also Discostew, I add your fc already. Mine is 2921-9808-6856

Edited on by Javo118

3DS FC: 2921-9808-6856

Sprite

I put discostew and Javo118 on my friends list. Mine is 1075 1228 4183
3DS friends list by the way

Edited on by Sprite

I'm not saying let's kill all the stupid people, I'm just saying let's take off the warning labels, and see what happens.
Friend Code: 1075-1228-4183

Javo118

Sprite wrote:

I put discostew and Javo118 on my friends list. Mine is 1075 1228 4183
3DS friends list by the way

Added you =)
Try my app, that‛s my first app =P, want to know if I should make v1.1 hehe

3DS FC: 2921-9808-6856

Hale-Bopp

So, I've been lurking for a bit now, but I've had PC since it was released and I don't know about you guys, but it's my most 'played' software title on my 3DS right now, clocking in at over 160 hours. Ridiculous.

I've mostly been playing around with everyone's creations and working on a game of my own. Before PC, I hadn't touched BASIC since I was about 10 years old. That was over 25 years ago. I'm an old dude, heh. Anyways, since my knowledge of BASIC is very limited, I'm working on a fairly simplistic text adventure for now, but WOW have I learned a lot already in just the past few months alone. You guys are light years ahead of me, so I appreciate all that I'm learning from this thread alone along with just experimenting with my own ideas.

I love this program.

NNID: Hale-XF11

Twitter:

Discostew

Hale-Bopp wrote:

So, I've been lurking for a bit now, but I've had PC since it was released and I don't know about you guys, but it's my most 'played' software title on my 3DS right now, clocking in at over 160 hours. Ridiculous.

I just went and checked how much time I spent on Petit Computer. The highest was OoT3D at 20.5 hours....until I began using PTC. PTC is showing at 241.5 hours!

@Sprite and @Javo118

I've added you both to my 3DS Friend List.

Discostew

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

Javo118

Hale-Bopp wrote:

So, I've been lurking for a bit now, but I've had PC since it was released and I don't know about you guys, but it's my most 'played' software title on my 3DS right now, clocking in at over 160 hours. Ridiculous.

I've mostly been playing around with everyone's creations and working on a game of my own. Before PC, I hadn't touched BASIC since I was about 10 years old. That was over 25 years ago. I'm an old dude, heh. Anyways, since my knowledge of BASIC is very limited, I'm working on a fairly simplistic text adventure for now, but WOW have I learned a lot already in just the past few months alone. You guys are light years ahead of me, so I appreciate all that I'm learning from this thread alone along with just experimenting with my own ideas.

I love this program.

I‛m not too experimented, but I will try to help you whit anything you need about PTC.
You should upload any creation yours =)

3DS FC: 2921-9808-6856

Hale-Bopp

Discostew wrote:

I just went and checked how much time I spent on Petit Computer. The highest was OoT3D at 20.5 hours....until I began using PTC. PTC is showing at 241.5 hours!

That's amazing! My 2nd most played title is Resident Evil: Revelaitons at about 80 hours. With such a difference in time played, I don't know if anything will ever top Petit for me, lol.

Javo118 wrote:

I‛m not too experimented, but I will try to help you whit anything you need about PTC.
You should upload any creation yours =)

I will definitely appreciate any and all help I can get when the time comes. I'd say I'm about 3/4 done with my game. Not enough yet that I want to share it just yet, but hopefully I can get more motivated to finish sooner rather than later. I'm a terrible procrastinator.

Edited on by Hale-Bopp

NNID: Hale-XF11

Twitter:

shadowwinds

hey i just added Sprite to my friend list on my 3ds
my code is: 4640-0397-5198
hey let me know if youve added me also i need help with making an ai system that acts mutch like a enemy from the legend of zelda: a link to the past

Edited on by shadowwinds

omnomnomnom metaphorical cake
3ds friend code: 4640-0397-5198
current petit computer prodject: peticle:the epic pet battleing game

KiwiFruit

@shadowwinds You can have an other sprite slowly home in to your character's position.

Spset 1,...,0
Spofs 1,herox,heroy,1

You can use the remainer %(Thank you PetiSnail for mentioning this awesome sign to help balance the load in my Witch game) function to slow down the enemy.

If MAINCTNL%4==4 then spofs 1,herox,heroy,1

Basically you want to put this in a loop along with your character's movement button, placement update etc. Sorry it is kinda vague. Hopefully it'll get you thinking of a solution.

KiwiFruit

Hale-Bopp

Anyone know a reliable way of converting MIDI files to MML for use in Petit? I've tried several programs and none of them seem to create code that's compatible with Petit. I get a bit lost in all the code these programs create, so editing them is very difficult to wrap my head around.

NNID: Hale-XF11

Twitter:

KiwiFruit

ChangeV stated in the QR thread replying to shadowwind

Sure. you can use the MML music.
(It took several days to convert MID into MML format. MID file -> printout score with Final NotePad2012 -> wrote MML on paper -> petit Nyancat!)

I tried EDPCOMPO for Petit Computer. But I do wish it could print the MML to show so I could write it on paper, instead of figuring out how to extract from a GRP file.

I have a small program that I wrote that would BGMSETD the notes and then I can BGMPLAY 128 playback the music. I write the notes, D2D4R2, etc.Then when I'm finish, I would save the program. Copy one line, open the game I made, then paste, save game, then open music program, copy from another line, open game, paste, save game... etc. After that, I can still treak the music if needed. That's my method.

Edited on by KiwiFruit

KiwiFruit

shadowwinds

i cant seem to use this file converter to make music in my game (mostly becous i have not learned how to program mml yet) but if someone could tell me whats wrong with it also i checked the box that said: add spaces between notes
this is the midi file links:
http://www.castlevaniadungeon.net/Media/Midi/Bloody_Tears.mid
http://www.castlevaniadungeon.net/Media/Midi/Cross_Your_Heart...
this is the converters link:
http://www.netmftoolbox.com/tools/midi_to_mml.php

Edited on by shadowwinds

omnomnomnom metaphorical cake
3ds friend code: 4640-0397-5198
current petit computer prodject: peticle:the epic pet battleing game

Hale-Bopp

That's one of the converters I tried using and couldn't get to work properly. If you get it working, I'd love to hear about it.

I suppose if all else fails, I could try my best to actually write it all out by hand, though it would be incredibly cumbersome given the sheer amount of instrument tracks alone for each song I want to eventually convert. Not sure if I'll bother doing that or not.

NNID: Hale-XF11

Twitter:

Sprite

ADDED!

I'm not saying let's kill all the stupid people, I'm just saying let's take off the warning labels, and see what happens.
Friend Code: 1075-1228-4183

pHUNTERq

Javo118 wrote:

I just post a MapMaker on the QR threat, but I'm very inrterested on your generator, maybe it can help me for my v1.1 =)

btw i want to add you as friend on my 3ds, also Discostew, I add your fc already. Mine is 2921-9808-6856

Alright, I put my FC in my sig, so you can add me if you want, I'll start adding people to my friends list. I never really used the friend system on the 3ds so I'll try it out. Oh and if you didn't see already, I made a cave generator and posted it in the QR thread.

3DS Friend Code: 2105-8964-7467

Hale-Bopp

I finally figured out MIDI to MML conversion with a little help from a free program called qmidistudio.

I made a simple little 2-track MIDI file in Reaper to test it out. It's an original song I wrote that I'm thinking of putting in the game I'm working on.

I had to tweak some of the MML, such as adding a missing octave setting at the beginning of the first track, then set the instruments correctly, then adding extra rests at the end of each track to get the timing of the loop right and then finally adding loop points for each track. It's also important to note that qmidistudio seems to like MIDI 1 files, but crashes when I try to open a MIDI 0 file type.

Here's the QR code for my song if you wanna check it out:

Untitled

Edited on by Hale-Bopp

NNID: Hale-XF11

Twitter:

Please login or sign up to reply to this topic