Move + add-partial drop Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Move + add-partial drop « Previous Next »

Author Message
epicurus (Epicurus)
New member
Username: Epicurus

Post Number: 12
Registered: 11-2012
Posted on Sunday, February 03, 2013 - 11:52 am:   

I would like to implement the following rule:
when I move a piece to the zone-target, there is a add-partial move where a new piece is dropped in an empty square in the zone-home.

My try:

(define piece-add
(if (not-in-zone? zone-target)
add
else
(add-partial Piece entrytype)
)
)

(define new-entry
(
zone-home
(verify empty?)
add
)
)

(piece
(name Checker)
(moves [....])
(drops
(move-type entrytype)
(new-entry)
)
)

But the code doesn't work. Can someone help me, please?
Malcolm James Webb (Mjw)
New member
Username: Mjw

Post Number: 10
Registered: 5-2008
Posted on Sunday, February 03, 2013 - 1:15 pm:   

The "new-entry" drop is a move made by the Checker. It cannot be executed aas an add-partial in this way. Add-partial will execute a second move of the moving piece, not another piece. I can think of two ways to make the effect you want.

1) Use the "create" command:
(define piece-add
(if (in-zone? zone-target) (create Checker zh1))
add)
- where zh1 is a position in the zone-home. You would have to define a new move for each position in zone-home for each of the positions eg (create Checker zh2) (create Checker zh3) etc

2) Use the 'from' command:
- in board definition include two squares to the side of the playing area: suppose we call them 'w-nest' & 'b-nest'
- in board-setup place a checker for each side in their nest square eg for Black define (Checker bnest)
- piece-add would be as you described it except it would say (add-partial entrytype)
- in the definition of the moving piece (not the Checker) include
(moves
(move-type normal)
[....]
(move-type entrytype)
(new-entry)
)
- define the new-entry move using a 'from' command:
(define new-entry
(wnest (if enemy? bnest) from
(create Checker)
zh1 (if empty? add) zh2 (if empty? add) etc
))
NB: if the squares in zone-home are linked together (say by the direction e) then you could use
zh1 (while (in-zone? zone-home) (if empty? add) e)
This would mean that after the player moves into zone-target, he picks up a Checker from the side of the board and places into a square in zone-home: as he does so a replacement Checker is created in his nest square.
epicurus (Epicurus)
New member
Username: Epicurus

Post Number: 13
Registered: 11-2012
Posted on Sunday, February 03, 2013 - 6:24 pm:   

Hi Malcolm, thanks for your ready reply.

I made a mistake in copying my code. "Checker" and "piece" should be interpreted as synonymous here.

So, my corrected code is:

(define piece-add
(if (not-in-zone? zone-target)
add
else
(add-partial Piece entrytype)
)
)

(define new-entry
(
zone-home
(verify empty?)
add
)
)

(piece
(name Piece)
(moves [....])
(drops
(move-type entrytype)
(new-entry)
)
)

I don't understand why it doesn't work.
Malcolm James Webb (Mjw)
New member
Username: Mjw

Post Number: 11
Registered: 5-2008
Posted on Monday, February 04, 2013 - 1:13 pm:   

Dear "Epicurus"

If the pieces are all the same then it is even more straightforward. The important point is that the piece addition cannot be executed as a drop. This means that the new piece cannot come from the off-board store. It must also be executed as a move of the piece that moves into zone-target, not as a move of the piece being entered into the zone-home.

There are two possibilities: either the new piece is created anew, or it comes from elsewhere on the board.

You create anew using option 1) above but you only have to code:
(if (in-zone? zone-target) (create zh1))
where zh1 is the location in zomehome for the piece to be entered.

Option two requires pieces to be dropped waiting on the "sidelines, but visible to both players.
Jon Steven Nelson (Jonn99)
New member
Username: Jonn99

Post Number: 1
Registered: 2-2013
Posted on Monday, February 04, 2013 - 7:33 pm:   

Mallett and Lefler broke up and quit -> the ZOG interface website will be yanked in Feb 2015 -> best to load all the zrf's if you want -> no new next-gen ZOG after that.
epicurus (Epicurus)
New member
Username: Epicurus

Post Number: 14
Registered: 11-2012
Posted on Tuesday, February 05, 2013 - 2:31 pm:   

Hi Malcom,

I didn't know it is not possible to drop with add-partial. This was my problem.

I implemented your first solution (I prefer not to complicate the graphics if possible) and now my game works perfectly.

Many thanks! :-)
epicurus (Epicurus)
New member
Username: Epicurus

Post Number: 17
Registered: 11-2012
Posted on Monday, March 04, 2013 - 10:04 am:   

The outcome of this discussion is a new game, Eximo.

You can find the official page of Eximo here:

http://www.zillions-of-games.com/cgi-bin/zilligames/submissions.cgi?id=2084
epicurus (Epicurus)
New member
Username: Epicurus

Post Number: 19
Registered: 11-2012
Posted on Monday, March 04, 2013 - 10:14 am:   

Eximo Zillions Page

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: