Ludii Forum
Why does (set Value Mover ...) affect the direction a piece moves - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Ludii Player Problems (https://ludii.games/forums/forumdisplay.php?fid=6)
+--- Thread: Why does (set Value Mover ...) affect the direction a piece moves (/showthread.php?tid=208)



Why does (set Value Mover ...) affect the direction a piece moves - dale walton - 10-14-2020

Documentation doesn't explain the uses of various constants/variables/parameters such as Value for example.

Can Value be used as a free variables for script use that persist an entire turn? If so why would it affect the direction of movement - is ludii using the same register to hold the direction value or the pointer to an item in a selected set of sites?

If not, how does one set and read a variable (private state variable) that persists longer than a single move - ie a full turn (or more)


RE: Why does (set Value Mover ...) affect the direction a piece moves - Eric Piette - 10-14-2020

Hi,

We are currently writing a logic guide with more information about all the logic (included these variables) but naturally, that work takes time. We will be published it in ludii.games/download when it will be done.

To answer to your question, (set Value ...) is used to modify a value (an Integer variable) associated to a specific player. And yes when this value is set, the variable keeps that value until another ludeme changes it.

Regards,
Eric


RE: Why does (set Value Mover ...) affect the direction a piece moves - dale walton - 10-15-2020

So in the attached draft game, I had got the logic working except for the filter for the prohibited repeat moves
I wrote a revised define using (do... to filter out specific conditions, but it was not producing results. I commented out the end condition logic, and it started to work for the placements, but when testing the movements, I found the pieces no longer moved to the chosen places. I am guessing this is a bug?


RE: Why does (set Value Mover ...) affect the direction a piece moves - Eric Piette - 10-15-2020

Hi Dale,

I have no idea of what you try to do exactly.
To help you, I need a small .lud with the problem you try to show (no comment, no other thing) and a small description of what you think that should do.

Thank you by advance,
Regards,
Eric


RE: Why does (set Value Mover ...) affect the direction a piece moves - dale walton - 10-16-2020

Hi Eric.
I am not asking you to make my program work the way I want it to.

I just want to know: When I run this as it stands, why does clicking on a piece to move it, then clicking on a red dot to select where it will move, move the piece to a different space than the red dot is on.
Since I don't know why this happens. (It looks like a bug) I wouldn't know how to reproduce it.

I am assuming that clicking on a red dot is a selected move, and if I don't change the selection, the step action should be at the same place.

Also, it might help to know if a decision move can be made from within a (do -- I was having difficulty making it work, so I had pulled the decision (Select) out of the (do.


RE: Why does (set Value Mover ...) affect the direction a piece moves - Eric Piette - 10-19-2020

Hi Dale,

No that's not a bug. That's because the blue and red dots correspond to the decision the player has to take to make the move. But here in your consequence (then), you modify the position of the piece just moved with a step move. Consequently, the red dot of a move does not correspond to what the piece will finally go.

Regards,
Eric