[messages] [Module Design] Disable a single piece
chrono280 at gmail.com
Wed Apr 25 20:23:40 MST 2012
So I think the Unlock at Value >5 can work with a Global Key Command,
the best way to do it would be to connect the Global Key Command to
whatever it is that increases/decreases your Value.
So let's say your Value is a Global Property.
Let's say we have a piece that has the Set Global Property trait. Some
key combo increments by 1, Some Other key combo decrements it by 1. But
leave the Menu Command section for these function blank in the Set
Global Prop window (this keeps them from showing up for the player).
We're gonna have the Increment/Decrement handled by a Trigger instead.
Next, though, let's set up a Global Key Command, call it Unlock, if you
want. Don't set a Menu Command name for it, so players can't access it
accidentally. Set a key command for it, this is what key needs to be
"pressed" to activate it. Then Set a global key, this is the key that
will be pressed on ANOTHER piece. To target a piece, use the Properties
Matching section. Have it only press the key on BasicName =
WhateverTheLockedPieceIsCalled && (this is saying AND) TheGlobalProperty
> 5. This means the Global Key Command to unlock will only be executed
ON a specific piece by "BasicName" which is the piece's name AND if the
Global Prop we set up is > 5.
Set up a Trigger, call it Increment Trigger if you want. This Trigger
will execute 2 key commands on the piece. First it will do Whatever the
Increment key combo you set in the Set Global Property Trait, then it
will do the Global Key Command.
So if you're INCREASING the global property for this is what happens:
Player activates the Increment Trigger -> Global Prop is increased by 1
-> Unlock Global Key COmmand is executed on the locked piece IF the
GLobal Prop is now > 5.
To do the reverse, just set up a Decrement Trigger that decreases the
Global Prop then executes a second Global Key Command that checks if the
Value is <=5 and executes a Lock on the piece.
Any clearer? I'm not great at explaining Vassal. Hopefully this will
allow you to have the game track the value to lock/unlock the piece.
Read this topic online here:
More information about the messages