Create account / Log in

Keep track of placed Tiles

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Keep track of placed Tiles

Postby inSane » November 18th, 2012, 11:16 am

Hi,

Can somebody give me the gist how to keep track of placed tiles of a player? In case of 1 played tile, just the correct coloured border around the tile, and in case of 2 played tiles, I've got an image with a coloured border and a '1' for the first played tile, and one with a '2' for the second. And start this over in a new turn.

Thanks
inSane
 
Posts: 45
Joined: June 1st, 2012, 4:09 pm

Re: Keep track of placed Tiles

Postby inSane » November 19th, 2012, 7:30 pm

So far I've got:
1) a game piece prototype definition with for every colour a layer trait with my 3 images (coloured border, coloured border with a '1' and coloured border with a '2')
2) a trigger action so a player can indicate a played tile
3) a global key command to indicate end of turn
inSane
 
Posts: 45
Joined: June 1st, 2012, 4:09 pm

Re: Keep track of placed Tiles

Postby inSane » November 22nd, 2012, 1:03 pm

Hi,

The Carcassonne.2.0.5 module uses those borders. Every tile has a 'replace with other' trait for every player colour. As far as I can figure it out, a placed tile is replaced with the same looking tile, with different traits, to make it unmovable, change dynamic properties and so on.
Can you use this trait in some way in a game piece protoype definition? Automagically reuse the original image for example as to not have to add those traits 6times to every tile I have.

inSane
inSane
 
Posts: 45
Joined: June 1st, 2012, 4:09 pm

Re: Keep track of placed Tiles

Postby inSane » November 22nd, 2012, 5:41 pm

Hi,

A small step toward a solution:
Add a 'replace with other' followed by a 'clone' trait with the same keyboard commands.
The defined replacement has an empty basic piece, then a layer trait with the desired border as first level, a transparant image as second level (otherwise the does not stack trait "doesn't work"), and a 'does not stack' trait as last. The player has to invoke the border via right-click menu, and a global key command invokes the second level of the layer trait (=removes the highlight).

So 2 remaining questions:
1 how to differentiate between players (so green gets the same right-click option but puts a green border around the tile),
2 can a global key command be invoked at the start of a turn? to automatically remove the highlights of a player?

thanks
inSane
 
Posts: 45
Joined: June 1st, 2012, 4:09 pm

Re: Keep track of placed Tiles

Postby DrNostromo » November 23rd, 2012, 4:08 pm

1 how to differentiate between players (so green gets the same right-click option but puts a green border around the tile),


You should be able to use the PlayerSide = $CurrentPlayer$ filter in there somewhere. That's a common filter whenever you want an action tied the player committing the action.

2 can a global key command be invoked at the start of a turn? to automatically remove the highlights of a player?


If you use a button or some command to start a new turn, you can have it evoke a GKC to all tiles to reset them. Give all the tiles a Marker trait like...

TileType = Units

Then send the GKC to apply to all pieces with

CurrentMap = (map the units are on) && TileType = Units
User avatar
DrNostromo
 
Posts: 1061
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: Keep track of placed Tiles

Postby inSane » November 24th, 2012, 12:36 pm

Hi,

I can't get it to work. I used the example in this topic (shipcontrol)
viewtopic.php?f=6&t=3449&p=20806&hilit=ship+control#p20806 without success.

& I think the "change playerside to numeric value" trick isn't actually no longer necessary, if I understand this topic correctly:
viewtopic.php?f=4&t=5101&p=35771&hilit=layer+language#p35771
but still gives me a 'numeric field contains a non-number' error

What exactly should I put in the Follow Expression box of the layer trait & what does the 'level 1=' means?

inSane
inSane
 
Posts: 45
Joined: June 1st, 2012, 4:09 pm

Re: Keep track of placed Tiles

Postby inSane » November 24th, 2012, 2:21 pm

Hi,

If it can help, my modulue is available at http://users.telenet.be/helaba/ (work in progress & removed most of it to reduce the filesize) (select an expansion first to get some tiles, borders for a Black & a Green player are included)

I settle for the 3 rightclick options (place only 1 tile, place first of 2 & place second of 2)
Can this be done automatically? Black picks a nice spot to lay a tile, right-clicks 'Place Tile', vassal puts a black border around the tile. In case Black plays a second tile in his or her turn, picks a spot, right-clicks 'Place Tile' and vassal puts a black border around this tile with a '2' on it & changes the first border to a border with a '1'. That's it. The black borders stay in place during playtime of Green (who adds 1 or 2 Green borders), but should be removed when Black starts a new turn.

inSane
inSane
 
Posts: 45
Joined: June 1st, 2012, 4:09 pm

Re: Keep track of placed Tiles

Postby inSane » November 24th, 2012, 5:40 pm

Hi,

Almost solved, although not automated, but I'm ok with that :D
So I made a seperate definition for every color, with the rightclick options to add the correct border and make the tile immovable. The trick was to add a restrict command to hide the 3 rightclick options for everyone but the current player. I still don't understand why I cant use playerSide|=Black for instance in the 'restrict when properties match' field but have to use Who|=Black and add a 'calculated Property' Who=PlayerSide?

A Global Key Command "Start Turn Black" invokes the key command used in the layer traits to reset the layers (actually remove my borders)

So my next question: What to fill in the 'matching properties' field to exclude the use of this GKC to everyone but Black? How to implement my calculated property detour on my highlight definition? (Afterwards I put all those GKC's in a multi-action button)

inSane
inSane
 
Posts: 45
Joined: June 1st, 2012, 4:09 pm

Re: Keep track of placed Tiles

Postby DrNostromo » November 25th, 2012, 3:13 am

I downloaded the mod you had a link to this morning so it doesn't have the newest stuff in it. Do you have an updated version? I'll probably have some time tomorrow (I hope) to take a look at it and offer some suggestions.
User avatar
DrNostromo
 
Posts: 1061
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: Keep track of placed Tiles

Postby inSane » November 25th, 2012, 7:13 am

Updated version now available

The last 'matching properties' I came up with are even ignored {$CurrentPlayer$==Black} or {CurrentPlayer==Green}
inSane
 
Posts: 45
Joined: June 1st, 2012, 4:09 pm

Re: Keep track of placed Tiles

Postby DrNostromo » November 25th, 2012, 4:32 pm

I downloaded the new version.

In the meantime, try changing the property filter to...

CurrentPlayer = Black || CurrentPlayer = Green

That's old style Vassal syntax which I still use unless I need to calculate something.
User avatar
DrNostromo
 
Posts: 1061
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: Keep track of placed Tiles

Postby inSane » November 27th, 2012, 9:17 am

Old style doesn't work either for me.
And why the || ?
inSane
 
Posts: 45
Joined: June 1st, 2012, 4:09 pm

Re: Keep track of placed Tiles

Postby DrNostromo » November 27th, 2012, 3:22 pm

&& = and
|| = or

Didn't get a chance to look into last weekend. I'm trying to find some time to look at it.
User avatar
DrNostromo
 
Posts: 1061
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: Keep track of placed Tiles

Postby DrNostromo » November 27th, 2012, 3:56 pm

I looked at the module and I'm not clear on what it is you want to do. You can send me an E-mail and maybe we can arrange a time to get together on voice chat ...I have a ventrilo server.

DrNostromo@DrNostromo.com
User avatar
DrNostromo
 
Posts: 1061
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: Keep track of placed Tiles

Postby inSane » November 27th, 2012, 4:34 pm

Hi,

thanks so far for helping out:

Basically I want to do the same as in the already available carcassonne module:
http://www.vassalengine.org/wiki/Module:Carcassonne
If black plays a tile, vassal puts a black border around the played tile, and keeps it there visible to all players and removes it when black starts a new turn.
A new expansion for Carcassonne makes it possible to sometimes lay 2 tiles in a turn, that's what I want to add. That's why the 3 different highlights per color.)

And I'm almost done (although not automated)

The only thing left: I've got a GKC per player which -when triggered- removes those borders, but so far everyone sees & can invoke those triggers for all colors, I want the GKC for Black only available for Black, but whatever I fill in the matching properties I can't get it to work as wanted.

inSane
inSane
 
Posts: 45
Joined: June 1st, 2012, 4:09 pm

Next

Return to Module Design

Who is online

Users browsing this forum: Bing [Bot] and 4 guests