Author Topic: External variables in axe parser  (Read 9619 times)

0 Members and 1 Guest are viewing this topic.

Offline PC5LeGeND

  • LV3 Member (Next: 100)
  • ***
  • Posts: 54
  • Rating: +0/-1
  • TI-84 asm programmer
    • View Profile
External variables in axe parser
« on: May 30, 2012, 12:41:14 pm »
I want to create a game wich saves to lists like: L1 but it gives me an error when i trie it like: 5->L1(1)

Does anybody know how to do it ???

Please answer if it will work it will certainly be a fantastic game

TI-84/TI-83 ASM programmer

TI-84/TI-83 BASIC programmer

Java program





Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: External variables in axe parser
« Reply #1 on: May 30, 2012, 12:45:15 pm »
This is axe, not BASIC. L1 in axe is just another pointer to a location in free RAM. You can use appvars to store savefile data in. There are some great tutorials here about appvars.
If you like my work: why not give me an internet?








Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: External variables in axe parser
« Reply #2 on: May 30, 2012, 12:45:27 pm »
Here is a tutorial about external vars.
But maybe you don't need external vars, maybe writing to free Ram would be enough. I don't know what your game is but you may want to learn about pointers too :)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: External variables in axe parser
« Reply #3 on: May 30, 2012, 12:49:58 pm »
Well, if you want to save stuff temporarily wile in the program, you can use safe RAM areas like L1.
There are 712 bytes, and you can refer to them like: {L1}, {L1+1}, up to {L1+711}.
Of course, you can also store stuff into them.

As far as saving goes, like saving a high-score, etc. You can use appvars. To do this, you do:
Code: [Select]
GetCalc("appvTEST",2)->A     //make an appvar called TEST which is 2 bytes large and store it into pointer A
B->{A}r              //When B is your highscore, store it into A (the appvar) with 2 bytes. (using the superscript r)
I'd also refer to this tutorial about external vars.

Also, welcome here. :D Please introduce yourself in this thread: http://www.omnimaga.org/index.php?board=10.0


EDIT: :ninja:
« Last Edit: May 30, 2012, 12:58:10 pm by parser padwan »

Offline PC5LeGeND

  • LV3 Member (Next: 100)
  • ***
  • Posts: 54
  • Rating: +0/-1
  • TI-84 asm programmer
    • View Profile
Re: External variables in axe parser
« Reply #4 on: May 30, 2012, 12:55:32 pm »
I really need a sort of list so i can store coordinates in it can someone help me with that ?
TI-84/TI-83 ASM programmer

TI-84/TI-83 BASIC programmer

Java program





Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: External variables in axe parser
« Reply #5 on: May 30, 2012, 12:56:47 pm »
Well... You could at least have a look at those tutorials first :/
If you like my work: why not give me an internet?








Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: External variables in axe parser
« Reply #6 on: May 30, 2012, 12:56:48 pm »
If it is just when the game is running, try doing {L1+X} instead of L1(X-1) ;)
No need for external vars
« Last Edit: May 30, 2012, 12:58:42 pm by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: External variables in axe parser
« Reply #7 on: May 30, 2012, 12:57:26 pm »
I really need a sort of list so i can store coordinates in it can someone help me with that ?
Exactly. Rather than doing "L1(1)", do "{L1}". same with "L1(3)", do "{L1+2}".


EDIT: :ninja: again x.x
« Last Edit: May 30, 2012, 12:58:29 pm by parser padwan »

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: External variables in axe parser
« Reply #8 on: May 30, 2012, 01:05:19 pm »
Please read the tutorial!!!!
If you like my work: why not give me an internet?








Offline PC5LeGeND

  • LV3 Member (Next: 100)
  • ***
  • Posts: 54
  • Rating: +0/-1
  • TI-84 asm programmer
    • View Profile
Re: External variables in axe parser
« Reply #9 on: May 30, 2012, 01:13:58 pm »
Ok thank you it works
but another problem i want to know the dim from a list does it work with dim({L1}???
TI-84/TI-83 ASM programmer

TI-84/TI-83 BASIC programmer

Java program





Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: External variables in axe parser
« Reply #10 on: May 30, 2012, 01:14:34 pm »
L1 has no "dimension". The only thing we could say is that it contains 712 bytes.
It is just free ram, not a list.

In fact, Axe's syntax is close to Basic but it is not Basic ;)
« Last Edit: May 30, 2012, 01:15:29 pm by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline PC5LeGeND

  • LV3 Member (Next: 100)
  • ***
  • Posts: 54
  • Rating: +0/-1
  • TI-84 asm programmer
    • View Profile
Re: External variables in axe parser
« Reply #11 on: May 30, 2012, 01:29:36 pm »
You cant get like how many numbers it got
TI-84/TI-83 ASM programmer

TI-84/TI-83 BASIC programmer

Java program





Offline PC5LeGeND

  • LV3 Member (Next: 100)
  • ***
  • Posts: 54
  • Rating: +0/-1
  • TI-84 asm programmer
    • View Profile
Re: External variables in axe parser
« Reply #12 on: May 30, 2012, 01:45:30 pm »
But yeah it will be without lvl editor
TI-84/TI-83 ASM programmer

TI-84/TI-83 BASIC programmer

Java program





Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: External variables in axe parser
« Reply #13 on: May 30, 2012, 01:50:42 pm »
You cant get like how many numbers it got
There is no command like this but it is not that difficult to code in a subroutine. Assuming your list doesn't include any zeros just do this
_______________________

Fill(L1,711,0)
.this at the very beginning of your program

...
your code here
...
Return
.End of your code

Lbl Dim
0->r2
{r1}
While
 r2++
 {r1++}
End
Return r2
_______________________

Then using Dim(L1) (with an uppercase D) should return the number of elements "in" L1 (if I didn't do any mistakes)
« Last Edit: May 30, 2012, 02:25:49 pm by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: External variables in axe parser
« Reply #14 on: May 30, 2012, 01:52:06 pm »
PC5LeGeND, please try to avoid double posting.

Quote from: The Rules
Double-posting (posting two messages in the same topic in quick succession) is discouraged.
  • Double-posting to "bump" a thread that hasn't been replied to for a day is permitted.
  • For special cases (such as a major project update), use your own discretion.
  • Remember that you can always use the "MODIFY" buttons to edit the content of a post.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.