Honestly, I just put this together, so perhaps it was utterly foolish of me to expect this to work.
The idea is that the text object takes it's given string and separates it into smaller strings each with different parameters.It takes a string like"The idea is /inot /cto destroy the /bstrange monsters, /cbut rather to take them alive for further inspection by /ySeamus."and turns it into"The idea is not to destroy the strange monsters, but rather to take them alive for further inspection by Seamus."For some reason, it doesn't do this.All of the ministrings are blank and the formatting is not present.length = string_length(str);
while(parseStringPos < length)
{
parseStringPos += 1;
changed = false;
if (string_char_at(str,parseStringPos) == "")
{
parseStringPos+=1;
if ((string_char_at(str,parseStringPos) == "i") && (changed = false))
{
changed = true;
currentString += 1;
totalStrings += 1;
stringFormatting[currentString] = 1;
stringStartXinc[currentString] = stringStartXinc[currentString-1]+string_width(stringText[currentString-1]);
stringStartYinc[currentString] = stringStartYinc[currentString-1];
parseStringPos += 1;
}
if ((string_char_at(str,parseStringPos) == "b") && (changed = false))
{
changed = true;
currentString += 1;
totalStrings += 1;
stringColor[currentString] = c_blue;
stringStartXinc[currentString] = stringStartXinc[currentString-1]+string_width(stringText[currentString-1]);
stringStartYinc[currentString] = stringStartYinc[currentString-1];
parseStringPos += 1;
}
if ((string_char_at(str,parseStringPos) == "g") && (changed = false))
{
changed = true;
currentString += 1;
totalStrings += 1;
stringColor[currentString] = c_lime;
stringStartXinc[currentString] = stringStartXinc[currentString-1]+string_width(stringText[currentString-1]);
stringStartYinc[currentString] = stringStartYinc[currentString-1];
parseStringPos += 1;
}
if ((string_char_at(str,parseStringPos) == "r") && (changed = false))
{
changed = true;
currentString += 1;
totalStrings += 1;
stringColor[currentString] = c_red;
stringStartXinc[currentString] = stringStartXinc[currentString-1]+string_width(stringText[currentString-1]);
stringStartYinc[currentString] = stringStartYinc[currentString-1];
parseStringPos += 1;
}
if ((string_char_at(str,parseStringPos) == "y") && (changed = false))
{
changed = true;
currentString += 1;
totalStrings += 1;
stringColor[currentString] = c_yellow;
stringStartXinc[currentString] = stringStartXinc[currentString-1]+string_width(stringText[currentString-1]);
stringStartYinc[currentString] = stringStartYinc[currentString-1];
parseStringPos += 1;
}
if ((string_char_at(str,parseStringPos) == "s") && (changed = false))
{
changed = true;
currentString += 1;
totalStrings += 1;
stringEffect[currentString] = 1;
stringStartXinc[currentString] = stringStartXinc[currentString-1]+string_width(stringText[currentString-1]);
stringStartYinc[currentString] = stringStartYinc[currentString-1];
parseStringPos += 1;
}
if ((string_char_at(str,parseStringPos) == "c") && (changed = false))
{
changed = true;
currentString += 1;
totalStrings += 1;
parseStringPos += 1;
stringStartXinc[currentString] = stringStartXinc[currentString-1]+string_width(stringText[currentString-1]);
stringStartYinc[currentString] = stringStartYinc[currentString-1];
}
}
else if (string_char_at(str,parseStringPos) != "#")
{
stringText[currentString] += string_char_at(str,parseStringPos);
}
else
{
currentString += 1;
totalStrings += 1;
stringLines += 1;
stringStartXinc[currentString] = 0;
stringStartYinc[currentString] = stringLines * 12;
stringColor[currentString] = stringColor[currentString-1];
stringFormatting[currentString] = stringFormatting[currentString-1];
stringEffect[currentString] = stringEffect[currentString-1];
}
}
@Charlie: What he's saying is that if you use images of the individual characters, you use less space because you dont have an image for every text. That is, if you have many in the game. It also would make loading longer and the filesize much larger. Also, if you have to make changes later, you actually have to edit the visual file of it rather than just changing the text. :(
Also, this:I'm aware of the impracticality, most things I do are impractical.
Case in point: he codes in Drag n Drop.
:VAnyway, Juju, thank you so muchalthough i'm not noticing any real differences hereI'm gonna try it out in the morning and see if anything happens.As for the bit about this being done before on the GMC, I dun wanna
besides i wanted to have a text engine support this and not freeze the gameMe being a bellend aside, there are some things you can do with text-all-in-an-image that isn't possible with standard font maps. Just not a lot, that's all.
There were 3 main issues:1) Lots of if-statements is are silly for readability2) You weren't actually checking for the begin-tag character3) Your arrays weren't all the same sizeIncidentally, if you have that "uninitialised variables equal zero" option turned on, turn it off right now. It will help you track down spelling errors so much faster.Well, um, the 64d blog editor rejects backslashes :I
I had to change them to forward slashes.As for the arrays, huh?I couldn't get the parser to add untagged text ("c = 'clear'") because my test string was "hello."I'm implementing your version in a minute, see if it works.I haven't used that for years :<Good luck.
uh
i'll fix this eventuallyYou can't really tell, but the word "eeextbox" shakes.in the meantime, i should totally fix the c command for normalizing the textand maybe even the weird bit with the first few lettersWait a second
JUJU GAVE YOU CODEEVERBODIES IS DISQUALIFIEDSToast: Wait a minute…r u tyin to cheat?
Taizen:GoobyToast, plz!