Author Topic: Tilemapping help  (Read 7194 times)

0 Members and 1 Guest are viewing this topic.

Offline ClainBill

  • LV2 Member (Next: 40)
  • **
  • Posts: 21
  • Rating: +1/-0
  • Everybody's just a FREAK
    • View Profile
    • My still developing website
Tilemapping help
« on: February 04, 2019, 12:52:40 pm »
Because I'm organised  8) ,  I would like to NOT include my tile map code in the same program the rest of my code is in, Instead I can just put the map in another program (let's call it MAPCODE for fun) and in my main program refer the contents of this code and store it into GDB1

Let's say that:
Code: [Select]
[01010101010101010101010101010101010101010101010101010101]->GDB1
[01000000000000000000000000000000000000000000000000000001]
[01000002030400000000000000000000000000000000000000000001]
[01000005060700000000000000000000000000000000000000000001]
[01000008090A00000000000000000000000000000000000000000001]
[010000000B0000000000000000000000000000000000000000000001]
[010000000B0000000000000000000000000000000000000000000001]
[01000000000000000000000000000000000000000000000000000001]
[01000000000000000000000000000000000000000000000000000001]
[01010101010101010101010101010101010101010101010101010101]
Is the contents in MAPCODE.
How?
How do I put this info into another program? so that now i don't have to scroll past this huge mass of code every time I'm going to change one small detail?
edit: This is in Axe in case anyone wasn't sure
« Last Edit: February 04, 2019, 01:12:21 pm by ClainBill »
"I don't think I've ever looked in this drawer." (opens it) "Wow, a gun!"

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Tilemapping help
« Reply #1 on: February 04, 2019, 01:14:53 pm »
There is this.

Code: [Select]
prgmNAME | The code from the external program is parsed as if it completely replaced this command in the main program. (Similar to the C++ "include")
Personally I like putting data like sprites and tilemaps to appvar.
Sig wipe!

Offline ClainBill

  • LV2 Member (Next: 40)
  • **
  • Posts: 21
  • Rating: +1/-0
  • Everybody's just a FREAK
    • View Profile
    • My still developing website
Re: Tilemapping help
« Reply #2 on: February 04, 2019, 01:22:57 pm »
So I could just put
Code: [Select]
prgmMAPCODE and because in that program I already said in the first row [...]->GDB1 that's now all I need?

I tried it and it throws an error : BAD HEADER ?
"I don't think I've ever looked in this drawer." (opens it) "Wow, a gun!"

Offline ClainBill

  • LV2 Member (Next: 40)
  • **
  • Posts: 21
  • Rating: +1/-0
  • Everybody's just a FREAK
    • View Profile
    • My still developing website
Re: Tilemapping help
« Reply #3 on: February 04, 2019, 02:43:38 pm »
figured it out, for future reference

Main Program (called MAINSRC)
Code: [Select]
.MAIN
prgmMAPCODE

Sub program (called MAPCODE)
Code: [Select]
..MAPDATA
[01010101010101010101010101010101010101010101010101010101]->GDB1
[01000000000000000000000000000000000000000000000000000001]
[01000002030400000000000000000000000000000000000000000001]
[01000005060700000000000000000000000000000000000000000001]
[01000008090A00000000000000000000000000000000000000000001]
[010000000B0000000000000000000000000000000000000000000001]
[010000000B0000000000000000000000000000000000000000000001]
[01000000000000000000000000000000000000000000000000000001]
[01000000000000000000000000000000000000000000000000000001]
[01010101010101010101010101010101010101010101010101010101]

The sub program has to have a double dot .. and then a name so that axe knows its a sub program, then use prgmMAPDCODE (in this case) as usual
"I don't think I've ever looked in this drawer." (opens it) "Wow, a gun!"

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: Tilemapping help
« Reply #4 on: February 04, 2019, 02:45:11 pm »
Thanks for posting the answer for future reference!

Offline ClainBill

  • LV2 Member (Next: 40)
  • **
  • Posts: 21
  • Rating: +1/-0
  • Everybody's just a FREAK
    • View Profile
    • My still developing website
Re: Tilemapping help
« Reply #5 on: February 04, 2019, 02:47:18 pm »
you know me  ^-^
"I don't think I've ever looked in this drawer." (opens it) "Wow, a gun!"