Author Topic: Tilemapping help  (Read 1604 times)

0 Members and 1 Guest are viewing this topic.

Offline ClainBill

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +1/-0
  • Nuckleheadmcspasatron
    • View Profile
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 »
ClainBill YouTube

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

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +1/-0
  • Nuckleheadmcspasatron
    • View Profile
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 ?
ClainBill YouTube

Offline ClainBill

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +1/-0
  • Nuckleheadmcspasatron
    • View Profile
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
ClainBill YouTube

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4557
  • Rating: +716/-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

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +1/-0
  • Nuckleheadmcspasatron
    • View Profile
Re: Tilemapping help
« Reply #5 on: February 04, 2019, 02:47:18 pm »
you know me  ^-^
ClainBill YouTube