You are not logged in.
Pages: 1
is there any way to store text stings? i've seen level names being read from $LEVEL_NAME. is that a variable like any other?
https://discord.gg/w8JqM7m ---> Open Surge's Discord server
Offline
unfortunately no. these are predefined constants.
you'll need some smart trickery to store strings.
if you don't need variables to change, you can store constant strings in the .lng files (languages/ folder). then you can use some trickery to use them:
in the .lng file: (preferably in english.lng)
MYTEXT_1 "Hello, humans"
MYTEXT_2 "We come in peace"
in the .obj:
...
let $i=1
textout default 0 0 $MYTEXT_$i
let $i=2
textout default 0 50 $MYTEXT_$i
...
never tested it, but it should work. please let me know of any results you get.
Offline
from my previous experiences, something like
$MYTEXT_$i
produced an error in the nanoparser, probably because of calling two variables in one.
i'll see if your tricks work
https://discord.gg/w8JqM7m ---> Open Surge's Discord server
Offline
from my previous experiences, something like
$MYTEXT_$i
produced an error in the nanoparser, probably because of calling two variables in one.
i'll see if your tricks work
it's because $MYTEXT_1 isn't a variable. nanocalc, the guy who solves the math formulas in scripts, does not know what $MYTEXT_1 is. He does know, however, what $i is.
only later, when calling textout and printing text to the screen, after doing all the math, the game will look in the .lng file for a MYTEXT_1 constant. It should work, give it a try. Please let me know of the results.
Offline
no, what i meant was using a variable for numbering other variables.
for example i want to call $variable_1 and $variable_2 depending on the value of $number like:
$variable_$number
and if $number == 1 it uses $variable_1
unfortunately this does not happen, and that's what i was referring to in last post.
https://discord.gg/w8JqM7m ---> Open Surge's Discord server
Offline
did it work for texts?
Offline
Pages: 1