diff --git a/README.md b/README.md index e72eb0d..aecf6f6 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ Easily and automatically create **Victory at Sea** ship cards for your 3D-printed or custom ships! This project mimics the style, size, and information layout of the official cards provided by **Warlord Games** while allowing you to customize ships you’ve printed yourself. -![Project Demo Screenshot](./output_images/New_Mexico.png) - +![Project Demo Screenshot](./output_images/New_Mexico_Class_Battleship.png) --- ## Features @@ -68,19 +67,18 @@ project_root/ Defines the basic information about each ship. - -| Field | Description | Example | -|----------------|----------------------------------------------------|---------------------------| -| `ship_id` | Unique ID for the ship | `1` | -| `ship_name` | Name of the ship | `New Mexico` | -| `ship_type` | Type of the ship | `Battleship` | -| `points` | Point cost | `395` | -| `flank_speed` | Flank speed in inches | `4"` | -| `armour` | Ship's armor rating | `6+` | -| `hull` | Ship's hull value (current/max) | `72/24` | -| `traits` | Special traits | `Aircraft 4, Armoured Deck, Torpedo Belt 2` | -| `ship_image` | Path to the ship image relative to the ship_images folder | `new_mexico.png` | -| `nation` | Path to the nation's image relative to the flags folder | `usa.png` +| Field | Description | Example | +| ------------- | --------------------------------------------------------- | ------------------------------------------- | +| `ship_id` | Unique ID for the ship | `1` | +| `ship_name` | Name of the ship | `New Mexico` | +| `ship_type` | Type of the ship | `Battleship` | +| `points` | Point cost | `395` | +| `flank_speed` | Flank speed in inches | `4"` | +| `armour` | Ship's armor rating | `6+` | +| `hull` | Ship's hull value (current/max) | `72/24` | +| `traits` | Special traits | `Aircraft 4, Armoured Deck, Torpedo Belt 2` | +| `ship_image` | Path to the ship image relative to the ship_images folder | `new_mexico.png` | +| `nation` | Path to the nation's image relative to the flags folder | `usa.png` | #### Example @@ -94,29 +92,31 @@ ship_id,ship_name,ship_type,points,flank_speed,armour,hull,traits,ship_image Defines the weapon systems for each ship. - -| Field | Description | Example | -|-----------------|--------------------------------------------------|---------------| -| `ship_id` | ID matching the ship from `ships.csv` | `1` | -| `weapon_system` | Name of the weapon system | `A Turret` | -| `fire_arc` | Firing arc of the weapon | `Fore` | -| `point_blank` | Point-blank range | `9"` | -| `short` | Short range | `18"` | -| `long` | Long range | `27"` | -| `extreme` | Extreme range | `37"` | -| `ad` | Attack dice | `3` | -| `ap` | Armor penetration | `+2` | -| `dd` | Damage dice | `3` | -| `traits` | Special traits | `-` | +| Field | Description | Example | +| --------------- | ------------------------------------- | ---------- | +| `ship_id` | ID matching the ship from `ships.csv` | `1` | +| `weapon_system` | Name of the weapon system | `A Turret` | +| `fire_arc` | Firing arc of the weapon | `Fore` | +| `point_blank` | Point-blank range | `9"` | +| `short` | Short range | `18"` | +| `long` | Long range | `27"` | +| `extreme` | Extreme range | `37"` | +| `ad` | Attack dice | `3` | +| `ap` | Armor penetration | `+2` | +| `dd` | Damage dice | `3` | +| `traits` | Special traits | `-` | #### Fire Arcs + ##### Valid Fire Arcs + Fire arcs are case-insensitive and support the following single or combined arcs: - Single arcs: `Fore`, `Aft`, `Port`, `Starboard` - Combined arcs are seperated by a comma: `Fore, Aft` ##### Fire Arc Images + Fire arc images are generated using the `createArc.py` script. These images will be stored in the fire_arcs/ folder and linked dynamically on the ship cards. #### Example @@ -146,6 +146,7 @@ python generate.py ### Running via Executable 1. Ensure you have the following files and folders in the same directory as the executable: + - `ships.csv`: Contains ship data. - `weapon_systems.csv`: Contains weapon data. - `ship_images/`: Directory for ship images. @@ -154,11 +155,13 @@ python generate.py 2. Place the executable in the root directory of your setup. 3. Run the executable: + - On Windows: ```cmd VictoryAtSeaCardGenerator.exe ``` - On Linux/Mac: + ```bash ./VictoryAtSeaCardGenerator ``` @@ -178,7 +181,7 @@ Generated cards will be saved in the `output_images/` folder. ### Donate -To help me with creating new awesome tools and models you can +To help me with creating new awesome tools and models you can [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/mstelz) diff --git a/VASCardGenerator.exe b/VASCardGenerator.exe index 221c4b8..9e0bbde 100644 Binary files a/VASCardGenerator.exe and b/VASCardGenerator.exe differ diff --git a/createExecutable.sh b/createExecutable.sh new file mode 100644 index 0000000..838d78f --- /dev/null +++ b/createExecutable.sh @@ -0,0 +1,4 @@ +pyinstaller --onefile --name VASCardGenerator --add-data "fonts:fonts" --add-data "shipcard.html:." generate.py +mv ./dist/VASCardGenerator.exe . +rm -rf dist +rm -rf build \ No newline at end of file diff --git a/generate.py b/generate.py index 9404b22..a5afe22 100644 --- a/generate.py +++ b/generate.py @@ -224,7 +224,7 @@ def draw_vertical_lines(image_path, num_top_lines): driver.save_screenshot(screenshot_path) # Add vertical lines after ensuring the image has been saved at 300 DPI - draw_vertical_lines(screenshot_path, int(str(ship["hull"]).split("/")[0][0])) + draw_vertical_lines(screenshot_path, int(str(ship["hull"]).split("/")[0]) // 10) # Clean up the temporary HTML file os.remove(temp_html_path) diff --git a/output_images/6-Gun_Armed_Merchant_Cruiser.png b/output_images/6-Gun_Armed_Merchant_Cruiser.png new file mode 100644 index 0000000..c4b1e83 Binary files /dev/null and b/output_images/6-Gun_Armed_Merchant_Cruiser.png differ diff --git a/output_images/Essex.png b/output_images/Essex.png deleted file mode 100644 index 25a22fa..0000000 Binary files a/output_images/Essex.png and /dev/null differ diff --git a/output_images/Essex_Class_Carrier.png b/output_images/Essex_Class_Carrier.png new file mode 100644 index 0000000..64947c2 Binary files /dev/null and b/output_images/Essex_Class_Carrier.png differ diff --git a/output_images/John_C._Butler.png b/output_images/John_C._Butler.png deleted file mode 100644 index 5ee5343..0000000 Binary files a/output_images/John_C._Butler.png and /dev/null differ diff --git a/output_images/John_C._Butler_Class_Destroyer.png b/output_images/John_C._Butler_Class_Destroyer.png new file mode 100644 index 0000000..851c1a0 Binary files /dev/null and b/output_images/John_C._Butler_Class_Destroyer.png differ diff --git a/output_images/Kagero.png b/output_images/Kagero.png deleted file mode 100644 index f9a3321..0000000 Binary files a/output_images/Kagero.png and /dev/null differ diff --git a/output_images/Kagero_Class_Destroyer.png b/output_images/Kagero_Class_Destroyer.png new file mode 100644 index 0000000..dea0ba6 Binary files /dev/null and b/output_images/Kagero_Class_Destroyer.png differ diff --git a/output_images/Liner.png b/output_images/Liner.png new file mode 100644 index 0000000..7cbf9e6 Binary files /dev/null and b/output_images/Liner.png differ diff --git a/output_images/New_Mexico.png b/output_images/New_Mexico.png deleted file mode 100644 index 1884cd4..0000000 Binary files a/output_images/New_Mexico.png and /dev/null differ diff --git a/output_images/New_Mexico_Class_Battleship.png b/output_images/New_Mexico_Class_Battleship.png new file mode 100644 index 0000000..c49b556 Binary files /dev/null and b/output_images/New_Mexico_Class_Battleship.png differ diff --git a/output_images/Oil_Tanker.png b/output_images/Oil_Tanker.png new file mode 100644 index 0000000..6368c59 Binary files /dev/null and b/output_images/Oil_Tanker.png differ diff --git a/output_images/Seaplane_Tender.png b/output_images/Seaplane_Tender.png new file mode 100644 index 0000000..5d2c294 Binary files /dev/null and b/output_images/Seaplane_Tender.png differ diff --git a/output_images/Tramp_Freighter.png b/output_images/Tramp_Freighter.png new file mode 100644 index 0000000..b7a79d4 Binary files /dev/null and b/output_images/Tramp_Freighter.png differ diff --git a/output_images/Troop_Ship.png b/output_images/Troop_Ship.png new file mode 100644 index 0000000..5115421 Binary files /dev/null and b/output_images/Troop_Ship.png differ diff --git a/output_images/Victory_Class_Cargo_Ship.png b/output_images/Victory_Class_Cargo_Ship.png new file mode 100644 index 0000000..e00db38 Binary files /dev/null and b/output_images/Victory_Class_Cargo_Ship.png differ diff --git a/shipcard.html b/shipcard.html index ca1f424..b467f42 100644 --- a/shipcard.html +++ b/shipcard.html @@ -116,7 +116,7 @@
${nation_html} -

${ship_name} CLASS ${ship_type}

+

${ship_name}

${ship_image_html} diff --git a/ships.csv b/ships.csv index 8021f1f..8be302a 100644 --- a/ships.csv +++ b/ships.csv @@ -1,5 +1,12 @@ ship_id,ship_name,ship_type,points,flank_speed,armour,hull,traits,ship_image,nation -1,Essex,Carrier,270,"6""",3+,70/23,"Advanced Radar, Carrier, Torpedo Belt 3",essex.png,usa.png -2,New Mexico,Battleship,395,"4""",6+,72/24,"Aircraft 4, Armoured Deck, Torpedo Belt 2",new_mexico.png,usa.png -3,John C. Butler,Destroyer,60,"5""",1+,4/1,"Agile, Advanced Radar, Sub-Hunter, Depth Charge, Hedgehogs",john-c-butler.png,usa.png -4,Kagero,Destroyer,100,"7""",1+,5/2,"Agile, Depth Charge",kagero-class.png,japan.png +1,Essex Class Carrier,Carrier,270,"6""",3+,70/23,"Advanced Radar, Carrier, Torpedo Belt 3",essex.png,usa.png +2,New Mexico Class Battleship,Battleship,395,"4""",6+,72/24,"Aircraft 4, Armoured Deck, Torpedo Belt 2",new_mexico.png,usa.png +3,John C. Butler Class Destroyer,Destroyer,60,"5""",1+,4/1,"Agile, Advanced Radar, Sub-Hunter, Depth Charge, Hedgehogs",john-c-butler.png,usa.png +4,Kagero Class Destroyer,Destroyer,100,"7""",1+,5/2,"Agile, Depth Charge",kagero-class.png,japan.png +5,6-Gun Armed Merchant Cruiser,Civilian,25,"3""",1+,15/5,Lumbering,, +6,Liner,Civilian,25,"6""",1+,72/24,Lumbering,, +7,Oil Tanker,Civilian,30,"4""",1+,15/5,Lumbering,, +8,Seaplane Tender,Civilian,25,"4""",1+,12/4,"Aircraft 6, Lumbering",, +9,Tramp Freighter,Civilian,10,"2""",1+,6/2,,, +10,Troop Ship,Civilian,25,"3""",1+,16/5,Lumbering,, +11,Victory Class Cargo Ship,Civilian,30,"3""",1+,14/4,Lumbering,, \ No newline at end of file diff --git a/weapon_systems.csv b/weapon_systems.csv index ae61fbe..49db79b 100644 --- a/weapon_systems.csv +++ b/weapon_systems.csv @@ -14,4 +14,19 @@ ship_id,weapon_system,fire_arc,point_blank,short,long,extreme,ad,ap,dd,traits 4,Light Guns (6 x 5-inch),"Fore, Aft, Port, Starboard","5""","10""","15""","20""",3,2,1,Weak 4,AA Battery,"Fore, Aft, Port, Starboard",-,-,-,-,-,-,-,Local 1 4,Port/Starboard Type 93 Torpedoes,"Port, Starboard","8""","17""","25""","34""",4,-,3,"Devastating, Slow-Loading, Wakeless" -4,Port/Starboard Type 93 Torpedoes,"Port, Starboard","8""","17""","25""","34""",4,-,3,"Devastating, Slow-Loading, Wakeless" \ No newline at end of file +4,Port/Starboard Type 93 Torpedoes,"Port, Starboard","8""","17""","25""","34""",4,-,3,"Devastating, Slow-Loading, Wakeless" +5,Light Guns (6 x 6-inch),"Fore, Aft, Port, Starboard","4""","9""","13""","18""",4,-2,1,"Restricted, Weak" +5,AA Battery,"Fore, Aft, Port, Starboard","1""","2""","3""","5""",1,-,-,Local 1 +5,Port Torpedoes,Port,"2""","5""","7""","10""",2,-,3,Devastating +5,Starboard Torpedeos,Starboard,"2""","5""","7""","10""",2,-,3,Devastating +6,Light Guns (1 x 4-inch),"Aft, Port, Starboard","3""","6""","9""","12""",1,-2,1,"Slow-Loading, Weak" +6,AA Battery,"Fore, Aft, Port, Starboard",-,-,-,-,-,-,-,Local 1 +7,Light Guns (1 x 5-inch),"Aft, Port, Startboard","4""","8""","12""","16""",1,-2,1,"Slow-Loading, Weak" +7,AA Battery,"Fore, Aft, Port, Starboard",-,-,-,-,-,-,-,Local 1 +8,Light Guns (4 x 4.7-inch),"Fore, Aft, Port, Starboard","4""","8""","12""","16""",2,-2,1,"Restricted, Weak" +8,AA Battery,"Fore, Aft, Port, Starboard",-,-,-,-,-,-,-,Local 1 +9,Light Guns (1 x 4-inch),"Aft, Port, Starboard","3""","6""","9""","12""",1,-2,1,"Slow-Loading, Weak" +10,Light Guns (1 x 4-inch),"Aft, Port, Starboard","3""","6""","9""","12""",1,-2,1,"Slow-Loading, Weak" +10,AA Battery,"Fore, Aft, Port, Starboard",-,-,-,-,-,-,-,Local 1 +11,Light Guns (1 x 5-inch),"Aft, Port, Starboard","4""","9""","13""","18""",1,-2,1,"DP, Slow-Loading, Weak" +11,AA Battery,"Fore, Aft, Port, Starboard","1""","3""","4""","6""",1,-,-,Local 1 \ No newline at end of file