Hi! I am making a map. It is one passage that increments or decrements either the x-position or the y-position of the player and then it reloads the passage with the new position. Then there are specific locations that take you to other passages so that the story can go on. I have a nested list containing a 10 by 10 grid and I compare the $posx and $posy values every time the map passage reloads to that list (I'v been a little lazy at certain points where I have just compared the variables to raw numbers).
It works, but I have a slight problem. I need to cut off parts of the map to finish this assignment on time. the way I tried to do it is to use the unless: statement combined with the link: statement. Unless you are at these coordinates, the link "South" will appear, increment your y-value and go-to: the same passage again.
it works at the south edge of the map ( (x, 10) ) and at one specific location; (2,4) but the other ones do not work! what's going on?
this is the statement, $list is the nested list of numbers 1 to 10 and $posx and $posy, the x and y coordinates for the player. brace yourselves:
(unless: $posy is $list's 2nd's last OR $posx is 2 AND $posy is 4 OR $posx is 3 AND $posy is 4 OR $posx is 4 AND $posy is 4 OR $posx is 4 AND $posy is 8 OR $posx is 5 AND $posy is 8 OR $posx is 6 AND $posy is 8 OR $posx is 7 AND $posy is 8 OR $posx is 8 AND $posy is 8 OR $posx is 9 AND $posy is 6)[(link: "South")[(set: $posy to it + 1)(go-to: "Forest map")]]
I know it looks like shit, but at this point I don't care, I just need the particular set of things to work.
It works, but I have a slight problem. I need to cut off parts of the map to finish this assignment on time. the way I tried to do it is to use the unless: statement combined with the link: statement. Unless you are at these coordinates, the link "South" will appear, increment your y-value and go-to: the same passage again.
it works at the south edge of the map ( (x, 10) ) and at one specific location; (2,4) but the other ones do not work! what's going on?
this is the statement, $list is the nested list of numbers 1 to 10 and $posx and $posy, the x and y coordinates for the player. brace yourselves:
(unless: $posy is $list's 2nd's last OR $posx is 2 AND $posy is 4 OR $posx is 3 AND $posy is 4 OR $posx is 4 AND $posy is 4 OR $posx is 4 AND $posy is 8 OR $posx is 5 AND $posy is 8 OR $posx is 6 AND $posy is 8 OR $posx is 7 AND $posy is 8 OR $posx is 8 AND $posy is 8 OR $posx is 9 AND $posy is 6)[(link: "South")[(set: $posy to it + 1)(go-to: "Forest map")]]
I know it looks like shit, but at this point I don't care, I just need the particular set of things to work.