Difference between revisions of "Modding"

From Airships Wiki
Jump to: navigation, search
m (Clarification on the preliminary information)
(Basic Attributes 90% done)
Line 92: Line 92:
===<u>Basic Attributes:</u>===
===<u>Basic Attributes:</u>===


<code>
'''"name": "value",'''
</code>


Sets the name of the module.
<div style="border: 2px solid #c8b84f; background-color: #0d0700; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"name": "value",</div>
 
<ul>
Required to create a module.
<li>Sets the name of the module.</li>
<li>Required to create a module.</li>
</ul>


<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.
<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.
Line 106: Line 105:




<code>
<div style="border: 2px solid #c8b84f; background-color: #0d0700; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">{
{
"name": "value",
 
'''"name": "value",'''
 
'''"flippedFrom": "value2"'''
 
},
</code>
 
Creates a flipped version of the module.


Not required.
"flippedFrom": "value2"
},</div>
<ul>
<li>Creates a flipped version of the module.</li>
<li>Not required.</li>
</ul>


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




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


Used for modules that can be flipped vertically. (i.e. dorsal turrets, sails, engine pods, etc.)
Used for modules that can be flipped vertically. (i.e. dorsal turrets, sails, engine pods, etc.)
Line 146: Line 139:




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


'''"name": "value",'''
"remove": true
 
},</div>
'''"remove": true'''
<ul>
 
<li>Removes the specified module from the game.</li>
},
<li>Not required.</li>
 
</ul>
Removes the specified module from the game.
 
Not required.


Used for removing modules from conflicting mods or for other reasons.
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.
<code>"value"</code> here will be the name of the module you are removing.


<hr style="width:50%">
<hr style="width:50%">


<code>
'''"categories": [ "value" ],'''
</code>


Sets the category (or categories) the module will be in in the In-Game Editor.
<div style="border: 2px solid #c8b84f; background-color: #0d0700; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"categories": [ "value" ],</div>
 
<ul>
Required, if not provided the module will not appear in game.
<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.
<code>"value"</code> here will be the name of the category you are putting the module in.
Line 181: Line 171:
</pre>
</pre>
</div>
</div>


<hr style="width:50%">
<hr style="width:50%">


<code>
'''"availableFor": [ "value" ],'''
</code>


Sets the type of construct the module is available for in the In-Game Editor.
<div style="border: 2px solid #c8b84f; background-color: #0d0700; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"availableFor": [ "value" ],</div>
<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>


Not required, game will default to all.
<code>"value"</code> here can be <code>AIRSHIP, LANDSHIP, or BUILDING.</code>


<code>"value"</code> here can be <code>AIRSHIP, LANDSHIP, or BUILDING.</code>


<hr style="width:50%">
<hr style="width:50%">


<code>
'''"required": "value,"'''
</code>
Sets the required technology/bonus needed to place the module.


Not required, game will default to no requirement.
<div style="border: 2px solid #c8b84f; background-color: #0d0700; 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.
<code>"value"</code> here can be a technology or bonus.
Line 219: Line 209:
</pre>
</pre>
</div>
</div>


<hr style="width:50%">
<hr style="width:50%">


<code>'''"w": "value",'''</code> and <code>'''"h": "value",'''</code>


Defines the width and height of the module.
<div style="border: 2px solid #c8b84f; background-color: #0d0700; 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>


Required.
<code>"value"</code> for both will be how many tiles a module is wide/high.


<code>"value"</code> for both will be how many tiles a module is wide/high.


<hr style="width:50%">
<hr style="width:50%">


<code>'''"AILogic": true,"'''</code>


Defines what Logic the AI should use with this module.
<div style="border: 2px solid #c8b84f; background-color: #0d0700; color: #ffffff; font-weight: 400; padding: 10px 20px; width:40%;">"AILogic": true,</div>
 
<ul>
Not required, but makes the AI not fully utilize your module. (Not required for every module)
<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:
<code>"AILogic"</code> here will be one of six values:
Line 245: Line 239:
</pre>
</pre>
</div>
</div>


<hr style="width:50%">
<hr style="width:50%">


<code>'''"aiMaxY": "value",'''</code>


Defines the max height the AI can fly to with this module.
<div style="border: 2px solid #c8b84f; background-color: #0d0700; 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>


Not required, only used for monsters.
<code>"value"</code> here will be a y-value, where negative y increases height and positive y decreases height.


<code>"value"</code> here will be a y-value, where negative y increases height and positive y decreases height.


<hr style="width:50%">
<hr style="width:50%">


<code>'''"createsExceptionalCombatEventAfterMs": "value",'''</code>


<div style="border: 2px solid #c8b84f; background-color: #0d0700; 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%">
<hr style="width:50%">


<code>'''"countsAsActiveCrew": true,"'''</code>


<div style="border: 2px solid #c8b84f; background-color: #0d0700; 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%">
<hr style="width:50%">


<code>'''"instantlyDestroyed": true,'''</code>


<div style="border: 2px solid #c8b84f; background-color: #0d0700; 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.




----
----
===<u>Appearance Attributes:</u>===
===<u>Appearance Attributes:</u>===



Revision as of 19:29, 22 May 2022

The game can be modded using JSON files.

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

Modding Guide Blog Posts

Other Resources

Modding Attribute List

Preliminary Information:

The basic structure of attributes 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.

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

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

In this guide, attributes will have applicable values listed alongside them, so for now just know that not all attributes take the same values.


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:

[
  {
    "Attribute1": "value",
    "Attribute2": "value",
    "Attribute3": "value"
  }
]

This is also the case when adding attributes within other attributes:

[
  {
    "AttributeParent": { 
      "subAttribute1": "value",
      "subAttribute2": "value",
      "subAttribute3": "value"
    }
  }
]

The same rule also applies to lists of values within attributes:

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

Do note that "AttributeParent", "AttributeValueList", "value", etc. are all placeholder names for Attributes and Values.


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.



Basic Attributes:

"name": "value",
  • Sets the name of the module.
  • Required to create a module.

"value" 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.




{

"name": "value",

"flippedFrom": "value2"

},
  • Creates a flipped version of the module.
  • Not required.

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

"value" here will be the name of the flipped module. (i.e. FLIPPED_EXAMPLE_MODULE)

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




"verticallyFlippedVersion": "value",
  • Creates a vertically flipped version of the module.
  • Not required.

Used for modules that can be flipped vertically. (i.e. dorsal turrets, sails, engine pods, etc.)

"value" here will be the name of the module being flipped vertically.




{

"name": "value",

"remove": true

},
  • Removes the specified module from the game.
  • Not required.

Used for removing modules from conflicting mods or for other reasons.

"value" here will be the name of the module you are removing.




"categories": [ "value" ],
  • Sets the category (or categories) the module will be in in the In-Game Editor.
  • Required, if not provided the module will not appear in game.

"value" here will be the name of the category you are putting the module in.

Default Categories:

BASIC, COMMAND_AND_CREW, LIFT, PROPULSION, RESOURCES, WEAPONS, TROOPS, AIRCRAFT, STRUCTURAL, SOLID_SHAPES, STRUTS, DECORATIVE




"availableFor": [ "value" ],
  • Sets the type of construct the module is available for in the In-Game Editor.
  • Not required, game will default to all.

"value" here can be AIRSHIP, LANDSHIP, or BUILDING.




"required": "value",
  • Sets the required technology/bonus needed to place the module.
  • Not required, game will default to no requirement.

"value" here can be a technology or bonus.

Default Technologies:


Default Charge Bonuses:





"w": "value", and "h": "value",
  • Defines the width and height of the module.
  • Required.

"value" for both will be how many tiles a module is wide/high.




"AILogic": true,
  • Defines what Logic the AI should use with this module.
  • Not required, but the AI doesn't know what the module can do w/o it. (Not required for every module)

"AILogic" here will be one of six values:

isExplosive, isSail, isWeapon, isGun, isCannon, isRam




"aiMaxY": "value",
  • Defines the max height the AI can fly to with this module.
  • Not required, only used for monsters.

"value" here will be a y-value, where negative y increases height and positive y decreases height.




"createsExceptionalCombatEventAfterMs": "value",
  • Triggers the AI for a module after "value" milliseconds.
  • Not required, mostly used for monster modules.

"value" 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.



"countsAsActiveCrew": true,
  • Lets the module function without crew.
  • Not required, mostly used for monster modules.

Makes it so the specified module can function without troops occupying it. Prevents defeat of the vehicle under certain conditions.



"instantlyDestroyed": true,
  • Instantly removes the module when destroyed.
  • Not required, mostly used for monster modules.

Modules with this enabled will be instantly removed from combat upon destruction. Used in the spider monster modules, as well as some others.



Appearance Attributes:

Structural Attributes:

Resource Attributes:

Weapon Attributes:

Weapon Appearance Attributes:

Audio Attributes:

Track-related Attributes:

Leg-related Attributes:

Tentacle-related Attributes: