Author Topic: Text  (Read 5664 times)

0 Members and 1 Guest are viewing this topic.

Offline V1mes

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +7/-0
  • Ma-Heki!
    • View Profile
Text
« on: December 14, 2012, 11:49:05 am »
Hi!

For AxeRL I'd like to make a log, that is, hit messages and level feeling messages etc. are all stored to a buffer so the player can go back and re-read them....
I'd like to be able to add strings and so on... and also to put text into a temp buffer to display in-game too.
Any advice?
« Last Edit: December 14, 2012, 11:49:24 am by V1mes »
Nom nom nom

Spoiler For Do a barrell roll:

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: Text
« Reply #1 on: December 14, 2012, 11:54:31 am »
I would try to store the message in such a way that a number corresponds to a certain word or expression so that the save file size is much smaller. This will also help with concatenation of strings, too. For example, if Str1 points to a list of pointers of words/expressions, to concatenate "the" and "game" you would just need to put the two numbers next to each other in the text file.

I am not sure of a good method in Axe to resize buffers or variables, though.

Offline V1mes

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +7/-0
  • Ma-Heki!
    • View Profile
Re: Text
« Reply #2 on: December 14, 2012, 12:03:20 pm »
Hmmm the log would never be saved, it would get too large!  ;D
Do you mean like
Code: [Select]
"The"[00]->Str1
"game"[00]
etc...
Nom nom nom

Spoiler For Do a barrell roll:

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: Text
« Reply #3 on: December 14, 2012, 12:17:32 pm »
Yes, that is what I mean :)
Code: [Select]
"The"→Str1
"game"→Str2
"is"→Str3
"lost"→Str4
...
Data(Str1^r,Str2^r,Str3^r,Str4^r,...→GDB1
Then, if your log looked like 0102030400 (to end the message, I am using 00) and was stored in L3:
Code: [Select]
L3→A
Text(0
While {A++}
Text {*2+GDB1-2}ʳ,' '▸Char
End
Text '.'▸Char
That will display the string at (0,0).

EDIT: Edited some syntax as per Jacobly insistence XD
EDIT2: I didn't know that 'Text ' is different from Text( >.>

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Text
« Reply #4 on: December 14, 2012, 12:59:07 pm »
You can also use the StdDev(pointer_to_zero_terminated_strings, offset) command with that. It'll work fine.
« Last Edit: December 14, 2012, 01:02:31 pm by Matrefeytontias »

Offline V1mes

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +7/-0
  • Ma-Heki!
    • View Profile
Re: Text
« Reply #5 on: December 14, 2012, 01:01:46 pm »
? Never seen that command before... Whoops! ;D
Nom nom nom

Spoiler For Do a barrell roll:

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: Text
« Reply #6 on: December 14, 2012, 01:51:43 pm »
It's a wonderful way to handle strings, as long as you have fewer than 256 of them. The assembly code for returning the string given its index is beautifully simple.
"No tools will make a man a skilled workman, or master of defense, nor be of any use to him who has not learned how to handle them, and has never bestowed any attention upon them. . . . Yes, [] the tools which would teach men their own use would be beyond price."—Plato's The Republic, circa 380 BC

Offline V1mes

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +7/-0
  • Ma-Heki!
    • View Profile
Re: Text
« Reply #7 on: December 14, 2012, 01:54:02 pm »
And it is...
Nom nom nom

Spoiler For Do a barrell roll: