Ludii Forum
Check connection at start of turn - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Questions (https://ludii.games/forums/forumdisplay.php?fid=13)
+--- Forum: About the Ludii Grammar (https://ludii.games/forums/forumdisplay.php?fid=15)
+--- Thread: Check connection at start of turn (/showthread.php?tid=1610)



Check connection at start of turn - coldsalmon - 07-10-2023

I have a connection game in which you must be connected at the start of your turn to win. So, you need to connect and your connection must survive your opponent's next turn. I tried this:

(end (if (is Connected Next) (result Next Win)))

But that does not detect any win ever. Is there an elegant way to do this or should I just do it with a point scoring mechanism?


RE: Check connection at start of turn - fuerchter - 07-13-2023

So from what I checked just now (mainly looking at Hex and Chameleon since the full .lud for your game was not given), I think this is an issue with "(is Connected Next)" always returning false in this situation (you will not be able to reproduce this in the Test Ludeme Dialog, it seems to only occur in the usual game flow).
My guess is that this results from "who" and "playerRegion" being different here, so it ends up returning false later (why is who at the from position used there anyways...?). I have tried finding workarounds (using "(trigger)" at the start or end of someone's turn e.g.) but have not been able to, perhaps someone else is.


RE: Check connection at start of turn - fuerchter - 07-14-2023

Here's a .lud change of the built in Hex with a custom definition of "connected" that should work as if writing "(is Connected Next)". This is rather hacky (i've added some comments), and requires you to write each player's regions out differently than you would usually. I'd rather have a working version of the ludeme itself. Let me know if this works for you though.


RE: Check connection at start of turn - coldsalmon - 07-18-2023

Thanks! I'll take a look at this and see if I can get it working with the script I have. Seems like I'm not missing any easy solutions :)


RE: Check connection at start of turn - fuerchter - 09-05-2023

Hi again,
I noticed that this thread seemed to have been about Adere? Did you finish your version? I wrote one myself, and will PM it to you (in case you don't want it out in public).