Difference between revisions of "Modding"

From Airships Wiki
Jump to: navigation, search
(spacing fixes)
(Modding page rework part 1)
Line 1: Line 1:
{{Under construction}}
The game can be modded using JSON files.
The game can be modded using JSON files.


{{Under construction}}
Watch this video on modding to get started:
[https://www.youtube.com/watch?v=QMS20xI5g14 Airships Modding Tutorial Video]
 
 
== Modding Resources ==
=== <u>Official Resources</u> ===


== Modding Guide Blog Posts ==
* [http://zarkonnen.com/airships/modding_guide Modding Introduction]
* [http://zarkonnen.com/airships/modding_guide Introduction]
* [http://zarkonnen.com/airships/how_to_draw_graphics/ Mod Graphic Drawing Tutorial]
* [http://zarkonnen.com/airships/modding_guide/crew_animation Crew Animation]
* [http://zarkonnen.com/airships/peasant_revolt_mod/ Monster Nest Mod Example]
* [http://zarkonnen.com/airships/modding_guide/bonusable_values Bonusable Values]
* [http://zarkonnen.com/airships/modding_guide/bonusable_values Bonusable Values Guide]
* [http://zarkonnen.com/airships/peasant_revolt_mod/ Monster Nest Mod]
* [http://zarkonnen.com/airships/modding_guide/special_eras Special Eras Modding Guide]
* [http://zarkonnen.com/airships/how_to_draw_graphics/ Graphic Drawing Guide]
* [http://zarkonnen.com/airships/modding_guide/crew_animation Crew Animation Guide]


== Other Resources ==
=== <u>Other Resources</u> ===


* [https://youtu.be/QMS20xI5g14 Airships Mod Tutorial Video]
* [https://www.moddb.com/mods/the-module-kit/tutorials/acts-module-string-reference-guide Module String Reference Guide]
* [https://www.moddb.com/mods/the-module-kit/tutorials/acts-module-string-reference-guide Module String Reference Guide (Slightly Outdated)]
(Contains useful information about specific attributes, but is otherwise outdated)
* [https://gist.github.com/Zarkonnen/40a4962f9f2a4a29243fd0932ddec975 Loadables Data Dump]
* [https://gist.github.com/Zarkonnen/40a4962f9f2a4a29243fd0932ddec975 Loadables Data Dump]
(To poke around the game's loadables)


== Modding Attribute List ==


=== <u>Preliminary Information:</u> ===
=== <u>JSON Information</u> ===
The basic structure of attributes is:
The basic structure of an attribute is:
<div style="width:70%">
<div style="width:35%">
  <code>"Attribute": "value",</code>
  <code>"Attribute": "value",</code>
</div>
</div>
Where <code>"Attribute"</code> will be the attribute you want to add and <code>"Value"</code> is the value you want to set the attribute to.
Where <code>"Attribute"</code> will be the attribute you want to add and <code>"Value"</code> is the value you want to set the attribute to.


Some attributes can be given a list of values as well:
<div style="width:70%">
<code>"AttributeValueList": { "value1", "value2", "value3" },</code>
</div>
In this guide, attributes will have applicable values listed alongside them, so for now just know that not all attributes take the same values.


There are three types of attributes used in ACTS modding:
: <code>"value"</code> = string value
: <code>value</code> = numerical value
: <code>t/f</code> = true or false value


A note about JSON: when adding attributes you put a comma at the end only if there is another attribute after it.


For example, if there are only 3 attributes in a file, you would only have 2 commas as the last attribute doesn't need it:
Some attributes can be given a list of values as well:
<div style="width:70%">
<div style="width:35%">
<pre>
<code>"AttributeValueList": { "value1", "value2", "value3" },</code>
[
  {
    "Attribute1": "value",
    "Attribute2": "value",
    "Attribute3": "value"
  }
]
</pre>
</div>
This is also the case when adding attributes within other attributes:
<div style="width:70%">
<pre>
[
  {
    "AttributeParent": {
      "subAttribute1": "value",
      "subAttribute2": "value",
      "subAttribute3": "value"
    }
  }
]
</pre>
</div>
</div>
</div>
The same rule also applies to lists of values within attributes:
<div style="width:70%">
<pre>
[
  {
    "AttributeValueList": {
      "value1",
      "value2",
      "value3"
    }
  }
]
</pre>
</div>
Do note that "AttributeParent", "AttributeValueList", "value", etc. are all placeholder names for Attributes and Values.




Line 88: Line 55:




<hr style="height:5px; background-color: #000000">


===<u>Basic Attributes:</u>===
== Attribute List ==


===<u>Core Attributes</u>===


<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"name": "value",</div>
; name
<ul>
:Module name referenced by the en.properties file and "flippedFrom" & "verticallyFlippedVersion" attributes.
<li>Sets the name of the module.</li>
:In-Game displays this name in red when no language value is given.
<li>Required to create a module.</li>
<div style="width:55%">
</ul>
<pre>
{
  "name": "value",
}
</pre>
</div>


<code>"value"</code> here will be the name of the module. This name is used to refer to this module in other files, so make sure it is not the same as another module.


; flippedFrom
:Creates horizontally flipped variation of referenced "name".
<div style="width:55%">
<pre>
{
  "name": "value",
  "flippedFrom": "nameValue",
}
</pre>
</div>


<hr style="width:50%">


; verticallyFlippedVersion
:Creates vertically flipped variation of referenced "name".
<div style="width:55%">
<pre>
{
  "name": "value",
  "verticallyFlippedVersion": "nameValue",
}
</pre>
</div>


<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">{
"name": "value",


"flippedFrom": "value2"
; remove
},</div>
:Removes the specified "name" from the game.
<ul>
:Example use is removing modules from a conflicting mod.
<li>Creates a flipped version of the module.</li>
<div style="width:55%">
<li>Not required.</li>
<pre>
</ul>
{
  "name": "value",
  "remove": t/f,
}
</pre>
</div>


Used for modules that can be flipped horizontally. (i.e. cannons, telescopes, propellers, etc.)


<code>"value"</code> here will be the name of the flipped module. (i.e. FLIPPED_EXAMPLE_MODULE)
; categories
:In-Game Editor Module Category. Setting this value blank will make the module valid without appearing in-game.
:Vanilla categories: BASIC, COMMAND_AND_CREW, LIFT, PROPULSION, RESOURCES, WEAPONS, TROOPS, AIRCRAFT, STRUCTURAL, SOLID_SHAPES, STRUTS, DECORATIONS
:Custom categories can be added by creating a ModuleCategory folder and creating a json file inside. See data/ModuleCategory/categories.json for reference.
<div style="width:55%">
<pre>
{
  "categories": [ "value" ],
}
</pre>
</div>


<code>"value2"</code> here will be the name of the module being flipped. (i.e. EXAMPLE_MODULE)


; availableFor
:Types of craft the Module is enabled for In-Game Editor. Engine defaults to all.
:Default types: AIRSHIP, LANDSHIP, BUILDING
<div style="width:55%">
<pre>
{
  "availableFor": [ "value" ],
}
</pre>
</div>


<hr style="width:50%">


; required
:Required Technology, City, or Charge bonus to build the Module in Single Player.
:See data/Tech/ folder for Technology bonus files.
:See data/Charge/ folder for Charge bonus files.
:Miscellaneous bonus files: strategicEras.json, eraModifiers.json, specials.json, upgrades.json
<div style="width:55%">
<pre>
{
  "required": "value",
}
</pre>
</div>


<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"verticallyFlippedVersion": "value",</div>
<ul>
<li>Creates a vertically flipped version of the module.</li>
<li>Not required.</li>
</ul>


Used for modules that can be flipped vertically. (i.e. dorsal turrets, sails, engine pods, etc.)
; w
:Width of the Module in Tiles.
<div style="width:55%">
<pre>
{
  "w": value,
}
</pre>
</div>


<code>"value"</code> here will be the name of the module being flipped vertically.


; h
:Height of the Module in Tiles.
<div style="width:55%">
<pre>
{
  "h": value,
}
</pre>
</div>


<hr style="width:50%">


; Module Definition Attributes
:Specifies the Modules property for AI Logic.
<div style="width:55%">
<pre>
{
  "isExplosive": t/f,  //Rockets, Bomb Bays, Grenades, etc.
  "isSail": t/f,      //Sails.
  "isWeapon": t/f,    //Required for all weapon modules.
  "isGun": t/f,      //All guns (Rifles, Cannons, Turrets, Sponsons, etc.)
  "isCannon": t/f,    //Turrets, Cannons, Suspendium Cannons, Flak Cannons, etc.
  "isRam": t/f,      //Rams.
}
</pre>
</div>


<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">{
"name": "value",
"remove": true
},</div>
<ul>
<li>Removes the specified module from the game.</li>
<li>Not required.</li>
</ul>
Used for removing modules from conflicting mods or for other reasons.
<code>"value"</code> here will be the name of the module you are removing.
<hr style="width:50%">
<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"categories": [ "value" ],</div>
<ul>
<li>Sets the category (or categories) the module will be in in the In-Game Editor.</li>
<li>Required, if not provided the module will not appear in game.</li>
</ul>
<code>"value"</code> here will be the name of the category you are putting the module in.


Default Categories:
; aiMaxY
<div style="width:70%">
:Sets the maximum height this module can go. Used to limit monster AI.
<div style="width:55%">
<pre>
<pre>
BASIC, COMMAND_AND_CREW, LIFT, PROPULSION, RESOURCES, WEAPONS, TROOPS, AIRCRAFT, STRUCTURAL, SOLID_SHAPES, STRUTS, DECORATIVE
{
  "aiMaxY": value,
}
</pre>
</pre>
</div>
</div>




<hr style="width:50%">
; createsExceptionalCombatEventAfterMs
 
:This String is often used with Monsters. Triggers the AI for the Module after a specified number of Milliseconds.
 
:ex. A Module with Capture Troops will Capture. A Module with a Weapon will Fire. A Module with Legs will begin to Walk. etc.
<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"availableFor": [ "value" ],</div>
<div style="width:55%">
<ul>
<li>Sets the type of construct the module is available for in the In-Game Editor.</li>
<li>Not required, game will default to all.</li>
</ul>
 
<code>"value"</code> here can be <code>AIRSHIP, LANDSHIP, or BUILDING.</code>
 
 
<hr style="width:50%">
 
 
<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"required": "value",</div>
<ul>
<li>Sets the required technology/bonus needed to place the module.</li>
<li>Not required, game will default to no requirement.</li>
</ul>
 
<code>"value"</code> here can be a technology or bonus.
 
Default Technologies:
<div style="width:70%">
<pre>
<pre>
 
{
  "createsExceptionalCombatEventAfterMs": value,
}
</pre>
</pre>
</div>
</div>


Default Charge Bonuses:
 
<div style="width:70%">
; countsAsActiveCrew
:Specifies the Module acts as an Active Crew Member, capable of performing Module tasks without Troops occupying the Module, allowing Interior vision of the Module, and preventing Defeat of the craft under certain Conditions.
<div style="width:55%">
<pre>
<pre>
 
{
  "countsAsActiveCrew": t/f,
}
</pre>
</pre>
</div>
</div>




<hr style="width:50%">
; instantlyDestroyed
 
:Instantly removes the Module from the battle on destruction, allowing for animated or simplified death sequences from other connected Modules. Most often used on Monster Modules.
 
<div style="width:55%">
<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"w": "value", and "h": "value",</div>
<ul>
<li>Defines the width and height of the module.</li>
<li>Required.</li>
</ul>
 
<code>"value"</code> for both will be how many tiles a module is wide/high.
 
 
<hr style="width:50%">
 
 
<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"AILogic": true,</div>
<ul>
<li>Defines what Logic the AI should use with this module.</li>
<li>Not required, but the AI doesn't know what the module can do w/o it. (Not required for every module)</li>
</ul>
 
<code>"AILogic"</code> here will be one of six values:
 
<div style="width:70%">
<pre>
<pre>
isExplosive, isSail, isWeapon, isGun, isCannon, isRam
{
  "instantlyDestroyed": t/f,
}
</pre>
</pre>
</div>
</div>




<hr style="width:50%">
===<u>Appearance Attributes</u>===
 
 
<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"aiMaxY": "value",</div>
<ul>
<li>Defines the max height the AI can fly to with this module.</li>
<li>Not required, only used for monsters.</li>
</ul>
 
<code>"value"</code> here will be a y-value, where negative y increases height and positive y decreases height.
 
 
<hr style="width:50%">
 
 
<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"createsExceptionalCombatEventAfterMs": "value",</div>
<ul>
<li>Triggers the AI for a module after "value" milliseconds.</li>
<li>Not required, mostly used for monster modules.</li>
</ul>
 
<code>"value"</code> will be a number in milliseconds (1000ms = 1s).
 
The AI that is triggered depends on what the AI Logic is for said module. Giving a module Weapon AI Logic will trigger the module to fire its weapon after "value" milliseconds. If it has boarders it will board after "value" milliseconds.
 
 
<hr style="width:50%">
 
 
<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"countsAsActiveCrew": true,</div>
<ul>
<li>Lets the module function without crew.</li>
<li>Not required, mostly used for monster modules.</li>
</ul>
 
Makes it so the specified module can function without troops occupying it. Prevents defeat of the vehicle under certain conditions.
 
 
<hr style="width:50%">
 
 
<div style="border: 2px solid #c8b84f; background-color: #1a0c00; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"instantlyDestroyed": true,</div>
<ul>
<li>Instantly removes the module when destroyed.</li>
<li>Not required, mostly used for monster modules.</li>
</ul>
 
Modules with this enabled will be instantly removed from combat upon destruction. Used in the spider monster modules, as well as some others.
 
 
<hr style="height:5px; background-color: #000000">
 
===<u>Appearance Attributes:</u>===
[Under Construction]
 
 
<hr style="height:5px; background-color: #000000">
 
 
===<u>Structural Attributes:</u>===
[Under Construction]
 
 
<hr style="height:5px; background-color: #000000">
 
 
===<u>Resource Attributes:</u>===
[Under Construction]
 
 
<hr style="height:5px; background-color: #000000">
 
 
===<u>Weapon Attributes:</u>===
[Under Construction]
 
 
<hr style="height:5px; background-color: #000000">
 
 
===<u>Weapon Appearance Attributes:</u>===
[Under Construction]
 
 
<hr style="height:5px; background-color: #000000">
 
 
===<u>Audio Attributes:</u>===
[Under Construction]
 
 
<hr style="height:5px; background-color: #000000">
 
 
===<u>Track-related Attributes:</u>===
[Under Construction]
 
 
<hr style="height:5px; background-color: #000000">
 
 
===<u>Leg-related Attributes:</u>===
[Under Construction]
 
 
<hr style="height:5px; background-color: #000000">




===<u>Tentacle-related Attributes:</u>===
[Under Construction]




[[Category:Modding]]
[[Category:Modding]]

Revision as of 05:04, 5 February 2023

Underconstruction.png This page is under construction. Please help review and edit this page.

The game can be modded using JSON files.

Watch this video on modding to get started: Airships Modding Tutorial Video


Modding Resources

Official Resources

Other Resources

(Contains useful information about specific attributes, but is otherwise outdated)

(To poke around the game's loadables)


JSON Information

The basic structure of an attribute is:

"Attribute": "value",

Where "Attribute" will be the attribute you want to add and "Value" is the value you want to set the attribute to.


There are three types of attributes used in ACTS modding:

"value" = string value
value = numerical value
t/f = true or false value


Some attributes can be given a list of values as well:

"AttributeValueList": { "value1", "value2", "value3" },


Appearance Attributes will require a spritesheet to get their graphics from.

1 Tile = 16 pixels, spritesheets are 63 x 63 tiles, or 1024 x 1024 pixels (Note that spritesheets are 63 x 63 because they start from 0. Meaning that x & y go from 0-63.)

When attributes require a coordinate on the spritesheet, the format is ( x , y ) or horizontal then vertical.

Both horizontal and vertical start from ( 0 , 0 ) on the top left and go to ( 63 , 63 ) on the bottom right.


Attribute List

Core Attributes

name
Module name referenced by the en.properties file and "flippedFrom" & "verticallyFlippedVersion" attributes.
In-Game displays this name in red when no language value is given.
{
  "name": "value",
}


flippedFrom
Creates horizontally flipped variation of referenced "name".
{
  "name": "value",
  "flippedFrom": "nameValue",
}


verticallyFlippedVersion
Creates vertically flipped variation of referenced "name".
{
  "name": "value",
  "verticallyFlippedVersion": "nameValue",
}


remove
Removes the specified "name" from the game.
Example use is removing modules from a conflicting mod.
{
  "name": "value",
  "remove": t/f,
}


categories
In-Game Editor Module Category. Setting this value blank will make the module valid without appearing in-game.
Vanilla categories: BASIC, COMMAND_AND_CREW, LIFT, PROPULSION, RESOURCES, WEAPONS, TROOPS, AIRCRAFT, STRUCTURAL, SOLID_SHAPES, STRUTS, DECORATIONS
Custom categories can be added by creating a ModuleCategory folder and creating a json file inside. See data/ModuleCategory/categories.json for reference.
{
  "categories": [ "value" ],
}


availableFor
Types of craft the Module is enabled for In-Game Editor. Engine defaults to all.
Default types: AIRSHIP, LANDSHIP, BUILDING
{
  "availableFor": [ "value" ],
}


required
Required Technology, City, or Charge bonus to build the Module in Single Player.
See data/Tech/ folder for Technology bonus files.
See data/Charge/ folder for Charge bonus files.
Miscellaneous bonus files: strategicEras.json, eraModifiers.json, specials.json, upgrades.json
{
  "required": "value",
}


w
Width of the Module in Tiles.
{
  "w": value,
}


h
Height of the Module in Tiles.
{
  "h": value,
}


Module Definition Attributes
Specifies the Modules property for AI Logic.
{
  "isExplosive": t/f,   //Rockets, Bomb Bays, Grenades, etc.
  "isSail": t/f,      //Sails.
  "isWeapon": t/f,    //Required for all weapon modules.
  "isGun": t/f,       //All guns (Rifles, Cannons, Turrets, Sponsons, etc.)
  "isCannon": t/f,    //Turrets, Cannons, Suspendium Cannons, Flak Cannons, etc.
  "isRam": t/f,       //Rams.
}


aiMaxY
Sets the maximum height this module can go. Used to limit monster AI.
{
  "aiMaxY": value,
}


createsExceptionalCombatEventAfterMs
This String is often used with Monsters. Triggers the AI for the Module after a specified number of Milliseconds.
ex. A Module with Capture Troops will Capture. A Module with a Weapon will Fire. A Module with Legs will begin to Walk. etc.
{
  "createsExceptionalCombatEventAfterMs": value,
}


countsAsActiveCrew
Specifies the Module acts as an Active Crew Member, capable of performing Module tasks without Troops occupying the Module, allowing Interior vision of the Module, and preventing Defeat of the craft under certain Conditions.
{
  "countsAsActiveCrew": t/f,
}


instantlyDestroyed
Instantly removes the Module from the battle on destruction, allowing for animated or simplified death sequences from other connected Modules. Most often used on Monster Modules.
{
  "instantlyDestroyed": t/f,
}


Appearance Attributes