Create account / Log in

Switching Text Labels

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Switching Text Labels

Postby DrNostromo » January 14th, 2008, 4:29 am

I'm at a loss here on how to do something that's probably very simple.

The players have a playing token depicting their character. The character may be in a number of different conditions - normal, poisoned, losing turns, busy, etc.

If the character's condition is normal, I don't want any text label displayed on the token. However, if the player is in another condition, I want that condition to be displayed as a text label on the token. I would like this change to be made via a right-click menu option.

I've tried to create a set of text label options and nest them in a sub-menu but they all display on the piece at the same time and when I attempt to change the token's condition, I get an entry box.

Needless to say, I'm confused. Could someone clue me in.

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

Switching Text Labels

Postby Brent Easton » January 14th, 2008, 5:02 am

Hi Fritz,

Text Labels are not really designed for this job, they with a lot of effort, they can be shoehorned into this role. As you can see, the standard function of a Tex Label is to pop a dialog where a player can manually enter some text that will then be displayed.

For displaying this sort of status information, most people use Layers to display small images that show the status of the character. The images can be either small symbols (.g. a little bottle of poison to display 'Poisoned' status), or images of a word.

Use a different Layer and a different command key for each status you want to display so that they can all be turned on/off individually.

Regards,
Brent.

*********** REPLY SEPARATOR ***********

On 13/01/2008 at 8:29 PM Dr_Nostromo wrote:

I'm at a loss here on how to do something that's probably very simple.

The players have a playing token depicting their character. The character
may be in a number of different conditions - normal, poisoned, losing
turns, busy, etc.

If the character's condition is normal, I don't want any text label
displayed on the token. However, if the player is in another condition, I
want that condition to be displayed as a text label on the token. I would
like this change to be made via a right-click menu option.

I've tried to create a set of text label options and nest them in a
sub-menu but they all display on the piece at the same time and when I
attempt to change the token's condition, I get an entry box.

Needless to say, I'm confused. Could someone clue me in.

thanx

------------------------
"Are they slow moving, Chief?"
"Yeah, they're dead ...they're all messed up"
-- Night of the Living Dead

Dr_Nostromo aka Fritz Goot aka Zett_Riff
Creator - To Be King
http://www.drnostromo.com/hacx/tbk.html







_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.2/1222 - Release Date: 13/01/2008 12:23 PM


____________________________________________________________
Brent Easton
Analyst/Programmer
University of Western Sydney
Email: b.easton@uws.edu.au


_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
Brent Easton
 
Posts: 3255
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Postby DrNostromo » January 14th, 2008, 8:11 am

Ok. that explains my problem.

I did use layers before. I had 8 graphics - 1 normal without a label and 7 with the condition lable on them - for each race. But with player tokens for 20 different races - each with a male and female version - that's 320 graphics and, with everything else, my mod ballooned to 60 megs.

I figured out a few more tricks using graphic overlays in some areas and I was able to cut the mod down to 32 megs. I'd hate to have to toss all those token graphics back in there as that'll run it up another 6 megs.

Maybe I'll just use status chits that players can place on their tokens. Have to think about that one.

Seems that a status label on pieces that could be changed by the user would be a popular item. Is there any plans for such a feature?
User avatar
DrNostromo
 
Posts: 1072
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Postby mehrunes » January 14th, 2008, 8:21 am

What do you use as image format that 320 graphics take up 6 MB ?

The images folder for my module takes up 6 MB too, but it contains over 2000 graphics...

If you don't use very big images, I could guess you did something wrong...
Apologize my bad english - I'm not a native speaker. ;)
mehrunes
 
Posts: 84
Joined: December 28th, 2007, 1:33 am

Postby Tim M » January 14th, 2008, 12:13 pm

If layer/graphics are an issue, you can use a Dynamic Property instead of layer and reference this in your text label also. It would mean more key commands, but it doesn't require graphics
User avatar
Tim M
 
Posts: 1823
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby DrNostromo » January 14th, 2008, 3:26 pm

mehrunes wrote:What do you use as image format that 320 graphics take up 6 MB ?

The images folder for my module takes up 6 MB too, but it contains over 2000 graphics...

If you don't use very big images, I could guess you did something wrong...


The player tokens are 180 x 180 PNG-8 and their size is roughly 20k each.

20k x 320 = 6400k
Last edited by DrNostromo on January 14th, 2008, 3:37 pm, edited 1 time in total.
User avatar
DrNostromo
 
Posts: 1072
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Postby DrNostromo » January 14th, 2008, 3:37 pm

Tim M wrote:If layer/graphics are an issue, you can use a Dynamic Property instead of layer and reference this in your text label also. It would mean more key commands, but it doesn't require graphics


I tried doing that but I'm obviously having a problem figuring out how to make Dynamic Properties work as I made no progress doing it that way.

Some of the explanations for things in the manual leave me completely befuddled and I've figured out how to do most of what I do by trial and error.

I'm sure the manual is fine ...it's just presented with a different sense of logic than I'm used to. Sort of like when you pick up one program and you instictively know it immediately because it was built with the same sense of login you have and then you pick up another program and it's a complete mystery. The vassal manual sort of falls in the latter for me.
User avatar
DrNostromo
 
Posts: 1072
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Switching Text Labels

Postby uckelman » January 14th, 2008, 3:51 pm

Thus spake "Dr_Nostromo":
mehrunes wrote:
What do you use as image format that 320 graphics take up 6 MB ?

The images folder for my module takes up 6 MB too, but it contains over 200
0 graphics...
If you don't use very big images, I could guess you did something wrong...


The player tokens are 180 x 180 (PNG-8) and their size is roughly 20k each.

20k x 320 = 6400k


You could probably reduce the file size of your PNGs by running them
through pngout. pngout is one of several utilities which try to pack
PNGs tighter. The resulting images are pixel-for-pixel identical with
the originals, but can often have dramatically smaller file size.

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 9125
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Switching Text Labels

Postby Tim M » January 14th, 2008, 4:25 pm

I'll put together a simple demo mod for this tonight for you

----- Original Message ----
From: Dr_Nostromo <messages@forums.vassalengine.org>
To: messages@forums.vassalengine.org
Sent: Monday, January 14, 2008 9:37:11 AM
Subject: [Module Design]Re: Switching Text Labels


Tim M wrote:
If layer/graphics are an issue, you can use a Dynamic Property instead of layer and reference this in your text label also. It would mean more key commands, but it doesn't require graphics


I tried doing that but I'm obviously having a problem figuring out how to make Dynamic Properties work as I made no progress doing it that way.

Some of the explanations for things in the manual leave me completely befuddled and I've figured out how to do most of what I do by trial and error.

I'm sure the manual is fine ...it's just presented with a different sense of logic than I'm used to. Sort of like when you pick up one program and you instictively know it immediately because it was built with the same sense of login you have and then you pick up another program and it's a complete mystery. The vassal manual sort of falls in the latter for me.

------------------------
&quot;Are they slow moving, Chief?&quot;
&quot;Yeah, they're dead ...they're all messed up&quot;
-- Night of the Living Dead

Dr_Nostromo aka Fritz Goot aka Zett_Riff
Creator - To Be King
http://www.drnostromo.com/hacx/tbk.html







_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org (Messages@forums.vassalengine.org)
http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1823
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby DrNostromo » January 14th, 2008, 4:57 pm

Thanx for the software suggestion on PNGout. I'll definately look into that.

...and thanx for the assistance, Tim. I appreciate it.
User avatar
DrNostromo
 
Posts: 1072
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Postby Tim M » January 14th, 2008, 6:02 pm

Ok, here's the example mod (inside the zipfile) which links a Dynamic Property with a Text Label.
Right click on the counter to get to the commands as usual and yo uwill see the label change
You can find everything in the At Start Stack under the Map when you edit to see how its done.
Attachments
DP-Text Label.zip
Example showing a Text Label being driven by a Dynamic Property
(2.49 KiB) Downloaded 402 times
User avatar
Tim M
 
Posts: 1823
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby DrNostromo » January 15th, 2008, 4:23 am

I set up all my commands and labels, nested them in a sub-menu and set them up as a prototype for all the player tokens.

Worked perfectly! Thanx!!
User avatar
DrNostromo
 
Posts: 1072
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Postby LurchBrick » January 15th, 2008, 9:48 am

Tim M, you're the MAN!

All these little example mods you put out throughout the forum showing a particular aspect of Vassal have been a great help to my understanding of Vassal.

Perhaps you could collect all these example mods into a single file and have it downloadable somewhere as part of a Vassal tutorial section?
LurchBrick
 
Posts: 39
Joined: December 20th, 2007, 9:27 pm

Postby DrNostromo » January 15th, 2008, 2:27 pm

I was thinking the same thing. The manual instructions on Dynamic Properties didn't make much sense to me but one look at the example Tim put together and I had the whole token labeling system intergrated into my game in 5 minutes.

I, personally, have always been much more of a "show me" person than an "explain to me" person so downloadable examples would be highly desireable.
User avatar
DrNostromo
 
Posts: 1072
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA


Return to Module Design

Who is online

Users browsing this forum: No registered users and 3 guests