How do I use the Chess & Board plugins properly?

Get help using Construct 2

Post » Sat Jun 14, 2014 11:42 pm

I have spent a number of hours putting together a chess board... and although it looks like nothing - it really was a lengthy process just getting this far.

Rex Rainbow has produced so many plugins for this community, I am in awe :) He is obviously extremely talented. The problem is - I can't seem to find any documentation on his plugins that explains how to use them properly.

For instance, whats the difference between creating logical or physical chess pieces? Should you do both?

Anyway, I have attached what I have done so far, my current hurdle is getting a piece to move.

Once I have that nailed, I can then spend some more hours figuring things out for myself before asking for more assistance :) I learn better if I try to do it all myself first. :)
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 41
Reputation: 482

Post » Sun Jun 15, 2014 7:14 am

Just to clarify, how do I construct the piece movement events?
B
6
S
1
Posts: 41
Reputation: 482

Post » Mon Jun 16, 2014 11:10 pm

Message: revvin is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
I have made progress on my own, but thought i'd share my results and ask questions in this thread as I go. Somebody might suggest something that'll save me hours of work.... if not i'll just carry on :)

So... you can now click on any of the pieces and click on another square to move them.

I haven't set limits on the movements yet. That'll be one of my next challenges.

I'm thinking I should build an array that contains all the legal moves for each type of piece. I have 6 types, determined by their animation frame number. Black pieces are frame 0 through 5, the White pieces are frames 6 through 11.

I was thinking of an array something like:

legalMoves

frame (type) maximum moves directions
0 (pawn) 1 y-
1 (castle) 7 x,y,x-,y-
2 (knight) 3 x,y,x-,y-
3 (bishop) 7 x+y,-x+y,x+-y,-x+-y
4 (queen) 7 x,y,x-,y-,x+y,-x+y,x+-y,-x+-y
5 (king) 1 x,y,x-,y-,x+y,-x+y,x+-y,-x+-y
6 (pawn) 1 y
7 (castle) 7 x,y,x-,y-
8 (knight) 3 x,y,x-,y-
9 (bishop) 7 x+y,-x+y,x+-y,-x+-y
10 (queen) 7 x,y,x-,y-,x+y,-x+y,x+-y,-x+-y
11 (king) 1 x,y,x-,y-,x+y,-x+y,x+-y,-x+-y

Of course this doesnt take into account en passant, castling, knights move 1+2 etc. but I was going to build those individually... unless somebody has a better suggestion?

I'd also like to build an array whilst I build my board following standard a-h, 1-8 grid so that i can eventually import/export PGN files. I've tried building an array, but when searching it - all the values are 0, so suggestions on how to quickly populate a grid a-h/1-8 with the UIDs of the tiles as I build the board would be very helpful.

Any offers of help to build these arrays, or even improve the events I have already made would be greatly appreciated.

Latest version of the capx included. :)

Thanks guys
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 41
Reputation: 482

Post » Tue Jun 17, 2014 3:42 pm

Hey revvin!

You should really look into Rex's behavior plugin "GridMove". It is definitely what you are looking for, as it works very well with his Board/Chess plugins. Just add the behavior to your chess piece and call it in your events instead of using "MoveTo".

Hope this helps :)
B
12
S
2
G
1
Posts: 26
Reputation: 835

Post » Tue Jun 17, 2014 4:00 pm

Hello! I'm using some of these plugins as well, and when you figure your way around them they can be really useful.

You should take a look at this thread, with a collection of his plugins that work really well together to do what you need: viewtopic.php?t=69647&start=0

As well as his demonstrations here: https://onedrive.live.com/?cid=07497fd5 ... fA3BYVEKYk

As for how far each chess can move and what types they are, it is also possible to use private variables for that. Just give each chess piece a different variable number for amount of moves it can make, and names for its type.
B
10
S
3
G
3
Posts: 110
Reputation: 2,206

Post » Tue Jun 17, 2014 10:06 pm

Brilliant - thanks for the info guys!

I have figured out how to do an array, and i'll be assigning correct tile notation to each tile, for future support of PGN files.

Vati-nyan: thanks for the tip re: private variables. I'll be making use of instance variables to identify the pieces, cross referencing with another array that'll store the legal moves for each type.

Bonesy: I'll look at grid movement again. I think when I looked before, it didn't animate/move sprites from one grid location to the next - which is something I definitely need... as eventually i'll have the pieces walking around the board... :D

I have just been looking at the SLG_Movement examples that make use of Grid Movement too... and I think its definitely the way to go. I'll have to create some templates for the filters so that certain tiles will never be available to certain tiles ie, Pawns will not be able to move +-X, only +-Y (unless there is another piece at X+-1/Y+-1 for En Passant). I should be able to figure that out myself. :)

Thanks again for your input.
B
6
S
1
Posts: 41
Reputation: 482


Return to How do I....?

Who is online

Users browsing this forum: arcab072081, Lisa999, RandomlyMooN and 8 guests