Shoot at tank and where it hits.

Hi,

I’m writing a tank combat game with some people on a forum.

I’ve seen, in some programs, where someone made a script that allows you to roll dice to see if you hit, and then roll again to see if you cause damage.

I wanted to learn how to do something like that, but rather roll to see if you hit and then roll to see where the shot landed.

Then, have three buttons (one for each outcome) that will determine what happened with each shot.

The version I saw was a java code, but the creator of the version I saw didn’t remember it at all, so I’m thinking someone else may have done it.

Is there anyone on here that might be able to help me out with this?

Seems like that would be pretty simple to do that in Vassal without any Java coding.

Just a matter of setting up the buttons and the random generators.

I think I got a glimpse of your other message as well where you said you didn’t know Java. Building games with Vassal does not require any Java programming knowledge. …or really any programming knowledge at all. Although, having a grasp of programming logic does help when you start setting up sophisticated triggers within Vassal.

I don’t have the time at the moment but I might be able to put a sample mod together this weekend that does exactly what you’re describing.

Thanks. I was mainly looking through the files and saw a bunch of java class files in it, and I can’t find how to edit the dice-rolling thingies that he had. However, I did see where they seemed to be taking data and scripts from the java files.

But yeah, if you could help me out, I’d greatly appreciate it. The game itself is actually pretty simple.

As a sample mod, I’ll need some perimeters.

What die is rolled when a shot is made and what rolls do what? Keep in mind that the die can have any number of faces you like. If you want it to have 57 faces, that’s not a problem.

What would be the result of each of these buttons? Alternately, the final result can be done automatically when the shot is made rather than have to click more buttons unless you have a specific reason for needing these buttons.

Ok

The first button is the “To Hit” button.
Player inputs their ballistic skill which determines if the shots hit and where they hit.
Player needs to input number of shots
Player needs to input Ballistic Skill
BS 1 - 6 to hit
BS 2 - 5+ to hit
BS 3 - 4+ to hit
BS 4 - 3+ to hit
BS 5 and higher - 2+ to hit
Player needs to input whether or not the gun has a “Gets Hot” rule. If so, then on a 1 that shot is resolved against the tank that is firing as the weapon overheats
Player needs to input whether he is firing through terrain. If yes, then each successful hit rolls another die. On a 4+ the shot hits terrain instead
Player needs to input whether he is firing at a tank with a Force Field. If yes then each successful hit rolls another die, on a 5+ the shot misses.
Player cannot check terrain and force field at the same time.

If the shot hits the tank, a die is rolled for each successful hit to determine the location
1 - Krew
2 - Hull
3 - Hull
4 - Hull
5 - Hull
6 - Engine

That’s the first button (sorry if that’s a lot)

The first outcome button is for the Krew.
Then a d3 is rolled to see which krew member is hit.
1 - Gunna
2 - Driva
3 - Kommanda

Then roll a d6, the krew member is wounded.

The second outcome button is for the Hull
The player inputs the strength of the weapon fired, and the armor of the side of the tank that took the hit.
Player needs an option to input whether the gun is AP 1. If it is, then any glancing hit is a penetrating hit instead.
Player needs an option to input whether the target has a “Lucky Bloo Paint Job”. If yes, then each successful damaging hit is ignored on a d6 roll of 6
Player needs an option to input whether the target is open-topped. If yes, then ad +1 to the die result on the damage table
A d6 is rolled and added to the strength of the weapon fired. If the result is equal to the armor’s value a glancing hit is scored. If the result is greater than the armor’s value, a penetrating hit is scored.

If the hit causes damage and is not saved by the Lucky Bloo Paint Job, then damage is rolled. Glancing hits subtract 2 from the die roll

1 or less - Krew Shaken
2 - Krew Stunned
3 - Weapon Destroyed
4 - Immobilized
5 - Tank Wrecked
6 - Tank Explodes
If the vehicle explodes, a d6 is rolled for each krew member. on a 3+ they take a wound (But it has to say “Driva is wounded” or "Gunna is wounded. They may already be dead which means their body is simply more mangled)

The third outcome die roll is engine damage.
The player inputs the strength of the weapon fired, and the armor of the side of the tank that took the hit.
Player needs an option to input whether the gun is AP 1. If it is, then any glancing hit is a penetrating hit instead.
Player needs an option to input whether the target has “Extra 'Eavy Armor”. If yes, then all damage on the engine is glancing damage
Player needs an option to input whether the target is open-topped. If yes, then ad +1 to the die result on the damage table
A d6 is rolled and added to the strength of the weapon fired. If the result is equal to the armor’s value a glancing hit is scored. If the result is greater than the armor’s value, a penetrating hit is scored.

If the hit causes damage then damage is rolled. Glancing hits subtract 2 from the die roll.

1 - No damage
2 - No damage
3 - Sputter and Spurt
4 - Engine Stalls
5 - Engine Falls Apart
6 - Engine Explodes

I really appreciate this, and I hope it’s not too much trouble.

If you have any further questions or information that you need, please don’t hesitate to ask.

On a side note, is it possible for some of the layers of graphics to be animated? The game calls for four hull upgrades that would look great if they either sparkled or crackled with energy. Is that even possible, or is it just flat graphics files only?