Author Topic: Variable Help  (Read 6735 times)

0 Members and 1 Guest are viewing this topic.

Offline benedikt.muessig

  • LV2 Member (Next: 40)
  • **
  • Posts: 35
  • Rating: +2/-0
    • View Profile
    • My homepage
Variable Help
« on: May 29, 2014, 12:23:14 pm »

Hello,Theres no proper documentation for axe, no good tutorial.  :banghead:
I need help!!!!


I'm making a game and want to name vars.
I heard about naming vars with 5 letters.
How can I do this,
e.g. KNN0X and KNN0Y
I have multiple sprites and want have the format nameofspriteX and ~Y.
I have just no idea how to deal with variables i need more than A-Z and a need no constants.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Variable Help
« Reply #1 on: May 29, 2014, 12:29:03 pm »
If you want your variable to use the first two bytes of L1, do L1->°NAME, where NAME is the name of your variable (duh), which can be up to 13 characters. Then just use NAME as a normal variable.

It's true that there is no good tutorial, but the Commands.html file is very complete as a documentation and I learned most of Axe with it.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Variable Help
« Reply #2 on: May 29, 2014, 12:30:57 pm »
Oh, THAT is how you do that, always wondered how xD

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Variable Help
« Reply #3 on: May 29, 2014, 12:34:19 pm »
Yep it is. :P

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Variable Help
« Reply #4 on: May 29, 2014, 01:53:21 pm »
And you can use up to 13 characters in variable names, not just 5 ;)
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 Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Variable Help
« Reply #5 on: May 29, 2014, 01:58:39 pm »
And you can use up to 13 characters in variable names, not just 5 ;)
You're late to the party, I already helped him on IRC. :P Turns out he needed an array.
Also read my post closer.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Variable Help
« Reply #6 on: May 30, 2014, 07:01:25 am »
And how can one use the variable as a variable and not a pointer to something? (use its adress or something like this to avoid using using Lx areas)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Variable Help
« Reply #7 on: May 30, 2014, 07:08:20 am »
And you can use up to 13 characters in variable names, not just 5 ;)
You're late to the party, I already helped him on IRC. :P Turns out he needed an array.
Also read my post closer.
Sorry, was tired -.-

And how can one use the variable as a variable and not a pointer to something? (use its adress or something like this to avoid using using Lx areas)
That doesn't mean anything. The variable is not a pointer. Its value is pointed by a pointer (no joke!) but once you did "L5+04→°Wattouat", Wattouat is the value, not the pointer which is °Wattouat.
Moreover, A, B, etc also have pointers, which are °A, °B, etc so if you think you are using pointers with Wattouat, you are doing it too with A, B, etc.
Last of all, nothing prevents you from not using Lx ram areas by using other free ram areas.
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 Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Variable Help
« Reply #8 on: May 30, 2014, 07:09:37 am »
Okay, so I need to allocate to the custom variable an area. Thanks.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Variable Help
« Reply #9 on: May 30, 2014, 07:12:10 am »
Yeah, you just say "this variable will use those two bytes" and you give a pointer to two bytes. Whatever that pointer is. You can even do °A→°ThisIsA if you like useless things are using A for two different purposes in two different parts of your code and want it to have two names.
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