[messages] [Module Design] Re: Report Action problem

zmpouf the_ar at freemail.gr
Mon Nov 21 09:14:01 MST 2011


I have another problem with reporting.

Since I don't like the auto-report format a map window offers (moving
within/to/in this map) I decided to go with custom reporting. But the
auto-report has an advantage: When you move a stack, the report returns
a $pieceName$ value as "piece 1, piece 2, ... , piece x". In custom
reporting each piece reports alone, so if I move a stack with 10 pieces
I get 10 lines of reporting.

To use one line reporting I thought of making a global property to write
the moved pieces' names and then use it's value with a report action
trait. 

What I have done:

a. In my main map window I set the Key command to apply when ending
movement: ALT CTRL SHIFT MINUS

b. Add a gp named "CUmoved" (without "")

then on the piece I wanted to report I placed the following traits in
this order:

c. Dynamic property trait, 
Name: hasmoved 
Value: false 
Key command: ALT CTRL F6 -set value directly - New Value: true 
Key command: ALT CTRL F7 - set value directly - New Value: false 

d. Set Global Property trait,
GP Name: CUmoved ,
Key Command ALT CTRL F1 - set value directly - New Value " " (just a
space character)

e.Trigger action trait,
watch for: ALT CTRL SHIFT MINUS
Perform: ALT CTRL F6 , ALT CTRL F1 , ALT CTRL F2

f. Global Key command trait,
Keyboard Command: ALT CTRL F2
Global Key Command: ALT CTRL F3
Matching Properties: hasmoved=true
Restrict range: yes
Fixed Range: yes
Range: 1

g. Set Global Property trait,
GP Name: CUmoved ,
Key Command ALT CTRL F4 - set value directly - New Value
"$CUmoved$$PieceName$, "

h. Trigger action trait,
watch for: ALT CTRL F3
Perform: ALT CTRL F4 , ALT CTRL F5 , ALT CTRL F7

i. Report Action trait,
Report on keystrokes: ALT CTRL F5
Report format: $playerName$ moved $CUmoved$

the above doesn't work:
problem 1: The report action trait doesn't report anything.

problem 2: the CUmoved GP gets the name of the top piece in the stack
only. 

If I remove the Matching Properties: hasmoved=true from step f then it
gets all names correctly. But then, if I move a two piece stack in a
location that already contains a piece of the same type, the CUmoved GP
gets the names of all three pieces. 


The way I wanted to work is this:

Move a stack with two pieces from irregular_grid_1 to irregular_grid_2, 
trigger an end movement on map (step e.), 
change the value of "hasmoved" to "true" in all pieces in stack (step
c.),
send a key command to all pieces in irregular_grid_2 that moved now
(here comes the use of the hasmoved propery - If I move the pieces to
irregular_grid_2 but there existed another piece then I would trigger
this piece too),
each of the pieces I sent the key command adds it's name to the CUmoved
Global variable,
report the pieces moved by using the $CUmoved$ value
set all pieces hasmoved property to value false.

What am I doing wrong? I would like a why too because I can't figure
this out.

Sorry for the long post.

Cheers,
Andreas

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=27697#p27697


More information about the messages mailing list