Senior Member
Volunteer Data File Author
Join Date: May 2005
Location: Santa Cruz, CA, US
Posts: 123
|
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 |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
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:
|
|
#2 |
Senior Member
Volunteer Data File Author
Join Date: Mar 2005
Posts: 345
|
instead of using a private stat for the transport capacity is there any issues with using a tag instead, i.e. capacity12??
|
#3 |
Senior Member
Volunteer Data File Author
Join Date: May 2005
Location: Santa Cruz, CA, US
Posts: 123
|
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 |
#4 |
Senior Member
Volunteer Data File Author
Join Date: Mar 2005
Posts: 345
|
yeah, thats a good point - I may have to 'borrow' the code for the Chosen in the future
|
#5 |
|
|