Are there global flags? Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Are there global flags? « Previous Next »

Author Message
Wolfram Bernhardt (Tih)
Posted on Thursday, October 25, 2001 - 12:57 pm:   

I'm trying to implement a game, where I need a status of a zone (or some positions) to be changed. It's a little bit like castleling-flags in chess. But in chess it can be done by a "never-moved" flag for kings and rooks.
In my game the status of a zone changes, when all pieces have left this zone. Since there are more pieces included there are two more problems I am working on.
1.) How can I check, whether all pieces have left the zone?
2.) How can I mark the chance of state of the zone forever?
Dan Troyka (Dtroyka)
Posted on Friday, October 26, 2001 - 2:57 pm:   

Not sure if there's enough information here for an adequate response, but here goes: Define the zone in the board statement. Place a dummy piece on a dummy square and initialize it with an attribute called "zone-on" set to true. Whenever a piece has some special power only if the zone has not yet changed state, test the dummy piece to see that the attribute zone-on is true. Whenever a piece in the zone moves out of the zone, test to see if all other positions in the zone are empty (you will need a position flag to designate the from square because ZoG does not regard it as empty). If the zone is empty, then set the attribute zone-on in the dummy piece false.

If you have more info I can try to be more specific.
Wolfram Bernhardt (Tih)
Posted on Saturday, October 27, 2001 - 7:44 am:   

Thanks so far.

Yes, I was also thinking about using dummy-pieces and tried it. I am not very experienced with zillions yet, so may be I just don't know some little details.

What I need is something like this:

(win-condition (X)
___(or (both1 manX) ;both1, both2 and OSquare
______(both2 manX) ;check for wins in special
______(OSquare manX) ;zones
______(and ("if-flag-set") ;here's my problem
__________(XSquare manX)
)
)
)

So, if the flag is true there is also a win-condition in XSquare.

Unfortunately this doesn't work, because in the win-condition there are only allowed to be checked. So I can't use "verify" or check attributes. (Or is there a way to do it?)

So from your suggestion I tried to use a dummy piece on a dummy position as a flag. If there is no piece on the position, it's false, otherwise it's true.

The win-condition now looks like this:
(win-condition (X)
___(or (both1 manX)
______(both2 manX)
______(OSquare manX)
______(and (absolute-config usehomepiece (usehomeX) )
_________(XSquare manX)
)
)
)


Now this should work, but I couldn't test it. There seems to be a strange bug in zilions: This definition of the win-condition leads zillion to report "there seem to be no legal moves from the opening position". If you leave the (and...) - part out, it work's fine.

Any ideas?

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: