Momoro
Member
Hello
I've been working on a small function, for fun, and I've hit a roadblock.
So, it should be adding each character from the string into the ds_list, then adding each character back into another string, in their respective order.
For some reason, when the message shows up, it just displays "-1-1-1-1-1-1-1-1"- and I can't seem to figure out why.
..don't mind the random variables you can add with the function, they're not done yet..
Could someone help me out? Thanks
I've been working on a small function, for fun, and I've hit a roadblock.
So, it should be adding each character from the string into the ds_list, then adding each character back into another string, in their respective order.
GML:
///box_show(string, bool, int, int, int, int)
{
var message, displayOnTheRight, spriteIndex, c1, c2, c3;
message = argument0;
displayOnTheRight = argument1;
spriteIndex = argument2;
c1 = argument3;
c2 = argument4;
c3 = argument5;
//initialize box
var i, word, char, num, mes, out;
out = "";
word = ds_list_create();
for(i=1; i < string_length(message); i+=1;)
{
char = string_char_at(message,i);
ds_list_add(word,char);
for(num=1; num < ds_list_size(word); num+=1;)
{
mes = string(ds_list_find_index(word,real(num)));
out += mes;
}
}
return show_message(out);
}
..don't mind the random variables you can add with the function, they're not done yet..
Could someone help me out? Thanks