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?
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).
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).
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'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
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.
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!
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 =)
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.
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.
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
@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.
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.
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.
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.
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.
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:
Forums
Topic: Petit Computer
Posts 941 to 960 of 9,620
Please login or sign up to reply to this topic