I
Ieyfo
Guest
Hello again, in a past post I asked about taking a word and breaking it down the giving a chest one of the characters from the word and the character not being able to be used again. Well they tried to help and we ended up with a broken game so I've worked on it and followed the info they gave me but its not working.
So to start the word to be used is selected from an array of words randomly.
Next I take the word selected and break it down to a single letter and store it into an array.
Then from there I put it into a ds_list (Yes I do create the ds_list at the top of the script)
Also I shuffle so i can make the letter placement random.
Now this is the part that i'm having an issue with.
Upon the creation of the chest I want to give it one of the letters.
The way i'm doing it is Using the ds_list selecting the first one setting the variable of letterStored to equal it then deleting it from the list. but that don't work.
What its doing is using the first letter of the word.
There was someone who was gonna help but he wanted remote access to my computer and hes probably a nice person and just wants to help but there is the chance he has other plans than help.
So why isn't this working the way it should?
So to start the word to be used is selected from an array of words randomly.
Code:
// Select word for map
scr_Word_Array()
var rand = irandom(87);
global.word = global.arrayWords[rand];
Next I take the word selected and break it down to a single letter and store it into an array.
Code:
// Break the word into a single char.
global.wordChar[0] = string_char_at(global.word, 1);
global.wordChar[1] = string_char_at(global.word, 1);
global.wordChar[2] = string_char_at(global.word, 1);
global.wordChar[3] = string_char_at(global.word, 1);
global.wordChar[4] = string_char_at(global.word, 1);
Also I shuffle so i can make the letter placement random.
Code:
// Store all the chars into the list.
ds_list_add(charList, global.wordChar[0], global.wordChar[2], global.wordChar[3], global.wordChar[4]);
ds_list_shuffle(charList);
Upon the creation of the chest I want to give it one of the letters.
The way i'm doing it is Using the ds_list selecting the first one setting the variable of letterStored to equal it then deleting it from the list. but that don't work.
What its doing is using the first letter of the word.
There was someone who was gonna help but he wanted remote access to my computer and hes probably a nice person and just wants to help but there is the chance he has other plans than help.
Code:
if(point_distance(ex, ey, obj_Player.x, obj_Player.y) > 250 && instance_number(obj_Chest_Letter) <= 4 && irandom(lcodds) == lcodds){
with instance_create(lcx, lcy, obj_Chest_Letter)
letterStored = ds_list_find_value(other.charList, 0);
ds_list_delete(charList, 0);
}