Keep track of placed Tiles

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

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

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

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

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.

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

Hi,

I can’t get it to work. I used the example in this topic (shipcontrol)
https://forum.vassalengine.org/t/counter-creation/3316/7 without success.

& I think the “change playerside to numeric value” trick isn’t actually no longer necessary, if I understand this topic correctly:
https://forum.vassalengine.org/t/side-specific-layers-language-choice/4847/7
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

Hi,

If it can help, my modulue is available at 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

Hi,

Almost solved, although not automated, but I’m ok with that :smiley:
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

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.

Updated version now available

The last ‘matching properties’ I came up with are even ignored {$CurrentPlayer$==Black} or {CurrentPlayer==Green}

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.

Old style doesn’t work either for me.
And why the || ?

&& = and
|| = or

Didn’t get a chance to look into last weekend. I’m trying to find some time to look at it.

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

Hi,

thanks so far for helping out:

Basically I want to do the same as in the already available carcassonne module:
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

Hi,

I just found the correct matching property by using the expression builder (insert constant > string puts “” around Black): {PlayerSide==“Black”} never tried the " around Black myself.

So with 3 right-click options per player, it works :slight_smile:

(The automation should reduce those 3 right click options to only 1: Place Tile. When triggered the first time vassal puts the highlight-0 on the tile, in case it’s triggered a second time, vassal puts the highlight-2 on the second tile & changes highlight-0 to highlight-1 on the first tile. Don’t put to much effort in finding a solution for this, I’ m completly satisfied with the current solution)

I updated my version for who’s interested.

inSane

I think you’re overthinking the problem as you may not be familiar with many of the traits that can be used to do this. I’ve summed it up with about 8 commands in the StandardTile prototype.

Here’s a link to an updated version of your file. You’ll find the .vmod and a .txt in the zip file.

Carcassone Fix

If you downloaded the zip package before reading this, it’s been updated.

Download it again.

Hi,

Your first try worked best, second doesn’t remove the highlights anymore.

I’ve added my highlight definitions into my final vmod, but now java runs away with all ram and throws an error when I want to save a game (run out of memory). The same vmod without the highlight definitions works just fine. The definitons in my barebone vmod also work. How can I ever find what’s conflicting in my final vmod?

I’ve uploaded my complete final vmod (removed all tile images except the basegame tiles & all other images, decks, boards, maps and so on still included)
users.telenet.be/helaba/

inSane

I think you’re running into a loop. You’re using the same command to produce a clone and then you’re using the Replace with Other to remove the original piece. The “other” tile is then cloning and replacing the other clone, which is being cloned and then replaced, etc.

You don’t have to replace anything. You should be able to use a Layer trait with a Dynamic Property trait, like I have in the sample I sent you, to handle all of that. In fact, you should avoid using the Clone command altogether unless you have a situation in a game where a duplicate on a piece must be generated during game play.

For example: In the game I’m working on now, I have a particular creature card where, if the player doesn’t kill the creature in a certain number of combat segments, another one shows up. That’s the only place in the entire mod that I’m using the Clone trait.

I’d give you more help but I don’t know the rules of the original Carcassonne and I don’t own a hard copy. I’m not clear on what a player is supposed to do during their turn. But, from what I can gather, it appears that the mod has become overly complicated for a fairly simple task. If you could detail to me exactly what a player is supposed to do during their turn, I might be able to give you further assistance …time permitting.

PS - If you send me an E-mail, I can send you an invitation to my DropBox so that we may exchange files easier.

DrNostromo@DrNostromo.com