How do I drop 3 different pieces at o... Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » How do I drop 3 different pieces at one time? « Previous Next »

Author Message
Chris Huntoon (Chrish)
Posted on Sunday, June 03, 2001 - 3:18 pm:   

I working on a ZRF for one of my games. It involves the dropping of 3 different kinds of pieces at one time, but I can't get it to work. Below is a sample of the line that is giving me trouble.

(drops ((verify empty?) mark n (verify empty?) n (verify empty?) back cascade n (cascade piece2) n (add piece3)))

Any help would be appreciated.
Patrick S. Duff (Pduff)
Posted on Sunday, June 03, 2001 - 4:51 pm:   

You can drop the "mark", since it happens automatically at the beginning of move-generation.

Also, you can simplify your logic by interleaving the "(verify empty)" checks. Just use "(verify empty?) cascade n (verify empty?) (cascade piece2) n (verify empty?) (add piece3)".

Your problem may be that you don't have any pieces of those three types left to drop. Look at the paragraph which begins "In a moves statement" in the "drops" help topic for how to use the "off" keywoard.

I've never tried the "(cascade piece2)" syntax, since that usage isn't described in the "cascade" help topic. But since "add" works that way, I guess I wouldn't be surprised if "cascade" works that way too. If so, the help topic needs to be enhanced.

When I've had trouble getting a complicated cascaded drop to work, I've had success changing it from a drop to a move, and using "add-copy". In the board setup, create a dummy position for each piece you want to drop, and put the piece you want to drop on that dummy position. Then make the dummy position the "from" for the move, go to the "to" position where you want to drop the piece, then do an add-copy. You may also need to do "change-owner".
Chris Huntoon (Chrish)
Posted on Monday, June 04, 2001 - 2:10 am:   

The problem is that I keep getting a parse error at "(cascade piece2)". So apparently that syntax isn't allowed.

I don't think the add-copy would work because I'm trying to place three different types of pieces in a single move.
Patrick S. Duff (Pduff)
Posted on Monday, June 04, 2001 - 2:18 am:   

Try using "(change-type piece2) cascade" instead of "(cascade piece2)".
Dan Troyka (Dtroyka)
Posted on Monday, June 04, 2001 - 5:23 pm:   

Following up on Patrick's suggestion, this coding seems to work:

(drops ((verify empty?) cascade n (verify empty?) (change-type piece2) cascade n (verify empty?) (change-type piece3) add))
Chris Huntoon (Chrish)
Posted on Tuesday, June 05, 2001 - 5:24 am:   

OK, that worked. But now I have a new but related problem. The pieces are allowed to somewhat overlap. I've tried to do this two seperate ways:

(drops ((verify empty?) cascade n (verify empty?) (change-type piece2) cascade n (verify (piece? piece3)) (change-type piece3) add))

And

(drops ( mark (if (and empty? (empty? n) (piece? piece3 n2)) back cascade n (change-type piece2) cascade n (change-type piece3) add )))

I'm not getting errors. The system just doesn't seem to be generating these kinds of moves.
Dan Troyka (Dtroyka)
Posted on Tuesday, June 05, 2001 - 6:08 pm:   

The first suggestion worked in my script. I wrote it out as follows:

(drops ((verify empty?) cascade n (verify empty?) (change-type piece2) cascade n (verify (or empty? (piece? piece3))) (change-type piece3) add))

The only difference is that I added an empty? to the verify condition on the third position. Could that be the problem?
Chris Huntoon (Chrish)
Posted on Wednesday, June 06, 2001 - 1:57 am:   

That worked out, even with the verify empty? condition removed. However, if you try to rearrange it slightly, so it could, say, also overlap the second piece, it stops working. For example:

(drops ((verify empty?) cascade n (verify (piece? piece2)) (change-type piece2) cascade n (verify empty?) (change-type piece3) add))

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: