[Resolved] actived layer or not actived layer

Hi everybody,

i have a prototype “fire” :

  • a layer of 20 pictures (counter of arrows from 20 to 00)
  • a layer to have a marker ‘offensive fire’.
  • a layer to have a marker ‘defensive fire’
  • a trigger to decrease the arrows when the layer ‘offensive fire’ or ‘defensive fire’ is active.

Tha’s ok… BUT there is a problem :

exemple :

  • CTRL + O : marker ‘offensive fire’ and the arrows decrease from 20 to 19.
  • CTRL + D : marker ‘defensive fire’ and the arrows decrease from 19 to 18.

The problem :
If i switch off the marker ‘offensive fire’, the counter decrease again !
Why ?
Because the other one layer (‘defensive fire’) is still active…
If i switch off the last one layer : no problem of decrease because there is no active layer yet…

I don’t know how to resolve it …
grognards-dbdm.fr/CryHavoc/CryHavoc.mod

Jean-Paul

hi,
nobody has an idea?

I think your example is somewhat difficult to understand.

I think the problem might be that you have the same key commands tied to both layers. That’s not going to work as easily as you think. They should operate on whatever layer catches the commands.

  • M.

2009/3/17 col_klink <messages@forums.vassalengine.org (messages@forums.vassalengine.org)>

Post generated using Mail2Forum (mail2forum.com)

thank you

please have a look here
grognards-dbdm.fr/CryHavoc/CryHavoc.mod

and test with a crossbow :

CTRL-O => offensive fire (and the counter : -1)
CTRL-D => defensive fire (and the counter : -1)
now : CTRL-D again (to switch off offensive fire) : the counter : -1 ! (because the defensive fire is still active…)

please, see prototype : Manage_Missiles and Tir_OffDef

This is the problem. An intermediate step is needed (such as trigger Action) for controlling different layers.

From: Michael Kiefte mkiefte@dal.ca
To: VASSAL Engine Forums Mailing List messages@forums.vassalengine.org
Sent: Tuesday, March 17, 2009 6:52:21 AM
Subject: Re: [Technical Support & Bugs]Re: actived layer or not actived layer

I think your example is somewhat difficult to understand.

I think the problem might be that you have the same key commands tied to both layers. That’s not going to work as easily as you think. They should operate on whatever layer catches the commands.

  • M.

2009/3/17 col_klink <messages@forums.vassalengine.org (messages@forums.vassalengine.org)>

Post generated using Mail2Forum (mail2forum.com)

I am unable to fix it now (work), but will be able to later on tonight, if not done by then already

thank you Tim

What do you want it to do? It looks like you are expecting CTRL-D to serve two purposes: to fire AND to switch off.

  • M.

2009/3/17 col_klink <messages@forums.vassalengine.org (messages@forums.vassalengine.org)>

Post generated using Mail2Forum (mail2forum.com)

No.

CTRL-D switch on the layer ‘def’ (defensive fire)

This CTRL-D activate a trigger (condition : def_active=true ) and send the command CTRL-SHIFT-M (decrease arrows)

If i send again CTRL-D : the layer ‘def’ switch off.

This is the same with CTRL-O : it switch on the layer ‘off" (offensive fire’) and activate a trigger (like off_active=true) who send CTRL-SHIFT-M to decrease the arrow…

I have fixed the module - you can grab the revised version here:
mediafire.com/vassalpro
it is the file called CryHavocRevised.zip

Take a look at the 2 protos you mentioned to see how it works. This is a case where you dont want to use triggers but a DP instead, also notice the trait order and that I use fewer key commands by combining the sound keys with the DP keys - this is permissible

Reason I mention trait order - looking at other protos your stacks appear backwards in places. This is fine for report traits and triggers in general but could cause you trouble further down the more complex a module you build.

see this thread :
vassalengine.org/forums/viewtopic.php?t=178
It can not be stressed enough that order is very important, so reexamine and make sure you are following these guidelines and this includes the embedding of your prototypes within other prototypes.

Any questions or cant follow whats been done just ask

thank you very much.
I do not have all inclusive but I’m working!