The Chess Variant Pages

Check out Metamachy, our featured variant for December, 2023.

[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Home page of The Chess Variant Pages. Homepage of The Chess Variant Pages.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Sun, Nov 19 04:55 PM UTC in reply to H. G. Muller from 09:29 AM:

Well, the XBoard set has b.svg for all pieces, and Magnetic and Motif has b.svg for the orthodox pieces.

When I made my original Magnetic and Motif pieces, I used only the white pieces from the fonts, and I colored them differently. These solid black pieces made from the solid black pieces in the font are not what I originally intended. So, the showpiece.php script should be able to avoid using them.

As it is, showpiece.php would never allow you to use the black XBoard pieces, which seems a pity.

To accommodate their use, I have added some new parameters and some new conditions on whether a b*.svg gets renamed to a w*.svg piece. The two new parameters are originalblack and originalwhite. These are variables that sometimes get assigned in a set file. They are like originalcolor, but for only one side each. When originalcolor has not been set, and one of these has, the value of the appropriate one will be assigned to originalcolor. The new conditions for changing the file name are that originalblack is an empty string, and black is not. If originalblack is not empty, then it's expected that there are black pieces available for recoloring, and if black is empty, then it's expected that there are black pieces that will appear in their original color. Also, this change only happens when image has been passed a value. If someone indicates a piece with values for set and piece, it simply uses the file named in the set file. So, this doesn't interfere with the use of sets.

I have demonstrated this by adding an Xboard set to the Interactive Diagram on the Chess page. However, there is one issue with your Xboard pieces. They have fixed height and width values, and to resize properly to the dimensions of the container, these should be set to 100% instead. I could do this with sed like I did with Bob Greenwade's pieces, or I could leave it to you.

To accommodate the use of Game Courier sets with Interactive Diagrams, I have added code to modify the value of piece if the provided value is not already a key of the $pieces array. If it begins with w or W, it loses the first letter and is set to uppercase. If it begins with b or B, it loses the first letter and is set to lowercase. In each case, it gets the extension chopped off.

Here's an example of a Chess Interactive Diagram using Game Courier sets to identify piece images.

When JavaScript is running, this static image will be replaced with an Interactive Diagram

promoChoice=NBRQ symmetry=mirror satellite=wizard files=8 ranks=8 graphicsDir=/play/pbm/showpiece.php?set=magnetic%26piece= whitePrefix=W blackPrefix=B lightShade=#EEEECC darkShade=#226822 rimColor=#FFFFF0 coordColor=#000000 squareSize=50 firstRank=1 borders=1 useMarkers=1 Pawn:P:ifmnDfmWfceF:P:a2,b2,c2,d2,e2,f2,g2,h2,,a7,b7,c7,d7,e7,f7,g7,h7 Knight:N:N:N:b1,g1,,b8,g8 Bishop:B:B:B:c1,f1,,c8,f8 Rook:R:R:R:a1,h1,,a8,h8 Queen:Q:Q:Q:d1,,d8 King:K:KisO2:K:e1,,e8 royal=6 stalemate=draw enableAI=2