Comments by catugo
I should use redirect then on the old settings file toward the new one, isn't it?
@Fergus
The way I had thought the game, the joker should, when imitating a pawn, get only the regular power and not promotion rights or double move privileges. And that works best with moving some of the lines in the pawn function to the pawn subroutine. It should be rather easy.
Ok, thanks for the heads up. I'll try to think at something else.
I have the same problem.
Probably Fergus is working for something new.
@Fergus
A few weeks ago I have figured out that the joker imitates the pawn in all things which causes the joker moves to not be allowed.
To tackle this issue I have decided to write a Barren_Pawn function that the joker will use when imitating a pawn instead of imitating the regular pawn function. Otherwise things are unchanged. The Barren_Pawn functions are:
def White_Barren_Pawn checkaleap #0 #1 1 0 and empty #1 islower space #1 and or checkaleap #0 #1 1 -1 checkaleap #0 #1 1 1;
def White_Barren_Pawn-Range merge leaps #0 1 0 leaps #0 1 1;
def Black_Barren_Pawn checkaleap #0 #1 -1 0 and empty #1 isupper space #1 and or checkaleap #0 #1 -1 -1 checkaleap #0 #1 -1 1;
def Black_Barren_Pawn-Range merge leaps #0 1 0 leaps #0 1 1;
The piece of code involving the joker imitation is:
if != const alias $moved White_Joker:
if != const alias $moved Pawn:
set last_type_moved const alias $moved;
else:
set last_type_moved White_Barren_Pawn;
endif;
endif;
and for black:
if != const alias $moved Black_Joker:
if != const alias $moved Pawn:
set last_type_moved const alias $moved;
else:
set last_type_moved Black_Barren_Pawn;
endif;
endif;
I thought it should easily work. Unfortunately it does not. Any idea why that is?
I have corrected the post move code to:
if != const alias $moved White_Joker:
if != const alias $moved White_Pawn:
set last_type_moved const alias $moved;
else:
set last_type_moved Black_Barren_Pawn;
endif;
endif;
and similar for black. This code works.
But the Barren_Pawn worked fine when I had done only the move part of the pawn's powers but now I have added the capture part and nothing is legal anymore. Please help if you may! The code in question is:
def Black_Barren_Pawn
checkaleap #0 #1 0 -1 and cond empty #0 not capture empty #1
or checkleap #0 #1 -1 -1 or checkleap #0 #1 1 -1
and cond empty #0 capture isupper space #1;
I'm confused about what you want to say. Isn't it that : and cond empty #0 capture isupper space #1; does exactly that, capture for actual moves, and isupper space #1 checks for a potential victim in potential moves? Where am I wrong?
I have corrected the mistake and now it goes like this:
def White_Barren_Pawn
checkaleap #0 #1 0 1 and cond empty #0 not capture empty #1
or and checkaleap #0 #1 -1 1 or checkaleap #0 #1 1 1
cond empty #0 capture islower space #1;
def White_Barren_Pawn-Range merge leaps #0 1 0 leaps #0 1 1;
def Black_Barren_Pawn
checkaleap #0 #1 0 -1 and cond empty #0 not capture empty #1
or and checkaleap #0 #1 -1 -1 or checkaleap #0 #1 1 -1
cond empty #0 capture isupper space #1;
But during my tests I came across the fact that a joker imitating a barren_pawn does not have the ability to capture another joker (although it is fine when capturing a knight).
It works well. I hope there are no more bugs. Thanks Fergus!
Since this comment is for a page that has not been published yet, you must be signed in to read it.
I think this article is ready for publishing the Apothecary Chess-Modern game.
I think this article is ready for publishing the Apothecary Chess-Classic game.
I have accepted these days 2 challenges as white and I got black (as the default). One was shako and the other is opulent chess. Is this a problem of mine or of the website?
There is an error in the article probably. When castling is described it says that the king moves 3 squares but this can't happen when castling short as the rook is in the way.
I have a problem with the apothecary presets. The ones that are in their final shape give an error at this code (second line-1061)
1060 for (from piece) fn friends 1061 for to fn join const alias #piece "-Range" #from 1062 if fn const alias #piece #from #to and not fn friend space #to and onboard #to 1063 move #from #to 1064 if not sub checked cond == #from #kingpos #to #kingpos 1065 setlegal #from #to 1066 endif 1067 endif 1068 restore 1069 next 1070 next
Do other presets have the same problem, as I remember mine working the last time I had checked?
@Fergus, As I had said in the previous message on this topic I have an error in my apothecary presets.
https://www.chessvariants.com/invention/apothecary-chess-1 https://www.chessvariants.com/invention/apothecary-chess-2
The for loop in the links above tries to the None piece for checking the legality. I remember the code working. Is it possible that some game code changes hinders this preset? Or is it a regular bug?
It looks to me that initializing the joker with none cannot be done. When I had selected rook things work out fine!
I have defined the none range piece type definition with (()()): def None-Range (()()); That because the error I mentioned earlier was that the piece that was the joker imitating was not an array.
@Greg,
The preset you have shown me is an older one. The newest ones are: https://www.chessvariants.com/play/pbm/play.php?game%3DApothecary+Chess-Classic%26settings%3DApothecary_Chess-Classic https://www.chessvariants.com/play/pbm/play.php?game%3DApothecary+Chess-Modern%26settings%3DApothecary_Chess-Modern.
Hopefully I'll have the time today to update the older presets.
I think I had solved it. If not I had corrected the error for another Apothecary chess modern preset. So please say that it does not work, if the case.
Please try again!
I don't now what you are doing. Please give me more details. Is it a game you play or an older log?
I cannot figure out what is going on. To me the preset in question works fine. Any suggestions?
25 comments displayed
Permalink to the exact comments currently displayed.

@ Greg,
I prefer to keep the name and maybe rename the settings files used for old games. Can it be done?