Comments/Ratings for a Single Item
I prefer to keep the name and maybe rename the settings files used for old games. Can it be done?
You can keep the name of the game, but the settings name will need to change. I don't know how to change the settings name for existing logs.
@ Greg,
I prefer to keep the name and maybe rename the settings files used for old games. Can it be done?
You need to use a new Settings name so old games don't break. But if you do that, the pending invite is ok.
@Oisin D.
I need a moment with no ongoing games so that I can change the pieces from Griffin and Aanca to Dragon and Griffin, so please temporarilly delete your pending invitation.
Ok, I have added D and left the A so older games will still view correctly. If you are going to change the notation, remeber to change the name of the settings so that you don't break older game logs.
Since you are using custom 'Apothecary' sets, and I doubt other games are using these sets, they can be altered. Do you want to keep the notation the same? ('A' becomes bird) Or do you want to add a Dragon as 'D'?
Fergus,
I want to use the same set, not another one, but with a dragon picture instead of a bird picture. Is that even possible or should I make another piece set from the beginning?
While I could add code to Game Courier for enabling GAME Code programs to modify the images in piece sets, it would not work in Edit mode. So, if you want to use piece images that are not in your current set, you should change it to use a different set.
Since your function has to allow special moves but stop the illegal ones, you should not be calling your function from your subroutine. They should be independent from each other. How to call the subroutine is described in the Fairychess include file tutorial under "A Real Example from Chess".
The tutorial also describes how you can use different pieces with the same notation. Although you cannot modify a set within Game Courier, you can change which pieces you use and what notation you will use for them. I recommend reviewing this tutorial every now and then.
To the editors.
Can a piece set be changed or it needs to be redone from the beginning?
I want to change in the apothecary chess standard piece set the bird with the dragon.
have written the following code but I don't know where to call the subroutine.
sub King from to
move #to #from;
if sub checked #from:
verify or checkleap #from #to 1 0 checkleap #from #to 1 1;
else:
verify fn King #from #to;
endif;
move #from #to;
endsub;
;
As long as you evaluate actual moves in the Post-Move sections, you have to bear in mind that potential moves are evaluated before a move would be made, and actual moves are evaluated after a move has been made. This means that you have to sometimes use different code for potential and actual moves. That's true of the King here. You should use both a function and a subroutine for the King's movement. The function should handle only potential moves, and it should stop a King from making its special move out of check before it makes its move. The subroutine should handle actual moves, and it should undo a King's special move after it has been made to make sure the King didn't move out of check with that move, then redo it if it was legal.
@Fergus,
I have remade the code to work as expected for the king to not be able to use the special moves out of check:
/play/pbm/play.php?game%3DApothecary+Chess+1%26settings%3DApothecary1working
The relevant piece of code for white is:
if flag f2:
if == moved K:
if sub checked $origin:;
if not or checkleap $origin $dest 1 0 checkleap $origin $dest 1 1:
die A King may not use the special moves out of check.;
endif;
endif;
endif;
endif;
There is still the problem that the special moves are displayed as legal when a king is in check. Is that solvable?
@HG,
Indeed HG, now the diagram works as expected for me too!...
Thanks!
I think caching again is broken on this website. I uploaded a new Diagram script, but when I read it back from the website, it shows the old text. Only when I suffix the URL with some random suffix, like ?t=1234, I get to see the newly uploaded text.
So this is what you can do as a work-around too: suffix the URL to betza.js in your comment to make it betza.js?nocache=true , to make sure it will use the new script. You still would have to flush your browser cache. When I tried the current script locally on your diagram, the shuffling works as it should.
BTW, note that when you specify symmetry=mirror (as you must, to preserve vertical symmetry during shuffling), there is no need to mention the location of the black pieces, as the Diagram would automatically add those. So you could leave out the double comma and everything behind it, even for the holes.
I'm not sure why but the diagram still does not work.
It behaves the same way.
I'm wondering if you have not tried to put a bishop over an already occupied square. Would this be an error?
OK, I see that my trick did not work for swapping b and d, as these are same shade, so that the B must get automatically to opposit halves, and the : adds nothing extra. I changed the meaning of : now to explicitly mean "mirror-image location", and adapted the Diagram script for that. This should make your diagram work as you have it, with the updated script.
I have tested it by pressing restart and it does not go well. The queen and knigt get swaped. But not the way I described in the rules. My code is here:
<script type="text/javascript" src="../membergraphics/MSinteractive-diagrams/betza.js"></script>
<div style="float:left;margin:0 40px 20px 0;">
<div class="idiagram">
files=10
ranks=12
holdingsType=1
promoZone=3
promoChoice=!P*N*B*C*W*R2*J2*Q1*D1*G1
graphicsDir=../graphics.dir/alfaerie/
whitePrefix=w
blackPrefix=b
graphicsType=gif
squareSize=54
symmetry=mirror
shuffle=G:BD,:BN,GDQ
hole::::a1,b1,c1,i1,j1,,a12,b12,c12,i12,j12
pawn:p:ifmnDfmWfceF:pawn:a4,b4,c4,d4,e4,f4,g4,h4,i4,j4,,a9,b9,c9,d9,e9,f9,g9,h9,i9,j9
rook::::a2,j2,,a11,j11:1
queen::::e3,,e10:1
bishop:B:B:bishop:d3,g3,,d10,g10
knight:N:NmHmA:knight:c3,h3,,c10,h10:1
wizard:W:FL:mage:d1,g1,,d12,g12
champion:C:WAD:champion:e1,h1,,e12,h12:1
joker:J:fI:fool:f1,,f12
dragon:D:FyafsF:dragon:i3,,i10
griffin:G:WyafsW:gryphon:b3,,b10
king:K:KimbsLimbsN:king:f3,,f10
</div></div>
I had tested it be pressing restart a few times on the diagram. Refresh gives me the initial position.
I implemented 'repeated shuffling' in the diagram now, where the shuffle parameter accepts a comma-separated list of shuffles, which are then performed in order. I also added a new shuffle limitation: a piece prefixed with ':' (colon) will not be shuffled to different shades (like a '!' prefix would do), but to symmetric locations. (Which, on boards with an even number of files, should also have opposit shades.) Better make sure to apply it only to an even number of pieces on a set of symmetrically distributed locations!
I think this should allow you to do the shuffling you want, through a trick: When you shuffle (say) Knights and Bishops with :BN specification, it can only leave them as they were, or swap the N and B on both wings. Otherwise the Bishops would no longer be symmetrically positioned.
So what you can do is start the Bishops in the d- and g-file, and (say) A and C on the b- and i-file, and then shuffle A:BC. This will make the B end up either on d/g or b/i, with 50-50 chance. After that you shuffle B and N (which started on c- and h-file), as :BN, to randomize those while preserving symmetry. Finally you shuffle ACQ without limitations. So the specification would be shuffle=A:BC,:BN,ACQ .
@Fergus,
I have moved the buggy code back to the old testing ground:
if flag f2:
if moved == K:
move $dest $origin; // Temporarily undo King move
if sub checked $origin:
if not or checkleap $origin $dest 1 0 checkleap $origin $dest 1 1:
die A King may not use the special moves out of check.;
endif;
endif;
move $origin $dest;
endif;
endif;
The way this goes wrong is that other pieces other than the king are affected by it. Any idea why?
I removed the buggy code.
Now it should work!
25 comments displayed
Permalink to the exact comments currently displayed.
I should use redirect then on the old settings file toward the new one, isn't it?