Fun with Negative Numbers

Good morning, VASSAL community.

For some time now I’ve been working on a mod of Armada PNP, a pencil-and-paper reproduction of Wing Commander: Armada that I put together a few years ago (full rules here). The hope behind putting a mod together was to see if I could actually get folks to play the game and to playtest the ruleset I wrote (to my knowledge, the game has never actually been played).

Okay, so as part of the rules, all counters have three main combat statistics: Strength, Maneuver and Hits. The Strength of all of a player’s pieces in combat are added up and compared to those of their opponent, which in turn determines which column of the Combat Results Table is used when the dice are rolled. Maneuver modifies the outcome of the die roll; again the total maneuver is added up for a side and compared with that of the opponent. Hits determines how many times an individual piece can sustain damage before it’s destroyed. So, it’s a fairly common light wargame combat model at work.

So when it came time to do the mod, I came up with the brilliant idea to handle Strength and Maneuver as markers, and Hits with layers. The idea was to add Strength and Maneuver to a counter (using Global Properties) as they entered the Battle Board (with GKCs and Trigger Action properties), then display the ratio between the Strengths and the difference in the Maneuvers. I finally got to the point last night where things were mostly behaving as they should, except I’ve come up with a problem with Maneuver ratings.

So here’s my problem: Some of my craft have negative maneuver ratings. When it comes time to remove these craft from the Battle Board, VASSAL throws me a Bad Data error message telling me that the Maneuver rating is non-numeric.

Any idea what might be causing this? Bear in mind this only happens with pieces with negative Maneuver ratings; those with positive ratings behave as they should.

Still seeing three possible snags with the design as it is:

  1. The removal from the Battle Board routine I have instated assumes pieces leaving it are discarded; it doesn’t account for pieces going back to the map,
  2. If I move a piece to another spot on the battle board, its ratings get counted more than once, and
  3. When it comes time to calculate the Strength ratio, what will happen if one player hasn’t put any pieces on the battle board yet (i.e. the game things their strength is zero); trying to avoid a division by zero error here.

Any help anyone can offer would be most appreciated.

The specific error message I get is:
-Bad Data in Module: Numeric field contains a non-number Increment Confederation Group Maneuver: format=-$Maneuver$, value=-Maneuver

That error message means that Vassal is regarding $Maneuver$ as equaling Maneuver instead of a value for the variable Maneuver. This will occur if the value is not valid.

The first thing I would look at If this only occurs with negative numbers is the number ranges you have set up. I would check the ranges in the Global Properties to make sure the minimums are set low enough to take those values. I’d also check any Set Global Property traits to insure they’re all set as numeric and the value range matches the Global Property.

Okay…the Global Properties involved are “Confederation Group Maneuver” and “Kilrathi Group Maneuver”.
Both are numeric, a minimum value of -999 and a maximum of 999.

Set Global Property traits…
Okay, well I have a pair for the Maneuver calculator and display pieces on the Battle Board.
Both numeric, both minimum -999 and maximum 999.
The others are in the “Confederation” and “Kilrathi” prototypes - only difference between the two is a different Mask image.
…both numeric, both minimum -999 and maximum 999.

I am still interested in trying to find a solution for what’s going on. Meantime, I have pulled the Set Global Property traits for adjusting Maneuver strength into a new set of four Prototypes, one for Confederation ships with positive Maneuver ratings, one for Kilrathi ships with positive maneuver ratings, and the other two for the corresponding ships with negative ratings. Simply add the corresponding Prototype to each craft and remove the minus sign from in front of the values of those ships that have them. It seems to have done the trick, but my inner programmer is screaming at me right now…

Could VASSAL have been interpreting the whole thing as a non-numeric value because of the presence of the minus sign? That’s the only thing I’m coming up with.

Remove the minus sign

-----Original Message-----
From: messages [mailto:messages-bounces@vassalengine.org] On Behalf Of
capi3101
Sent: Tuesday, September 03, 2013 10:51 PM
To: messages@vassalengine.org
Subject: Re: [messages] [Module Design] Fun with Negative Numbers

Okay…the Global Properties involved are “Confederation Group Maneuver”
and “Kilrathi Group Maneuver”.
Both are numeric, a minimum value of -999 and a maximum of 999.

Set Global Property traits…
Okay, well I have a pair for the Maneuver calculator and display pieces on
the Battle Board.
Both numeric, both minimum -999 and maximum 999.
The others are in the “Confederation” and “Kilrathi” prototypes - only
difference between the two is a different Mask image.
…both numeric, both minimum -999 and maximum 999.

I am still interested in trying to find a solution for what’s going on.
Meantime, I have pulled the Set Global Property traits for adjusting
Maneuver strength into a new set of four Prototypes, one for Confederation
ships with positive Maneuver ratings, one for Kilrathi ships with positive
maneuver ratings, and the other two for the corresponding ships with
negative ratings. Simply add the corresponding Prototype to each craft and
remove the minus sign from in front of the values of those ships that have
them. It seems to have done the trick, but my inner programmer is screaming
at me right now…

Could VASSAL have been interpreting the whole thing as a non-numeric value
because of the presence of the minus sign? That’s the only thing I’m coming
up with.


Read this topic online here:
https://forum.vassalengine.org/t/fun-with-negative-numbers/6255/4

@TIm M: That’s what I did, as per my last post: