Quick Battle Generator

From Weapons Release Wiki
Jump to: navigation, search

2020-03-24 17-20-09.png

The Quick Battle Generator allows you to play a simple set piece match with a few variables.

Loading Quick Battles[edit]

Select Quick Battle then pick your engagement from the list on the left. Change variables as you'd like and click START.

Creating Custom Quick Battles[edit]

Create a copy of an existing Quick Battle in your \Command - Modern Operations\QuickBattle folder. Rename the folder to something new.

Each folder will contain a Form.html and a Script.lua file. The form is what the player sees, the script is what is executed depending on the variables that are chosen. I suggest editing either one using a program such as [Notepad++] or [Visual Studio Code]. Do not use a program such as Word or Wordpad.

Code 2020-03-24 17-32-22.png

Above is a VS Code window showing the auto formatting used with Lua or HTML.

 1 <link rel="stylesheet" type="text/css" href="../style.css">
 2 <body>
 3     <div class="container-1">
 4         <div class="header">
 5             <h1>Iraq 1991 Air to Air Engagement</h1><!--This is your Quick Battle Name as shown to the player-->
 6             <hr>
 7 			<img src="https://i.imgur.com/iFbAaan.png" alt="1991 Iraq War"><!--This is an image added to the header.-->
 9             <cite>Create a meeting engagement between two opposing sets of aircraft over Kuwait.</cite><!--This is a brief description of the battle.-->
10         </div>
11         <div class="form">
12             <br>
13             <p>You are in control of <input name="OwnAircraftQuantity" type="text" style="width: 35px" value="6" />x
14                 <select name="OwnAircraftClassAndLoadout">
15                 <option value="583_1404">F-15C Eagle (USAF 1987)</option><!--Format = DBID_LoadoutID-->
16                 <option value="705_1689">F/A-18A Hornet (USN 1988) </option>
17                 <option value="2709_12189">F-15E Strike Eagle (USAF 1991)</option>
18                 <option value="100_161">Tornado GR.1 (1991)</option>
19                 <option value="666_9580">F-14A Tomcat (1990)</option>
20                 <option value="1871_6711">F-16CG BLK 42 Falon (1991)</option>
21                 </select>
22             </p>
23             <p>Your adversary controls <input name="EnemyAircraftQuantity" type="text" style="width: 35px" value="6" />x
24                 <select name="EnemyAircraftClassAndLoadout">
25                     <option value="1347_26829">MIG-29 Fulcrum A (IRAF 1987)</option><!--Format = DBID_LoadoutID-->
26                     <option value="1203_17655">Mirage F.1EQ-6 (IRAF 1989)</option>
27                     <option value="2841_13844">MiG-29M2 Fulcrum-C (SyAF 2013)</option>
28                     <option value="2233_5233">MIG-25PB Foxbat A (IRAF 1986)</option>
29                     <option value="2760_13025">MIG-21bis Fishbed L (IRAF 1984)</option>
30                     <option value="1352_5158">MIG-23MF Flogger B (IRAF 1982)</option>
31                     </select>
32             </p>

Form.HTML needs a few things modified.

  • Line #5 - Add your Title. This is shown to the player.
  • Line #9 - Add a brief description of your battle.
  • Line #15-20 - Add aircraft
    • Syntax is DBID_LoadoutID. You can find this in the Database Viewer.
    • Add the name as you'd like, but keep it brief as space is limited.
  • Line #25-30 - Add the OPFOR information

Below this section is more detail however for the most part you can get by with this unless you are comfortable with HTML, CSS, and Lua.

The Script.Lua file can mostly be left alone. Modify this only if you are comfortable with the results. If you want to change the location of the battle scroll down to the line that contains the below information.

1 ScenEdit_AddReferencePoint({side="OPFOR", name="Centrepoint", lat=29.3973255157471, lon=47.3163108825684, highlighted=false})

Change the lat and lon value to a valid latitude and longitude for your scenario to occur.

You can download a copy of this [Quick Battle here].

Sharing Custom Quick Battles[edit]

The easiest way is to zip the entire folder and add it to the above thread at the Matrix forums.