Page 1 of 2

Help Needed With Counters.

Posted: 29 Jan 2010, 15:07
by RawMessiah
Hello everyone,


I have trouble when I want to have more than one map with counters/figures. I have managed to create one map with counters (they're figures in the game):

Code: Select all

<counter-sheet name="Marines"

front-image-file="Marines.png" front-resolution="300 dpi"
front-mask-file="MarinesMask.png" back-resolution="300 dpi">
<counter-section rows="4" columns="4"
front-left="0" front-top="1" front-right="1103" front-bottom="1020"/>

</counter-sheet>
[/b]


Problem is I want another map with different, round counters, but I don't seem to get it to work. Here is what I try that doesn't work:

Code: Select all

<counter-sheet name="Marines"

front-image-file="Marines.png" front-resolution="300 dpi"
front-mask-file="MarinesMask.png" back-resolution="300 dpi">
<counter-section rows="4" columns="4"
front-left="0" front-top="1" front-right="1103" front-bottom="1020"/>

</counter-sheet>


<counter-sheet name="Blips"

front-image-file="BlipsFront.png" front-resolution="300 dpi"
front-mask-file="BlipsFrontMask.png" back-resolution="300 dpi">
<counter-section rows="3" columns="9"
front-left="0" front-top="1" front-right="1700" front-bottom="680"/>

</counter-sheet>
[/b]


The thing is, it works if I copy the first counter-sheet so I have two "Marines" counters, but when I try to replace the second counter-sheet with different pics (different counters) it won't work.


Anyone have a suggestion?



Thanks in advance,

Andrew

Posted: 29 Jan 2010, 17:27
by Bill Barrett
When you say it doesn't work, what exactly do you mean - what error messages are you getting?

Regards, Bill.

Posted: 29 Jan 2010, 21:07
by RawMessiah
It won't start the game... I get a pop-up window that says 'error' and it won't run the game.

Posted: 29 Jan 2010, 21:09
by Bill Barrett
Yes - but what's the error?

Posted: 29 Jan 2010, 21:22
by RawMessiah
OK, I don't dare to say this, but it must be that I'm tired (it's evening here) but I hadn't added the pics in my game-box...

*goes and hides in a corner, red-faced*

Posted: 29 Jan 2010, 21:23
by bggames01
When you get the exception click on the blue link in the window and it will give you more information about the error.

Why do you have a back-resolution in there?

Posted: 01 Feb 2010, 07:44
by RawMessiah
The counters aren't square, that's why I've added the back-resolution.

Posted: 01 Feb 2010, 07:54
by bggames01
back-resolution has nothing to do with the mask. The back of the counters is when you flip them over to their backside.

Posted: 04 Feb 2010, 06:55
by RawMessiah
Speaking of that, I have a problem with flipping the counters. Now I'm not a guru when it comes to codes... I have managed to make it so when I flip one counter all the counters flip. I took the example from ZunTzu website but it won't help, any suggestions?

Posted: 04 Feb 2010, 09:55
by bggames01
Example:

Code: Select all

<counter-sheet name="Counters1"
 front-image-file="counters1-front.png" front-resolution="150 dpi"
 back-image-file="counters1-back.png" back-resolution="150 dpi">
 <counter-section rows="2" columns="10"
  front-left="30" front-top="45" front-right="782" front-bottom="201" 
  back-left="808" back-top="47" back-right="1560" back-bottom="202"
 />
 <counter-section rows="2" columns="10"
  front-left="30" front-top="216" front-right="781" front-bottom="370" 
  back-left="808" back-top="219" back-right="1560" back-bottom="371"
 />
 <counter-section rows="2" columns="10"
  front-left="28" front-top="386" front-right="781" front-bottom="537" 
  back-left="809" back-top="391" back-right="1561" back-bottom="538"
 />
 <counter-section rows="2" columns="10"
  front-left="29" front-top="555" front-right="781" front-bottom="705" 
  back-left="810" back-top="556" back-right="1563" back-bottom="706"
 />
 <counter-section rows="2" columns="10"
  front-left="28" front-top="722" front-right="781" front-bottom="877" 
  back-left="810" back-top="725" back-right="1562" back-bottom="880"
 />
 <counter-section rows="2" columns="10"
  front-left="29" front-top="892" front-right="783" front-bottom="1046" 
  back-left="808" back-top="897" back-right="1561" back-bottom="1049"
 />
 <counter-section rows="1" columns="10"
  front-left="28" front-top="1063" front-right="783" front-bottom="1140" 
  back-left="808" back-top="1067" back-right="1560" back-bottom="1145"
 />
           
 <counter-section rows="2" columns="10"
  front-left="817" front-top="47" front-right="1567" front-bottom="202" 
  back-left="19" back-top="48" back-right="775" back-bottom="204"
 />
 <counter-section rows="2" columns="10"
  front-left="815" front-top="220" front-right="1566" front-bottom="370" 
  back-left="21" back-top="224" back-right="776" back-bottom="373"
 />
 <counter-section rows="2" columns="10"
  front-left="815" front-top="388" front-right="1567" front-bottom="539" 
  back-left="21" back-top="391" back-right="777" back-bottom="543"
 />
 <counter-section rows="2" columns="10"
  front-left="814" front-top="561" front-right="1565" front-bottom="708" 
  back-left="22" back-top="562" back-right="778" back-bottom="711"
 />
 <counter-section rows="2" columns="10"
  front-left="815" front-top="730" front-right="1567" front-bottom="877" 
  back-left="21" back-top="730" back-right="777" back-bottom="877"
 />
 <counter-section rows="2" columns="10"
  front-left="817" front-top="898" front-right="1567" front-bottom="1046" 
  back-left="20" back-top="898" back-right="775" back-bottom="1046"
 />
 <counter-section rows="1" columns="10"
  front-left="821" front-top="1066" front-right="1572" front-bottom="1140" 
  back-left="14" back-top="1068" back-right="771" back-bottom="1145"
 />
</counter-sheet>

Posted: 05 Feb 2010, 07:27
by RawMessiah
One thing I don't get is where the rows and columns come from. In TunTzu's example they had several 'row-10' & 'column - 6', and then some with other numbers. What do they represent? I mean, their example has 6 counters by 3.

Sorry that I'm not a smart-a**... :)

Posted: 05 Feb 2010, 08:50
by bggames01
With the 4 coordinates you determine the rectangle of the area where you counters are in that graphic. By using the rows and columns attributes you can have ZunTzu automatically split up that area in equal division by the number of rows (vertically) and columns (horizontally).

So, another example:
Your counter.png has 6 counters on it, from 0,0 to 300,200 (no border around it, just counter).
You could do each counter individually, like:

Code: Select all

<counter-section rows="1" columns="1" 
  front-left="0" front-top="0" front-right="100" front-bottom="100" />
<counter-section rows="1" columns="1" 
  front-left="100" front-top="0" front-right="200" front-bottom="100" />
<counter-section rows="1" columns="1" 
  front-left="200" front-top="0" front-right="300" front-bottom="100" />
<counter-section rows="1" columns="1" 
  front-left="0" front-top="100" front-right="100" front-bottom="200" />
<counter-section rows="1" columns="1" 
  front-left="100" front-top="100" front-right="200" front-bottom="200" />
<counter-section rows="1" columns="1" 
  front-left="200" front-top="100" front-right="300" front-bottom="200" />
But that is just a lot of work. If you say:

Code: Select all

<counter-section rows="2" columns="3" 
  front-left="0" front-top="0" front-right="300" front-bottom="200" />
Now you have replaced those 6 items with just 1, and ZunTzu will do the cutting for you. It will create:
2*3 = 6 counters of equal size
width: 300 / columns = 100 wide
height: 200 / rows = 100 tall

You only say rows and columns once since you always create 1 background for each 1 foreground (never an unequal number). So if you create 6 front counters, you create 6 back counters as well.

ZunTzu will do the same cutting for you on your background counters image, and match up the images.

Foreground image:
A B C
D E F
Background image:
c b a
f e d

Code: Select all

<counter-section rows="2" columns="3" 
  front-left="0" front-top="0" front-right="300" front-bottom="200"
  back-left="0" back-top="0" back-right="300" back-bottom="200" 
/>
And done.

Posted: 05 Feb 2010, 09:57
by RawMessiah
THis is how I did, like you explained (the more simple way of doing it):

Code: Select all

<counter-sheet name="Blips" 

front-image-file="BlipsFront.png" front-resolution="300 dpi" 
front-mask-file="BlipsFrontMask.png" back-resolution="300 dpi"> 
<counter-section rows="3" columns="9" 
front-left="0" front-top="1" front-right="1700" front-bottom="680"/> 

</counter-sheet> 

It works for me, but it flips all the counters at the same time. Now, is it a big deal if you have the counters like this:

OOOOOOOOO
OOOO
OOOOOOOOO

Those represent the counters.

I can drag the counters, no problems, but they all flip at the same time.

Posted: 05 Feb 2010, 10:02
by bggames01
You have not set the back-image-file, nor back-mask-file, and you have not set any of the counter-section back-left, back-top, back-right, back-bottom.

Posted: 05 Feb 2010, 10:08
by RawMessiah
Sorry, this was the real code:

Code: Select all

<counter-sheet name="Blips"
		front-image-file="BlipsFront.png" front-resolution="300 dpi"
		front-mask-file="BlipsFrontMask.png"
		back-image-file="BlipsBack.png" back-resolution="300 dpi"
		back-mask-file="BlipsBackMask.png">
		<counter-section rows="3" columns="9"
		front-left="0" front-top="1" front-right="1350" front-bottom="450"/>
	</counter-sheet>

I'll do what you asked me to do. Let's see if I get it to work.