Comments/Ratings for a Single Item
@ Fergus,
Can you look over this : https://www.chessvariants.com/play/pbm/play.php?game=Frog+Chess+with+Gryphon+and+Falcon&settings=default&submit=Edit
preset I am attempting, and tell me what basic mistakes I am doing. I don't think my logic is very bad. But anyway I am not sure I use the proper variables.
What should happen, is that white should be allowed to move the two pieces on the back line to be gated, then black the same. It does not work as I inteneded and I don't know why. Please help1
Note to Fergus: although this preset is automated through the PTA, this only applies to the playing after the 'prelude'. So Aurelians question is about the GAME code for the case turn == 0 in the Post-Move sections, which is not relying on anything in the include file.
@Aurelian: I do notice you change the restrictions on what is allowed as input, and then change them back after the move gets handled. Note that the betza.txt include file normally runs under conditions (set in the Pre-Game code, where it was included):
setsystem maxmove 4; // move + suicide + freedrop + promotion setsystem omitmoves 1; // in case they forgot to tick checkbox ban commands; allow pass 2 pass 3; // later legs can be skipped
which is different from what you try to restore. (But of course your variant might not need all the move types that the betza.txt file supports.)
Some comments:
I am not sure whether changing the allowed input format in the Post-Move section would work. This section is only invoked after the move has already been entered, so during entry the format defined in the Pre-Game section might still apply, and cause rejection. Perhaps you should set the prelude format in white's Pre-Move section (subject to the condition turn == 0). And then restore it only at the end of the prelude section in black's Post-Move code.
Aren't you making life unnecessarily difficult for yourself, by allowing the players to place both pieces in the same turn? If you would allow two turns for the prelude (only calling HandleMove when turn > 1) you would only have to process a single move. And then you could call ParseMove true/false in the betza.txt include in order to extract the move parameters #ori and #desti, and use those to make the move.
Of course this would not give you rule enforcing in the prelude, as nothing would stop a player from moving, say, his King to the back rank. So you would have to test whether rank #ori equals 4 (or 5, for black), and whether rank #desti equals 0 (or 9 for black). And whether ther actually was a piece on #ori, and whether #desti was empty. If your rules require a specific order of placement, both prelude turns could use the same code. (If not you would need a turn-dependent test on the moved piece type, which could replace the test on the origin rank, as the piece type would only be found there anyway.)
You need code in your Post-Move sections to control what is allowed on the first turn. Setting legal moves in the Post-Game section is not enough, because these will only be used for which legal moves are highlighted for the player. They will not control which legal moves are allowed.
4 comments displayed
Permalink to the exact comments currently displayed.
It's important to maintain backwards compatibility, and anyone who doesn't like the name of Aanca is free to use a different name with an alias.