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
HakujinGrande
Senior Member
Volunteer Data File Author
 
Join Date: May 2005
Location: Santa Cruz, CA, US
Posts: 123

Old February 8th, 2006, 09:55 PM
I've tried several things, but I just cannot seem to figure these out.

If I understand the documents I should be able to create an accumulated unit stat that has the total value accumulated at the squad level.

I created a unit stat that has the calculate script:
@value = unit.count[model]

And set the stat to be accumulated.

However, the only debug that ever shows a value for this stat is the "Show All Unit Stats for Unit...". It never shows a value under the Accumulated stats for the squad.


Basically what I need are two stats that count the number of models in units in a squad. One value for all models, except for transports (which are tagged with smTags.Transport) and another count of models within units that have Terminator armour (tagged with smTags.Terminator).

I need these two values so that I can use them in validation rules for transports, to see if the transport can accomodate the squad.

How are these supposed to work?

Space Marine Maintainer for AB3
Battlefleet Gothic Maintainer for AB3
40K: Space Wolves, 13th Company, Grey Knights, Deathwatch
BFG: Space Marine Fleet, Armageddon Fleet, Tau Fleet
HakujinGrande is offline   #1 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old February 11th, 2006, 04:22 PM
Well, according to the docs, you are doing things correctly. However, after looking at the code, this is a special-case situation that is not being covered in the docs.

The problem is the evaluation sequence. In order to allow access to accumulated stats for leaders within the Calculate script, the Calculate scripts must be processed AFTER the accumulation is performed. Consequently, the calculated stat value is being generated after a value of zero has already been accumulated.

The solution is to calculate the stat value prior to the accumulation. That means just about any other location should work fine. For example, you could do it in the global EntityDone script, or in the PostLinks script for the approriate units, or in an option with a "last" priority that gets linked to all units via a global linkset. All of these techniques should work.

Sorry for the confusion on this. I never realized this specific situation was an exception to the normal logic, so I didn't think to document it. I'll get this caveat added to the docs.

-Rob

At 10:55 PM 2/8/2006, you wrote:

Quote:
I've tried several things, but I just cannot seem to figure these out.

If I understand the documents I should be able to create an accumulated unit stat that has the total value accumulated at the squad level.

I created a unit stat that has the calculate script:
@value = unit.count[model]

And set the stat to be accumulated.

However, the only debug that ever shows a value for this stat is the "Show All Unit Stats for Unit...". It never shows a value under the Accumulated stats for the squad.


Basically what I need are two stats that count the number of models in units in a squad. One value for all models, except for transports (which are tagged with smTags.Transport) and another count of models within units that have Terminator armour (tagged with smTags.Terminator).

I need these two values so that I can use them in validation rules for transports, to see if the transport can accomodate the squad.

How are these supposed to work?
rob is offline   #2 Reply With Quote
harkan
Senior Member
Volunteer Data File Author
 
Join Date: Mar 2005
Posts: 345

Old February 13th, 2006, 06:22 AM
instead of using a private stat for the transport capacity is there any issues with using a tag instead, i.e. capacity12??
harkan is offline   #3 Reply With Quote
HakujinGrande
Senior Member
Volunteer Data File Author
 
Join Date: May 2005
Location: Santa Cruz, CA, US
Posts: 123

Old February 13th, 2006, 10:50 AM
The stat isn't for the transport. It's for the units. If the stats are accumulated, then each unit is responisible for tracking it's own count, instead of the way it is now. The code that handles the Wolf Guard Bodyguard is very confusing right now.

I have to keep track of both power and terminator armour on the Land Raider. Also the potential mixed armour situation with Space Wolf Leaders + Wolf Guard Bodyguard.

Space Marine Maintainer for AB3
Battlefleet Gothic Maintainer for AB3
40K: Space Wolves, 13th Company, Grey Knights, Deathwatch
BFG: Space Marine Fleet, Armageddon Fleet, Tau Fleet
HakujinGrande is offline   #4 Reply With Quote
harkan
Senior Member
Volunteer Data File Author
 
Join Date: Mar 2005
Posts: 345

Old February 14th, 2006, 11:38 AM
yeah, thats a good point - I may have to 'borrow' the code for the Chosen in the future
harkan is offline   #5 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


All times are GMT -8. The time now is 07:35 PM.


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