I was trying to make a function that returns an array with all the labels in the map, but unfortunately it doesn't work when rotating the map.
What in this patch does not work when rotating the map?
Quote from: Dwachs on November 30, 2022, 07:01:13 AMWhat in this patch does not work when rotating the map?
Captura desde 2022-11-30 09-00-52.png
I cannot download the attached picture 'file not found'.
Quote from: Dwachs on November 30, 2022, 01:08:09 PMI cannot download the attached picture 'file not found'.
Wow, that must be a problem on the forum. :o
Look here: https://www.mediafire.com/file/tuo3zlloarqtrih/Captura+desde+2022-11-30+09-00-52.png/file
Quote from: Dwachs on November 30, 2022, 01:08:09 PMI cannot download the attached picture 'file not found'.
It says: "_nexti returned an invalid idx", but I really have no idea, I thought it was due to the change of coordinates due to the rotation. :-[
Edit.
Well, this was what occurred to me to solve: Update Add-get-label-list.patch
Quote from: Yona-TYT on December 01, 2022, 05:48:27 AMIt says: "_nexti returned an invalid idx", but I really have no idea, I thought it was due to the change of coordinates due to the rotation. :-[
Edit.
Well, this was what occurred to me to solve: Update Add-get-label-list.patch
@Dwachs
Greetings, I just wanted to remember this little patch. ;)
implemented in r10832. try
foreach(label in world.get_label_list()) {...}
Implementation is a bit different from your patch.
Quote from: Dwachs on December 15, 2022, 09:20:23 PMimplemented in r10832. try
foreach(label in world.get_label_list()) {...}
Implementation is a bit different from your patch.
Thank you ! this is great!. Now I can mark the text labels when starting the scenario. 8)
Quotefunction resume_game()
{
//Mark all text labels
foreach(label in world.get_label_list()){
if(label.get_text() == "X")
label.mark()
}
}