Jump to content

Mathhammer help. (using Excel.)


ildrin

Recommended Posts

Good Evening.

My A2 ICT project forces me to find a real person, with a real problem that can be solved using ICT, and solve it for them.

My project is a system capable of creating army lists, from data stored within, to prevent having to re-enter it each time, which is easy in Microsoft Access.

The more difficult aspect is a fully functional Mathhammer system, i was wondering if anyone could help me with this, as I've spent about 3 hours trying to do so, but haven't been able to yet.

Thanks for any help.

 

Love Willski.

 

(Apologies if this is the wrong category/section. please inform me or correct this if it is. thank you.)

Link to comment
https://bolterandchainsword.com/topic/212669-mathhammer-help-using-excel/
Share on other sites

Are you talking about rating the effectiveness of a unit and its equipment?

 

Like if a unit has BS4 and a weapon of STR4 and 5 shots, and you provide a toughness... say 4... it says ~1.67 wounds?

 

I'm not really a mathhammer expert here... but BS4 means you hit 4/6 of the time and S4/T4 means you wound 1/2 of the time... so 5 * 4/6 * 1/2 = 1.67ish... so it seems like it should be easy to do those kinds of calculations. They'd just have to provide a toughness (and potentially WS) to compare against.

Pretty simple I think, you would need several variables, for shooting:

A: Ballistic Skill

B: S of weapon

C: Toughness of opponent

D: Armor Piercing

E: Enemies Armor save

F: Enemies Invulnerable save

G: Number of attacks

Simply input the tables that have the dice rolls needed to wound and hit with shooting attacks into the program with fractions or decimals instead of 2+, 3+, 4+, 5+, 6+. The application user inserts the variables through a text box and the program does the match ups. Im not sure about the technical terms you are using but I know I could probably do this in C#. Just make sure to use an "if...then" type thing for AP, armor save and invulnerable saves so it doesn't try and give the enemy model an invulnerable save after the armor save is taken.

For close combat:

A: WS

B: Enemy WS

C: S

D: Enemy T

E: Whether or not it can bypass armor save, Im not sure about how the program works so you might need the person to input it

F: Sv

G: Inv Sv

H: Number of attacks

Well not quite what you are going for I think but this is my fairly basic take on it.

Was for when I was going through the Storm Ravens weapon options.

Colour code is hotter is better ;p My brain works better with colours it seems ;)

gallery_47726_5343_12648.png

I can't remember how to show all formula but if I do I'll change the pic to show.

That evolved from this 1from ages ago. Every weapon in the marine and chaos codex.

gallery_47726_5343_12702.png

lol Yeah I know. Don't even ask how bored I was :huh:

Bottom line is you're gonna need a lot of IF functions. For instance, the rules for rolling to-hit are actually mathematically different depending on whether your BS is less than 6. They also vary depending on the difference between Str and Toughness (hint, the normal rule only applies when (S-T)+3 is between 1 and 5). Now, luckily, the IF function is pretty easy to do in excel. UNluckily, it's not so easy to write out here.

 

BS<6, -2<(S-T)<3, model has a saving throw

 

P=Shots*(BS/6)*(((S-T)+3)/6)*IF(AP>Sv, ((Sv-1)/6), else ((Inv-1)/6))

 

Conditionals:

BS >/= 6: ((25+BS)/36)

(S-T)= -2: 1/6

(S-T)< -2: 0

(S-T)>/= 3: 5/6

Sv= nothing: 1 (this works itself out if "no save" is written "7+")

 

 

I think that takes care of shooting. Let me know if I messed something up. I'll work on CC and let you know when I've got a good model.

 

 

P.S. In my version of Excel (granted, I'm on a Mac, so it's Numbers), that would look like so(substituting cel coordinates for the variables, of course):

 

=Shots*IF(BS<6, (BS/6), ((25+BS)/36))*IF((S-T)<-2, 0, IF((S-T)=-2, (1/6), IF((S-T)>2, (5/6), (((S-T)+3)/6))))*IF(AP>Sv, ((Sv-1)/6), ((Inv-1)/6))

 

... I think. Haven't tried it, but barring the accidentally missed parenthesis, that should work... in Numbers. Excel is slightly different, but this should be a good start at least.

 

Edit: Sorry for the second edit, but I confirmed that this works in Numbers. Thus, the parentheses and equations work, and all you'll need to do is alter the syntax for Excel.

 

 

Okay, CC works the same way. Give all power weapons an AP less than 3, and all regular weapons an AP of 7 (or find a more elegant way of doing the same thing). The only difference is that the to-hit calculation looks like this, where WS' is the opponent's WS:

 

IF((WS-WS')>0, (2/3), IF((2WS-WS')<0, (1/3), (1/2)))

 

i.e. If your WS is better than his, you hit 2/3 of the time; if his is more than twice yours, you hit 1/3 of the time; and in all other cases, you hit 1/2 the time.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.