How to get position of the element of the array and put it in a variable when you press the button?
So, we have an array with objects inside. Just for example:
Here is the code to display this array (objects set previously, of course):
p.s. I apologize for my English
So, we have an array with objects inside. Just for example:
Here is the code to display this array (objects set previously, of course):
<<for $y = 0; $y < $moduleArray.length; $y++>> <<for $x = 0; $x < $moduleArray[$y].length; $x++>> <<set $moduleArray[$y][$x].xy = ($y + ',' + $x)>> <<button "<<= $moduleArray[$y][$x].xy>>" >> <<set $currentPosition.xy = $moduleArray[$y][$x].xy>> <-This, of course, does not work. The question how to make so that worked. <<script>> Dialog.setup("Module", "module"); Dialog.wiki(Story.get("modCreate").processText()); Dialog.open(null, function() { Engine.show() } ); <</script>> <</button>> <</for>> <<= "<br><br>">> <</for>>
p.s. I apologize for my English