Create account / Log in

Trigger as Listener?

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Trigger as Listener?

Postby mycenae » February 23rd, 2011, 4:01 pm

Can a Trigger be set up to passively listen for a set of conditions, and then fire? There should be no player intervention or required keystrokes.

I'm trying to have a trigger fire on a piece when a certain dice result comes up. I've been using the 'Trigger when properties match' box but the piece doesn't react--I have to trigger it manually.
mycenae
 
Posts: 394
Joined: May 16th, 2008, 6:41 pm

Re: [messages] [Module Design] Trigger as Listener?

Postby Tim M » February 23rd, 2011, 4:38 pm

No, there is no true passitivity currently in Vassal. Youll always need a
keystoke somewhere (even if silent/hidden from player interaction) to make
things happen right now. What you want requires an evolution so to speak of the
current functions in how they work.




________________________________
From: mycenae
To: messages@vassalengine.org
Sent: Wed, February 23, 2011 10:01:55 AM
Subject: [messages] [Module Design] Trigger as Listener?

Can a Trigger be set up to passively listen for a set of conditions, and
then fire? There should be no player intervention or required
keystrokes.
I'm trying to have a trigger fire on a piece when a certain dice result
comes up. I've been using the 'Trigger when properties match' box but
the piece doesn't react--I have to trigger it manually.

_______________________________________________
Read this topic online here:
viewtopic.php?p=21960#p21960
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: 1812
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: [messages] [Module Design] Trigger as Listener?

Postby pgeerkens » February 23rd, 2011, 4:44 pm

I think one could achieve this effect by putting a multi-action button on
the toolbar, which first invokes the die-roller, setting a global property
with the result, and then sends a GKC to all pieces on the board.



Thoughts?



Pieter

_____

From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of Timothy Mccarron
Sent: Wednesday, February 23, 2011 11:38 AM
To: messages@vassalengine.org
Subject: Re: [messages] [Module Design] Trigger as Listener?



No, there is no true passitivity currently in Vassal. Youll always need a
keystoke somewhere (even if silent/hidden from player interaction) to make
things happen right now. What you want requires an evolution so to speak of
the current functions in how they work.





_____

From: mycenae
To: messages@vassalengine.org
Sent: Wed, February 23, 2011 10:01:55 AM
Subject: [messages] [Module Design] Trigger as Listener?

Can a Trigger be set up to passively listen for a set of conditions, and
then fire? There should be no player intervention or required
keystrokes.
I'm trying to have a trigger fire on a piece when a certain dice result
comes up. I've been using the 'Trigger when properties match' box but
the piece doesn't react--I have to trigger it manually.

_______________________________________________
Read this topic online here:
viewtopic.php?p=21960#p21960
Pieter
-----------------------------------------
"Even on the attack, I found the spade [to be] the equal of the rifle."
Erwin Rommel, Infantry Attacks
User avatar
pgeerkens
 
Posts: 228
Joined: September 12th, 2010, 4:33 am
Location: Hamilton, Ontario, Canada

Re: [messages] [Module Design] Trigger as Listener?

Postby Tim M » February 23rd, 2011, 4:57 pm

Thats the way to do it right now.



________________________________
From: pgeerkens
To: messages@vassalengine.org
Sent: Wed, February 23, 2011 10:42:41 AM
Subject: Re: [messages] [Module Design] Trigger as Listener?


I think one could achieve this effect by putting a multi-action button on the
toolbar, which first invokes the die-roller, setting a global property with the
result, and then sends a GKC to all pieces on the board.

 
Thoughts?
 
Pieter

________________________________

From:messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of Timothy Mccarron
Sent: Wednesday, February 23, 2011 11:38 AM
To: messages@vassalengine.org
Subject: Re: [messages] [Module Design] Trigger as Listener?
 
No, there is no true passitivity currently in Vassal. Youll always need a
keystoke somewhere (even if silent/hidden from player interaction) to make
things happen right now. What you want requires an evolution so to speak of the
current functions in how they work.

 
 

________________________________

From:mycenae
To: messages@vassalengine.org
Sent: Wed, February 23, 2011 10:01:55 AM
Subject: [messages] [Module Design] Trigger as Listener?

Can a Trigger be set up to passively listen for a set of conditions, and
then fire? There should be no player intervention or required
keystrokes.
I'm trying to have a trigger fire on a piece when a certain dice result
comes up. I've been using the 'Trigger when properties match' box but
the piece doesn't react--I have to trigger it manually.

_______________________________________________
Read this topic online here:
viewtopic.php?p=21960#p21960
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: 1812
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Trigger as Listener?

Postby mycenae » February 23rd, 2011, 9:39 pm

Thanks, Pieter, that actually works beautifully! I got it to work in a test module.

So now there's an additional complication. The GKC that checks for the die roll result should also check a certain on each affected piece and only affect the ones of a certain color. So I'd like to put a complex property check in the GKC 'Matching Properties' box, but I'm not sure of the syntax of the statement to make sure it's evaluated right. Would it use parentheses? Wavy brackets? Square brackets?

The raw statement would look something like this:

$Dice_result$ = 3 || $Dice_result$ = 10 && $Color$=Red || $Color$ = Blue

This is intended to tell the GKC, if the result is a 3 or a 10, and the piece is Red or Blue, fire.

How would this get punctuated? It doesn't seem to be documented.
mycenae
 
Posts: 394
Joined: May 16th, 2008, 6:41 pm

Re: [messages] [Module Design] Re: Trigger as Listener?

Postby pgeerkens » February 23rd, 2011, 11:06 pm

I believe you need to set this up with complex variables, so that the test
looks something like this:

$Mod_Dice_Result$ = 10_3 && $Mod_Color$ = Red_Blue

With earlier tests setting Mod_Dice_Result and Mod_Color

At this time there is no provision for brackets, or precedence, in the
expression tester.

Pieter

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of mycenae
Sent: Wednesday, February 23, 2011 4:39 PM
To: messages@vassalengine.org
Subject: [messages] [Module Design] Re: Trigger as Listener?

Thanks, Pieter, that actually works beautifully! I got it to work in a
test module.

So now there's an additional complication. The GKC that checks for the
die roll result should also check a certain on each affected piece and
only affect the ones of a certain color. So I'd like to put a complex
property check in the GKC 'Matching Properties' box, but I'm not sure of
the syntax of the statement to make sure it's evaluated right. Would it
use parentheses? Wavy brackets? Square brackets?

The raw statement would look something like this:

$Dice_result$ = 3 || $Dice_result$ = 10 && $Color$=Red || $Color$ = Blue

This is intended to tell the GKC, if the result is a 3 or a 10, and the
piece is Red or Blue, fire.

How would this get punctuated? It doesn't seem to be documented.

_______________________________________________
Read this topic online here:
viewtopic.php?p=21965#p21965
Pieter
-----------------------------------------
"Even on the attack, I found the spade [to be] the equal of the rifle."
Erwin Rommel, Infantry Attacks
User avatar
pgeerkens
 
Posts: 228
Joined: September 12th, 2010, 4:33 am
Location: Hamilton, Ontario, Canada

Re: [messages] [Module Design] Re: Trigger as Listener?

Postby Tim M » February 23rd, 2011, 11:47 pm

I think you would want to use a regular expression

$Dice_result$ ~= 10|3 && $Color$ ~=Red|Blue

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of pgeerkens
Sent: Wednesday, February 23, 2011 5:05 PM
To: messages@vassalengine.org
Subject: Re: [messages] [Module Design] Re: Trigger as Listener?

I believe you need to set this up with complex variables, so that the test
looks something like this:

$Mod_Dice_Result$ = 10_3 && $Mod_Color$ = Red_Blue

With earlier tests setting Mod_Dice_Result and Mod_Color

At this time there is no provision for brackets, or precedence, in the
expression tester.

Pieter

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of mycenae
Sent: Wednesday, February 23, 2011 4:39 PM
To: messages@vassalengine.org
Subject: [messages] [Module Design] Re: Trigger as Listener?

Thanks, Pieter, that actually works beautifully! I got it to work in a
test module.

So now there's an additional complication. The GKC that checks for the
die roll result should also check a certain on each affected piece and
only affect the ones of a certain color. So I'd like to put a complex
property check in the GKC 'Matching Properties' box, but I'm not sure of
the syntax of the statement to make sure it's evaluated right. Would it
use parentheses? Wavy brackets? Square brackets?

The raw statement would look something like this:

$Dice_result$ = 3 || $Dice_result$ = 10 && $Color$=Red || $Color$ = Blue

This is intended to tell the GKC, if the result is a 3 or a 10, and the
piece is Red or Blue, fire.

How would this get punctuated? It doesn't seem to be documented.

_______________________________________________
Read this topic online here:
viewtopic.php?p=21965#p21965
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: 1812
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Trigger as Listener?

Postby iam2509 » July 18th, 2011, 2:08 am

$Dice_result$ = 3 || $Dice_result$ = 10 && $Color$=Red || $Color$ = Blue

I know this is a monkey with a math problem type of question but where on the keyboard are the up and down lines between 3 and $, and Red and $? ie How does someone put those up and down lines in when typing?

Thanks
User avatar
iam2509
 
Posts: 72
Joined: August 1st, 2010, 12:01 am

Re: Trigger as Listener?

Postby mycenae » July 18th, 2011, 2:52 am

Those vertical bar characters (|) are called 'pipes'.

On my Mac keyboard, the pipe is on the backslash (\) key above the Return button, but it might be different on a PC keyboard.
mycenae
 
Posts: 394
Joined: May 16th, 2008, 6:41 pm

Re: Trigger as Listener?

Postby iam2509 » July 18th, 2011, 3:10 am

||||||!!!!!

Mycenae,

Thanks (Two broken up and down lines appear above my backslash so never thought it would appear as a solid up and down line)
User avatar
iam2509
 
Posts: 72
Joined: August 1st, 2010, 12:01 am

Re: [messages] [Module Design] Re: Trigger as Listener?

Postby uckelman » July 18th, 2011, 8:39 am

Thus spake iam2509:
> $Dice_result$ = 3 __||__ $Dice_result$ = 10 && $Color$=Red __||__
> $Color$ = Blue
>
> I know this is a monkey with a math problem type of question but where
> on the keyboard are the up and down lines between 3 and $, and Red and
> $? ie How does someone put those up and down lines in when typing?
>

The pipe '|' is the shifted character on the backslash key on my keyboard.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8798
Joined: December 10th, 2007, 9:48 am
Location: Durham, England


Return to Module Design

Who is online

Users browsing this forum: No registered users and 2 guests