Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Army Builder Forums > Army Builder
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
ace at madbomber.net
Guest
 
Posts: n/a

Old September 20th, 2001, 07:06 AM
OK--another brain buster for you all to contemplate, and Rob to propose a
solution for.

Topic: Inquisitor data file, applying cost to armour points.

When I tried to calculate cost for the statistics of a character, Rob filled
me in on how to do this:

- create an option, "BaseCost". The option "BaseCost" is assigned an
"auto" relationship to a character. The option BaseCost has the following
attributes:

xlat:from=WS-to=X1-map:0-9=0,10-19=1,20-29=2,30-39=3,40-49=4,50-59=5,60-69=7
,70-79=9,80-89=11,90-99=13,100-109=15,110-119=17,120-129=19,130-139=21,140-1
49=23,150-159=25,160-169=27,170-179=29,180-189=31,190-199=33,200-209=35,210-
219=37,220-229=39,230-239=41,240-249=43,250-259=45,260-269=47,270-279=49,280
-289=51,290-299=53,300-309=55,310-319=57,320-329=59,330-339=61,340-349=63,35
0-359=65,360-369=67,370-379=69,380-389=71,390-399=73,400-409=75,410-419=77,4
20-429=79,430-439=81,440-449=83,450-459=85,460-469=87,470-479=89,480-489=91,
490-499=93

where "WS" is weapon skill, a character's stat, and "X1" is a stat that
translates the value in WS into a corresponding point cost in X1.

and then

base:X2+(X1) (where x2 is an "accumulation stat"). In this model, X2 starts
as 0 and is incremented to include the cost calculated in x1, using the xlat
formula above.

There is a series of
xlat: ...
followed by
base:X2+(X1) commands.

Each time the "base" command is represented, it takes the NEW value in X1
(calculated from the previous calculation of points on the next stat in
line), and increments it onto X2, representing the TOTAL cost for the all
stats the character has.

At the end of all of this, there are 2 more attributes:

cost:stat@X2*1, which makes the cost of the option equal to the the value in
the statistic X2, times 1.

and,

"hide"
which hides the option from the user.

Now--this works PERFECTLY to calculate the base cost of a character,
dependent on his statistic set.

The problem comes in when I try to replicate this situation/model for the
armour cost. A little background: armour is a unit, and is automatically
added to EVERY character through the use of a child unit option. So my
theory is that I should be able to create 2 new stats, X3 and X4, and create
a new option, "ArmCost", and attach ArmCost to the Armour unit as an auto
option, and it will increment the cost of the armour based on the # of
armour points selected for that armour child unit. Here's what I did:

xlat:from=Hd-to=X3-map:1-1=1,2-2=2,3-3=3,4-4=4,5-5=5,6-5=6,7-7=7,8-8=8,9-9=9
,10-10=10...etc

This takes the "Hd" stat, which is the # of armour points at the head
location, and maps it into the X3 stat. Then...

base:X4+(X3)

This should take the current value in X3 and add it to the value in X4
(which starts at 0).

Do this for each of the armour "stats" (Hd, RA, LA, Ch, Ab, RL, LL, Gr, AL),
following each "xlat" attribute with the "base" attribute. At the end of
the last "base" statement,

cost:stat@X4*1

To take the total incremented value in X4 and multiply it by 1, generating
the cost of the option (which is auto-attached to teh character)
and finally "hide" to hide it again (like above).

Now--theoretically, this should increment X3 by 1 point for every point of
armour at a location, and then take that total value and add it to X4,
incrementing x4 each time to get a total points value of the armour.

Maybe I'm making this too complex, but it seems like it should work...so
what's wrong, you ask?

When I actually get into the armour child unit, and add a location (like
head), and then increment the armour points at that location, for some
reason it's multiplying the # of armour points selected at the location by
some value (2, 3 and 6 seem to be common values) before calculating the
cost. I'm not sure what it is I'm doing wrong...

For a real-live example:

Open inquisitor file
- add an "Inquisitor"
- click on "armour"
- click on the "special items" button
- add "abdomen armour" and "groin" armour", and "right arm armour"
- exit special items screen
- under the "armour" child unit, click on "abdomen armour"
- select "Flak Armour"; two things will happen--1) the "Ab" stat on the
armour child unit will increment from - to 3. The total cost of the armour
will go from 0 to 15. It should only go to 3, however, because each point
of armour is equivalent to 1 point of cost, and I've only added 3 points of
armour.
- under the armour child unit, click on "Groin armour".
- select "Flak Armour" again. The "Gr" stat will increment from - to 3, but
the cost of the unit will not increase. Now, it SHOULDN'T, b/c it's already
9 points over cost (3+3 is 6, 15-6 is 9), but that's odd...
- under the armour child unit, click on "Right Arm Armour"
- select "Flak Armour" again. The "RA" stat will increment from - to 3.
The cost of the unit goes from 15 to 24. Huh? It should be 9 TOTAL, but it
appears to multiply the # of armour points at the location by some value
before applying the cost.

As near as I can tell, here is what it is doing:
- if the "x armour" location is the first stat on the armour option (i.e.
"Hd"), it multiplies it by 1. If it's the 2nd stat (LA?) it multiplies it
by 2. RA by 3. Ch by 4. Etc. The position in the stat line dictates a
multiplier for the cost of the unit. At least I think that's what it's
doing.

What am I doing wrong? I just want it to increment the cost of the "Armour"
Child unit by 1 point for every 1 point of armour at any of the "armour"
stats/locations (there are 9 of them total).

Help!

  #1 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old September 20th, 2001, 03:15 PM
*IF* I'm understanding all this correctly, it looks like you are suffering
from what I call "Shiny Hammer Syndrome". You've got a useful tool (i.e.
solution) for one situation and you're trying to crowbar it into place for
a different situation. That doesn't always work. :-) And it clearly fails
in this situation.

First of all, you don't need to use "xlat" if there is a one-to-one
mapping. I recommend you have the Flak Armor for the Head simply use
"base:Hd+3" and "base:X4+3". There is really no need to have the "X3" stat.

Secondly, the behavior and handling of items is NOT exactly the same as for
options. Evaluation of items is processed BEFORE any options. And the use
of stat adjustments with items has some subtly different behaviors. This is
of critical importantane when using stats to base costs upon. And this is
where you're getting messed up. Each item is accumulating into the same
stat, without resetting things, so you're getting the CUMULATIVE total of
the items you've processed. This is NOT what you want, and it is the result
of using items with the assumption that they behave like options. They
don't. :-) This is being further compounded by the use of options and items
in conjunction with one another. To quote an old classic.... "Danger, Will
Robinson! Danger! Danger!"

Third, if I'm creating my character, I want to see how many points are
spent on armor in each location. This is especially important since there
isn't enough space to show the costs for all the armor locations in the
stat set. Fortunately, since the cost is a one-to-one mapping, this is
easy. So you should be specifying the adjustment as the cost of the tweak
instead of accumulating the cost into a stat.

As you feared, you've definitely made things more complex than necessary
and things are getting totalled up multiple times. First, eliminate the use
of the X3 and X4 stats, since I don't believe they are necessary. Each
tweak should increment the appropriate armor location properly via a "zbas"
attribute. Each tweak should also increment the cost correctly by simply
having the tweak cost "X" points. This will adjust the cost of the ITEM,
which is then visible to the user AND properly accumulated into the Armor
unit for a convenient total cost of armor.

That should be all you need. A *LOT* easier than the method you've attempted.

Please note that this is based on my understanding of your post. It quite
possible I'm misinterpreting something, in which case my suggestion won't
work. But give it some thought and see if a simpler approach like my
suggestion will yield that same results you're striving for. :-)

Hope this helps,
Rob


At 11:02 AM 9/20/2001 -0400, you wrote:
>The problem comes in when I try to replicate this situation/model for the
>armour cost. A little background: armour is a unit, and is automatically
>added to EVERY character through the use of a child unit option. So my
>theory is that I should be able to create 2 new stats, X3 and X4, and create
>a new option, "ArmCost", and attach ArmCost to the Armour unit as an auto
>option, and it will increment the cost of the armour based on the # of
>armour points selected for that armour child unit. Here's what I did:
>
>xlat:from=Hd-to=X3-map:1-1=1,2-2=2,3-3=3,4-4=4,5-5=5,6-5=6,7-7=7,8-8=8,9-9=9
>,10-10=10...etc
>
>This takes the "Hd" stat, which is the # of armour points at the head
>location, and maps it into the X3 stat. Then...
>
>base:X4+(X3)
>
>This should take the current value in X3 and add it to the value in X4
>(which starts at 0).
>
>Do this for each of the armour "stats" (Hd, RA, LA, Ch, Ab, RL, LL, Gr, AL),
>following each "xlat" attribute with the "base" attribute. At the end of
>the last "base" statement,
>
>cost:stat@X4*1
>
>To take the total incremented value in X4 and multiply it by 1, generating
>the cost of the option (which is auto-attached to teh character)
>and finally "hide" to hide it again (like above).
>
>Now--theoretically, this should increment X3 by 1 point for every point of
>armour at a location, and then take that total value and add it to X4,
>incrementing x4 each time to get a total points value of the armour.
>
>Maybe I'm making this too complex, but it seems like it should work...so
>what's wrong, you ask?
>
>When I actually get into the armour child unit, and add a location (like
>head), and then increment the armour points at that location, for some
>reason it's multiplying the # of armour points selected at the location by
>some value (2, 3 and 6 seem to be common values) before calculating the
>cost. I'm not sure what it is I'm doing wrong...
>
>For a real-live example:
>
>Open inquisitor file
>- add an "Inquisitor"
>- click on "armour"
>- click on the "special items" button
>- add "abdomen armour" and "groin" armour", and "right arm armour"
>- exit special items screen
>- under the "armour" child unit, click on "abdomen armour"
>- select "Flak Armour"; two things will happen--1) the "Ab" stat on the
>armour child unit will increment from - to 3. The total cost of the armour
>will go from 0 to 15. It should only go to 3, however, because each point
>of armour is equivalent to 1 point of cost, and I've only added 3 points of
>armour.
>- under the armour child unit, click on "Groin armour".
>- select "Flak Armour" again. The "Gr" stat will increment from - to 3, but
>the cost of the unit will not increase. Now, it SHOULDN'T, b/c it's already
>9 points over cost (3+3 is 6, 15-6 is 9), but that's odd...
>- under the armour child unit, click on "Right Arm Armour"
>- select "Flak Armour" again. The "RA" stat will increment from - to 3.
>The cost of the unit goes from 15 to 24. Huh? It should be 9 TOTAL, but it
>appears to multiply the # of armour points at the location by some value
>before applying the cost.
>
>As near as I can tell, here is what it is doing:
>- if the "x armour" location is the first stat on the armour option (i.e.
>"Hd"), it multiplies it by 1. If it's the 2nd stat (LA?) it multiplies it
>by 2. RA by 3. Ch by 4. Etc. The position in the stat line dictates a
>multiplier for the cost of the unit. At least I think that's what it's
>doing.
>
>What am I doing wrong? I just want it to increment the cost of the "Armour"
>Child unit by 1 point for every 1 point of armour at any of the "armour"
>stats/locations (there are 9 of them total).
>
>Help!


---------------------------------------------------------------------------
Rob Bowes (rob@wolflair.com) (650) 726-9689
Lone Wolf Development www.wolflair.com
rob is offline   #2 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting available units based on a ruleset Russell Army Builder 3 April 18th, 2006 03:40 AM
More fun with AB3 child units. Warmonger Army Builder 3 February 9th, 2005 01:55 PM
cost of unit based on a stat? adam at realnice.com Army Builder 3 May 12th, 2003 07:25 PM
Applying cost based on statistics, child units--new question ace at madbomber.net Army Builder 1 September 21st, 2001 02:10 PM


All times are GMT -8. The time now is 06:07 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.