Author Topic: Grammer Q&A  (Read 50886 times)

0 Members and 1 Guest are viewing this topic.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Q&A
« Reply #45 on: January 30, 2012, 08:58:38 pm »
Don't worry. I'm keeping the track of my pointers in my composite notebook XD
* TBO_Yeong loves to write down stuff in his composite notebook :D
Sig wipe!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Q&A
« Reply #46 on: January 30, 2012, 09:05:46 pm »
Ah, I meant with that call that you have .M19. At the end of that you will want to update your pointer.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Q&A
« Reply #47 on: January 30, 2012, 09:07:40 pm »
I thought I have to update my pointer only after I augment or reduce the data size D:
* TBO_Yeong just makes a separate label that updates the pointer
Sig wipe!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Q&A
« Reply #48 on: January 30, 2012, 09:12:32 pm »
Yes :) That is why all the other pointers are updated at the end of .M19 It is when augmenting or deleting any data.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Q&A
« Reply #49 on: January 30, 2012, 09:13:39 pm »
oh. I never knew that deleting var counts as reducing data size XP
All right! problem solved! XP
Sig wipe!

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Q&A
« Reply #50 on: February 24, 2012, 07:06:35 pm »
Code: [Select]

0→B
ClrDraw
Repeat getKey=15
If !randInt(0,4
Then
randInt(0,11→C
For(A,0,C
Pxl-On(0,randInt(0,92 //GIVES ME ERROR HERE
End
End
Text('50,0,B
DispGraph
Tangent(1,1
B+1→B
End
Stop
This doesn't work. D:
I don't think I did anything wrong, but it kinda freezes.
Sig wipe!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Q&A
« Reply #51 on: February 24, 2012, 07:52:21 pm »
I used solve(3 to make an error handler to figure this one out o.o It isn't really freezing, it is doing a For( loop from 0 to 0. The simple fix is to use randInt(1,12 and For(A,1,C. :)

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Q&A
« Reply #52 on: February 24, 2012, 08:28:25 pm »
oh, crap. That's what it was XP
Okee. I'll fix that. thanks. XD
Sig wipe!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Q&A
« Reply #53 on: February 24, 2012, 08:39:02 pm »
No problem, I like trying to find these little quirks. I should start documenting stuff like this...

Offline awalden0808

  • LV3 Member (Next: 100)
  • ***
  • Posts: 55
  • Rating: +6/-0
  • Cool shades, wears Waldo.
    • View Profile
Re: Grammer Q&A
« Reply #54 on: March 10, 2012, 11:36:21 am »
Sooo, I need to be able to first grab the number of bytes free in the RAM, then have a large tilemap (its a set of 8x8 sprites, but it needs to be pretty large) that will initially be blank unless otherwise specified. Then I need to edit that tilemap in-game by changing the tilemap data every time a sprite is drawn. It would kind of go like this:
Code: [Select]
://Code for free bytes of RAM.
://Code for generating tilemap (later will be stored into an appvar)
:Pt-Off(0,S,0,0,1,8)
://Code for editing tilemap with new sprite.
:ClrDraw
://Code for showing tilemap
:DispGraph
I'll apologize tomorrow for a bad mood today.

Spoiler For Spoiler:
My Qualifications:

I did a thing once.
I am known for my ability to focus intently on things that distract me from my actual work.
To me, the letter a stands for absolute. B stands for bemusement. C stands for circumlocution, and D stands for decoupage.
If I were president, I would give everyone Xboxes, computers, and national healthcare.
I am also known for my ability to write more than I actually need to write. Unless of course it is necessary that I write a lot. Then I write a little bit.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Q&A
« Reply #55 on: March 10, 2012, 11:49:18 am »
Hmm, well to get the amount of free RAM, you would need to use assembly. You can use the AsmPrgm command to do it:
AsmPrgmEFE542444DC9

You will probably need to remove about 17 from that if you are going to create a var with all the RAM. As for drawing tilemaps, there is actually a built in command for that. Use Pt-Change( and it will let you draw a tilemap using 8x8 tiles on the screen. I made two tools to help you here, too. One of them will help you create the tileset, easily, the other is a tilemap editor that will let you make very large tilemaps:

Map Editor
Sprite Editor
The screenies look like this:

If you need help on how to change those programs to output to a specific variable or use a certain size, let me know :) I also tend to put the editable stuff at the beginning of the program using vars like W and H for Width and Height.

Also, you can draw the tilemap each frame and then just draw the character after that so you won't have to put the character in the tilemap data itself.

EDIT: Fixed a typo

Offline awalden0808

  • LV3 Member (Next: 100)
  • ***
  • Posts: 55
  • Rating: +6/-0
  • Cool shades, wears Waldo.
    • View Profile
Re: Grammer Q&A
« Reply #56 on: March 11, 2012, 12:01:45 pm »
I guess it would help to know why I'm asking!
http://www.ticalc.org/archives/files/fileinfo/446/44632.html

Currently I'm using an alternate buffer and drawing the block sprites to that buffer, than recalling it as a background when I need to. All of the physics is determined by pixel tests, so I don't need to know what sprites are where. But if I'm going to be making the levels larger, I need to use tilemaps so I can change the view of the map when the player gets close to the edge (which I could do, if I knew how to use tilemaps!)

I want to know what the tilemap data is composed of, and how I could edit it based on the coordinates of the cursor. For example, say the cursor is at the 8th row and 8th column. How could I replace the tile at that position with the current block's sprite data?

I would like to know how the tilemaps are created so I could eventually create random tilemaps. Also, some info on the amount of memory tilemaps take up would be nice, so I can limit the generated tilemap size at the beginning of the code.
I'll apologize tomorrow for a bad mood today.

Spoiler For Spoiler:
My Qualifications:

I did a thing once.
I am known for my ability to focus intently on things that distract me from my actual work.
To me, the letter a stands for absolute. B stands for bemusement. C stands for circumlocution, and D stands for decoupage.
If I were president, I would give everyone Xboxes, computers, and national healthcare.
I am also known for my ability to write more than I actually need to write. Unless of course it is necessary that I write a lot. Then I write a little bit.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Q&A
« Reply #57 on: March 11, 2012, 02:08:50 pm »
IIRC, tilemap data are stored as series of number (aka tile numbers). so if you have 12x8 tilemap, you'll have 96 bytes of number from 0 to 255.
Also, for tiles, it's just a series of sprites in order.
Also, I once posted the scrolling tilemap routine for Grammer. Do you want it?
Sig wipe!

Offline awalden0808

  • LV3 Member (Next: 100)
  • ***
  • Posts: 55
  • Rating: +6/-0
  • Cool shades, wears Waldo.
    • View Profile
Re: Grammer Q&A
« Reply #58 on: March 11, 2012, 02:51:16 pm »
For the sprite data, is it hex or token?

And for the tilemap data, would 00 be the first sprite, and 01 be second sprite, and 10 as the 16th?

So if I have a set of sprites and wanted to have tile data that shows the first, second then third, would it look like this?:
000102

As for the routine, sure!
I'll apologize tomorrow for a bad mood today.

Spoiler For Spoiler:
My Qualifications:

I did a thing once.
I am known for my ability to focus intently on things that distract me from my actual work.
To me, the letter a stands for absolute. B stands for bemusement. C stands for circumlocution, and D stands for decoupage.
If I were president, I would give everyone Xboxes, computers, and national healthcare.
I am also known for my ability to write more than I actually need to write. Unless of course it is necessary that I write a lot. Then I write a little bit.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Q&A
« Reply #59 on: March 11, 2012, 03:08:26 pm »
for routine: http://ourl.ca/15015

sprite data, it can't be hex (unless you're storing in appvar or something, then ur fine.)
Same goes for map data.
Sig wipe!