• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Multiple Cost Stats

Greetings!

I'm working on a game system and need a little help. Is there a way to have 2 cost profiles? The game has a cost and a battle rating that needs to be calculated. Is this possible? Any help would be appreciated!
 
Costs can be calculated but can you add more information on what it is you are trying to achieve and how the game function works - people will be able to give you more ideas that way round
 
Good call. i didn't think about that. The game is Battlegroup Fall of the Reich. Armies are built with two things in mind, point cost and battle rating. Each unit has a battle rating that needs to be calculated (i.e. A Armoured Infantry Platoon has a point cost of 136 and has a Battle rating of 15). What I'm trying to do is to total the BR when the army is pointed out and display it on the roster.

Hope that explains it a little bit better.
 
Yup does help - is the armoured platoon a pre-selected unit, i.e. you choose it and all the units under the platoon come with it or do you select the units that fit into it?

You can have a calculated stat that displays the battle rating and then link this to the statset the platoon uses - as an example have a look at the Black Powder files - when you build a regiment it creates a breakpoint (which is roughly 50% of the units ignoring certain artillery or skirmishers etc)

What is the link or calculation between the cost and battle rating or vice versa?

You can either use a calculated stat or a global script in entity done, quite a few different options can be done
 
The Armoured Platoon is a preselected unit and it can have up to 4 platoon support options. Some of these options have their own battle rating as well.

The game doesn't really have a breakpoint like Black Powder. There are points limits for the type of game. The battle rating isn't really a percentage of the point value tho. There are also unique and restricted units. I haven't gotten into figuring that out yet.

How would such a script be written? My coding skills suck at the moment. Lol

Here's a picture of the Armoured Platoon page. Hopefully that helps a bit.

armoured-Plt.png
 
Last edited:
Ah gotcha - can I just check if I am reading this right:

1. Choose the armoured platoon, starts with a base rating of 15
2. choose options allowed, each option adds to the battle rating, i.e. HMG team adds +1 battle rating?

If that's the case then add a stat to each unit for the battle rating but only display it on the platoon, when you add a unit to the platoon then use script in the Postlink section so that it takes the units battle rating and adds it to the parent (the platoon), roughly something like this:

var batRating as number
batRating = stat[batRating]

parent.stat[batRating] = parent.stat[batRating] + batRating

That's using the assumption though that each unit selected increases the platoon battle rating
 
Your assumptions are correct. Each unit you choose be it a tank, forward hq, logistics or engineering has a battle rating.

With the given code, that would total the overall battle rating I'm assuming.

I've attached a roster so you can see what I mean.
 

Attachments

Yes. I'm just having issues getting the platoon support options to the parent. I've also tried using a script in statcalc to add the battle rating:

var BR as number
BR = stat[BR]

@value = this.tagvalue[BR.?]

All that I get with that script is the platoon BR on the roster.

I've also tried several different variations of the Postlink script as well.
 
Last edited:
Okay, I'm getting close, but I'm still having issues with getting the Battle Rating (BR) to add up. Here's what I'm using as a stat calc script:

Stat Id is stBR
Stat Name is BR

Test Expression is BR.?

Tally script is:
var BR as number
BR = cost[unit]

@value = this.tagvalue[BR.?] + BR

Like this it reads the units BR and it shows it on the Roster like I want. Sadly when you add a different unit it replaces the first units BR and doesn't add them together.

Any suggestions would be much appreciated!
 
If you want drop me a pm and I'll send you my email so can have a look - it's always easier to look at the code direct

Using a statcalc will caculate roster based stats so won't be helpful for individual units display but is it the entire roster you want to display the BR rating for? If so change the statcalc so it has:

@value = @value + this.tagvalue[BR.?]

Try it unit level
 
It's the entire roster I'm trying to get calculated. I'll give this a try and report back! Thanks for the help!

Works like a champ! Adds up the battle rating perfectly! Thanks for everything!
 
Last edited:
Back
Top