Documentation
Readme
View as plain text
ChessMod
Created by: Soralis
[email protected]
Models Created by: Starcon5 - [email protected] - www.starcon5.com
Version 4.0
Morrowind Version: 1.3.1029 (Tribunal Required)
-------------------
Version 4.0
The Chessboard is now portable. :) You can pick it up, and carry it with you and set it up anywhere. :)
Fixed a couple of AI issues regarding a king in check.
Replaced moveto and rotateto with SetPos and SetAngle functions, now that they can accept variables.
Improved moveplane function, more accurate now.
Version 3.0
The Chess game now actually has Chess models in it, thanks to Starcon5. :)
Fixed bug where pieces couldn't be moved when resetting pieces, rather then everything.
Version 2.1:
Fixed small bug, where AI menu didn't come up when game was reset.
New to version 2.0:
Chess AI is working and implemented. Although due to limitations of speed and the way the system was set up, and that I used a mostly brute force system to set it up, don't expect it to be much of an opponent. :) It can basically just look at it's current move, and your next move in choosing an action. You can still choose to play player vs. player as in the first version. When you start a new game, a menu will allow you to make a choice between player and AI for either side (so AI vs. AI is possible as well).
Made chessboard and piece movement much smoother, so pieces don't wiggle around as much trying to get into position, and so take less time to move. And also so there's no problem with pieces or the chessboard not being able to get set up in some situations.
Chessboard and piece rotation is now better handled. The same system that exists for the piece movement was set up for rotation as well. It also no longer has a problem with taking longer to get aligned to an angle of 0/360.
Fixed Pawn en Passant so that only pawns can make the capture.
Added Promotion of pawns that was missing in the first version.
-------------------
Setup:
ChessV2.esp has a chessboard set up within Eight Plates in Balmora. If you want to place a chessboard somewhere within the world, use ChessBlankV2.esp. It has all of what's needed to use the chessboard, but hasn't modified or placed any objects within the game world. To place a Chessboard somewhere, simply place the activator Chessboard somewhere, at any angle (even on a wall or ceiling or some odd angle if you want), and place the lights ChessBlackWin and ChessWhiteWin somewhere in the same cell. Don't place any of the other pieces, they'll be created by the chessboard when activated, and everything will automatically align and position itself relative to the Chessboard. Also, don't place more then one Chessboard in a cell, or it'll have problems.
Note, For those who have a previous version loaded in a save game:
Unselect the previous version
Load your save game (click Ok for any errors that come up)
Save your game agian
Exit Morrowind
Select the new version
This should prevent problems from previous information saved within the save game.
Instructions:
Within the game, simply activate the Chessboard square, and all of the pieces and squares for the chessboard will be created and move themselves into position. You can move a piece by simply activating it, and then activating the square or enemy piece you want it to move to. Castling can be done by activating your king, and then activating one of your rooks, or vice versa. The choice to castle will only be avalable when it's actually possible to do so.
All of the pieces within the game move using the rules of Chess. The only exception to this is that since there's no checking for Checkmate, pieces are not prevented from moving into positions which would place their own king into check, and victory occurs when the king is actually captured. There is a check made to see if the kings are in Check, and on a player's turn, it will only display if that player's king is in check, not if the enemy king is in check.
Use within other mods:
Feel free to use ChessBlank.esp to create a chessboard anywhere within the world, or for the purpose of another mod. You could also merge ChessBlank.esp with your own mod, to make use of a Chessboard within that mod (you'd also have to include within it the models and textures listed below for it to work). Or, you could make use of any of the scripting or functions in whole or in part within your own mod. As well as modifying it for your own purposes. Although if you do take any of these actions to create a seperate mod, please mention me or this mod somewhere within the txt or such for your mod. :)
One of the functions you might find useful is moveplane, which can be found within the scripts for the pieces, and made use of by copying the whole blocks of code in which they occur to your own script (the local variables should be set up as floats):
moveplane is used to move an object a certain amount in a direction, relative to it's local direction. So moving an object 10 in the Z direction will move it in the direction of the object's top, no matter which way that is. This function is set up through the changeX, changeY, and changeZ local variables. Because of the way the function is set up, it can only move in straight lines or diagonals. This means that each of changeX, changeY and changeZ must either be 0, or equal to each other. For example, changeX: 10 changeY: 0 changeZ: 0 would work, as would changeX:10 changeY: 10 changeZ: 0 or changeX:10 changeY: 10 changeZ:10. But changeX: 10 changeY: 10 changeZ: 5 would not work. The object would move, but it wouldn't end up in the position you indended it to move to. Set the variable moveplane to 1 to start the function, and it will be set to -1 when it's done. These variables are also required to be created: changed, changed2, dist, dist2, dist3, negX, negY, negZ, tolerance, step
Also note that these functions set loctest to -1 when they start, this is part of another function in order to test that an object is at the same location (needed when saving/loading sometimes, because the position isn't always saved it seems). This can simply be removed from these functions (note that the moveplane function does this twice, once a the beginning of moveplane == 1, and agian just after when it == 2 )
There are other functions and bits of scripting you can feel free to use as well, although some of them may not be very well documented.
Files:
If you unzip Chess.zip to the Data Files folder, everything should be placed in their proper locations. Just in case, here are the folders where each of the following files should be:
Morrowind\Data Files\
ChessV3.esp
ChessV3Blank.esp
Morrowind\Data Files\Meshes\cp\
blkbishop.nif
blkbrd01.nif
blkking.nif
blkknight.nif
blkpawn.nif
blkqueen.nif
blkrook.nif
chessboard.nif
whtbishop.nif
whtbrd01.nif
whtking.nif
whtknight.nif
whtpawn.nif
whtqueen.nif
whtrook.nif
Morrowind\Data Files\Icons\cp\
chessicon.tga
If you have errors in-game about not being able to find a certain mesh or texture, it's probably because there's a file that isn't in the right folder.
Known Issues:
Picking up a Chessboard that has been setup has had problems crashing the games at times, for some at least, due to some issues with SetDelete. Also, standing on the chessboard when it's deleted can have problems too.
If you rotate the chessboard along more then one axis, it may not end up being at the same angle in-game as it is in the editor. This is because the editor uses a relative coordinate system, whereas the game uses an absolute one, such as if you rotate an object on the Z axis in the editor, it always rotates the object around it's top, whereas in the game, it'll rotate it around a vertical axis in the game. This doesn't change unless you try to manipulate it, so in order to have it face the same direction as the rest of the chessboard, I adjusted it through simply "Rotate, z, 0"
When you save/load, or enter the cell after doing so, you may see pieces or squares moving around, this is normal, and is a bit of programming to fix the problem of placed/moved things not getting saved in the right positon, and the pieces are simply moving back to their positions before the save/load.
Ideas for Future Versions:
Possibly creating chess sets using other models or chess sets (perhaps small creatures for units, that might move, attack, etc. such as with Lady Eternity's models)
I might also add a tutorial or information set of sorts on how pieces move, using the menu system, and the chessboard to demonstrate possible moves.
If you come across any bugs or have ideas for future versions, or for other purposes, you can contact me at [email protected], as noted at the top of this file. Enjoy the mod. :)