https://starbounder.org/mediawiki/api.php?action=feedcontributions&user=%F0%9F%98%BA&feedformat=atomStarbounder - Starbound Wiki - User contributions [en]2024-03-28T13:03:45ZUser contributionsMediaWiki 1.26.2https://starbounder.org/mediawiki/index.php?title=Modding:Metadata_file&diff=182762Modding:Metadata file2018-06-09T03:09:45Z<p>😺: Mentions that the priority value is ignored when the mod is required / included by another</p>
<hr />
<div>The metadata file replaces the [MODNAME].modinfo file as of version 1.0 (Cheerful Giraffe, released July 22nd, 2016)<ref>https://www.reddit.com/r/starbound/comments/4smkzj/2_quick_tips_about_mod_formats_for_unstable/</ref>. It's an entirely optional [[Modding:JSON|JSON]] file that contains a set of entirely optional parameters.<br />
<ref>http://community.playstarbound.com/threads/modding-for-1-0.117818/#post-2956738 <br />
The | Suit, Jul 22, 2016</ref>.<br />
<br />
The metadata file can be named either <code>_metadata</code> or <code>.metadata</code><ref>http://community.playstarbound.com/threads/how-do-we-format-metadata-files.118150/#post-2957094 <br />
The | Suit, Jul 22, 2016</ref> and is placed at the root of a mod's folder. <br />
<br />
(Note: Windows generally takes issue with any file that starts with a period. It's been suggested to either use <code>_metadata</code> for the filename, or name it <code>.metadata.</code> <ref>http://i.imgur.com/PyNZqbg.gif</ref> Windows will strip the trailing period.<br />
<br />
If you are using Steam for windows, you can upload a mod using the Mod Uploader Tool. This will automatically generate a metadata file for you. Simply click the normal play from Stream, and select the "Launch Mod Uploader Tool" and follow along with the instructions.<br />
<br />
The metadata file contains general information about the mod, much of which will be displayed in mod's information section via the mod list on the Starbound title screen. (Note: parameter order doesn't matter, and that '''each parameter is optional'''; Starbound will load just fine without it. You could for example create a metadata file that only contained an author parameter, or a metadata file that included every parameter except a version number. If you don't need a parameter, don't include it. However, for the sake of releasing mods on Steam, it's strongly suggested you set the name, friendlyname, description and version parameters. <br />
<br />
Here's an example of a metadata file that includes every parameter: <pre><br />
{<br />
"name" : "coolmod",<br />
"friendlyName" : "Cool mod",<br />
"description" : "This a cool mod!",<br />
"author" : "XxX-Cool mod Creator-XxX",<br />
"version" : "2.00 Alpha Gold",<br />
"link" : "http://example.com/coolmod",<br />
"steamContentId" : "000000001",<br />
"tags" : "Crafting and Building|Weapons|Armor and Clothes",<br />
"includes" : ["coolmodv1"],<br />
"requires" : ["anothermod", "coolmod2"],<br />
"priority" : 0<br />
}</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! Entry !! Description<br />
|-<br />
| <tt>name</tt> || The "behind the scenes" name that is used by other mods. The "requires" and "includes" use this parameter.<br />
|-<br />
| <tt>friendlyName</tt> || The name that'll show up mostly everywhere else.<br />
|-<br />
| <tt>description</tt> || The description of the mod.<br>Type '\n' for a new line, and escape quotations with a \, such as <pre>"description" : "This mod is \"cool\", if you know what I mean.\n:)"</pre><br />
|-<br />
| <tt>author</tt> || The author of the mod.<br />
|-<br />
| <tt>version</tt> || The version of the mod.<br />
|-<br />
| <tt>link</tt> || An URL that links to the mod. (Steam Workshop URL, Chucklefish Forum, Github, yourwebsite.net, etc)<br />
|-<br />
| <tt>steamContentId</tt> || The workshop's unique id that steam uses. The Mod Uploader Tool available with Starbound's Steam version will fill this in automatically. Can be quoted (string) or not (number).<br />
|-<br />
| <tt>tags</tt> || The workshop's tags this mod is classified as that steam uses. The Mod Uploader Tool offers a list of tags to select from.<br />
|-<br />
| <tt>includes</tt> || Any mods listed here will be loaded before this mod (regardless of their priority value), if they exist. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>requires</tt> || Any mods listed here will be '''required''', will be loaded before this mod (regardless of their priority value), and the game will error at startup if these mods aren't present. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>priority</tt> || The lower the number, the sooner it'll be loaded<ref>https://steamcommunity.com/app/211820/discussions/4/353916838209436654/#c355043117501118531 Mod Load Order, 17 Aug, 2016</ref>. The base assets.pak has a priority of -9999. <br>This value will be ignored if another mod has this mod in it's includes or requires, and will be forced to load right before that other mod's priority value. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
|}<br />
<br />
<noinclude>{{Modding}} {{Category:Modding:Documentation}}</noinclude></div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Lua/Starbound_Datatypes&diff=181963Modding:Lua/Starbound Datatypes2018-01-29T02:08:00Z<p>😺: /* entityType */ added projectile</p>
<hr />
<div>Starbound makes extensive use of Lua and JSON, and their data types. There are some types that could use some small amount of documentation, and that is the goal of this page.<br />
<br><br />
<br><br />
Note that a JSON array and a Lua array aren't the same. [http://community.playstarbound.com/threads/why-wont-this-work-please-help-me.132290/#post-3148429 This post and the following ones] give some beginner-level differentiation.<br />
<br><br />
<br><br />
<hr><br />
<div id="moddingcode"><br />
===<code>*Id</code>===<br />
These are <code>integers</code>, not to be confused with callable script objects.<br />
<br />
<hr><br />
<br />
===<code>RpcPromise</code>===<br />
Returned by functions requiring asynchronous data, such as world.sendEntityMessage(). It has four methods that can be called to determine its status: <br />
<br />
<li><code>RpcPromiseVariable:finished()</code> returns a boolean indicating whether the promise has finished.</li><br />
<li><code>RpcPromiseVariable:succeeded()</code> returns a boolean indicating whether the promise has succeeded.</li><br />
<li><code>RpcPromiseVariable:result()</code> returns the return value(s) of the called function</li><br />
<li><code>RpcPromiseVariable:error()</code> returns the error string, or nil if no error occured. (Internal radio messages (eg. sendRadioMessage) always return an error, even if they executed properly)</li><br />
<hr><br />
<br />
===<code>liquidLevel</code>===<br />
Surprisingly simple, just the liquid ID and its amount.<br />
*<code>int</code> liquidId<br />
*<code>int</code> amount<br />
<br />
<hr><br />
<br />
===<code>ItemDescriptor</code>=== <br />
JSON object which contains key-value pairs for name and amount, as well as additional parameters:<br />
*<code>string</code> name<br />
*<code>int</code> count<br />
*<code>JSON</code> parameters<br />
If count or parameters is omitted, it seems they'll be considered as 1 and {} respectively.<br />
<br />
<hr><br />
<br />
===<code>Map<EntityId, unsigned></code>===<br />
This bears some small note, to prevent potential confusion. It is a Lua table, not an explicit key-value pair.<br />
<br />
<hr><br />
<br />
===<code>ItemBag</code>===<br />
First noted usage by widget.itemGridItems(String widgetName). this entry needs filling.<br />
<br />
<hr><br />
<br />
===<code>Vec2F</code> and <code>Vec2I</code>===<br />
JSON object which contains <code>x</code> and <code>y</code>.<br />
"I" is for Integer, "F" is for "Float"<br />
<pre>[x = 0, y = 2]</pre><br />
<br />
<hr><br />
<br />
===<code>rectF</code> and <code>rectI</code>===<br />
Json array which contains the top right and bottom left's X and Y coordinates of a rectangle.<br />
"I" is for Integer, "F" is for "Float"<br />
<pre>[-1, -1, 1, 1]</pre><br />
<br />
<hr><br />
<br />
===<code>polyF</code>===<br />
Json array which contains sets of x;y coordinates, forming a polygon's edges.<br />
The last coordinates form a line with the first ones.<br />
<pre>[ [-0.75, -2.0], [-0.35, -2.5], [0.35, -2.5], [0.75, -2.0], [0.75, 0.65], [0.35, 1.22], [-0.35, 1.22], [-0.75, 0.65] ]</pre><br />
<br />
<hr><br />
<br />
===<code>harvestLevel</code>===<br />
Seems to be the poor man's boolean, where 0 = false and 1 = true?<br />
<br />
<hr><br />
<br />
===<code>teamType</code>===<br />
Case-insensitive <code>string</code> used to define things like who can damage who. Vanilla types:<br />
*<code>friendly</code>: (players, non-agressive NPCs, pets...)<br />
*<code>enemy</code>: (monsters, agressive NPCs...)<br />
*<code>passive</code>: (critters...)<br />
*<code>ghostly</code>: Cannot be hit, unaffected by terrain hazards<br />
*<code>assistant</code>: (Glitch mission's castle friendly NPC (castle archers, nuru...))<br />
*<code>Environment</code>: (volcanic trap...)<br />
*<code>indiscriminate</code>: able to hit anything regardless of their damageTeam (traps...)<br />
*<code>pvp</code>: pvp-enabled players<br />
<br />
<hr><br />
<br />
===<code>damageType</code> and <code>tileDamageType</code>===<br />
Case-insensitive <code>string</code>:<br />
*<code>blockish</code>: damages to blocks<br />
*<code>plantish</code>: damages to plants<br />
*<code>beamish</code>: Used by the pickslash weaponability<br />
*<code>explosive</code>: Used by the meteor explosions<br />
*<code>fire</code>: <br />
*<code>tilling</code>: <br />
*<code>damage</code>: <br />
*<code>knockback</code>: used by shields<br />
*<code>Environment</code>: <br />
*<code>IgnoresDef</code>: Ignores the target's protection stat.<br />
*<code>NoDamage</code>: <br />
<br />
<hr><br />
<br />
===<code>damageSourceKind</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly. Might be to define which sound to play? Vanilla ones:<br />
<pre>applystatus, axe, bite, broadsword, bugnet, dagger, default, electric, electricbroadsword, electricfist, electrichammer, electricplasma, falling, fire, firebroadsword, firehammer, fireplasma, fist, fiststrong, foldingchair, fryingpan, gnomebeam, hammer, hidden, ice, icehammer, iceplasma, nodamage, plasma, poison, poisondagger, poisonhammer, poisonlash, poisonplasma, sawblade, shield, shortsword, slash, spear, standardbullet</pre><br />
<br />
<hr><br />
<br />
===<code>damageRepeatGroup</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly.<br />
<pre>monsterfire, crystalbossbeam, shockhopper-flamethrower, npcTouchKnockback, largefloorspike, smallfloorspike, guardiandamagebuff</pre><br />
Weapons build their own with<br />
<pre>activeItem.ownerEntityId() .. config.getParameter("itemName") .. activeItem.hand() .. mode</pre><br />
Where "mode" is one of<br />
<pre>primary, alt, hold</pre><br />
<br />
<hr><br />
<br />
===<code>DamageTeam</code>===<br />
JSON object which contains:<br />
*<code>string</code> type<br />
*<code>int</code> team<br />
<br />
<code>type</code> = teamType above. <code>team</code> is used to differentiate multiple groups of the same type.<br />
<br />
<pre>{type = "enemy", team = 2}</pre><br />
<br />
<hr><br />
<br />
===<code>DamageSource</code>===<br />
JSON object which contains:<br />
*<code>List<PolyF></code> poly,<br />
*<code>int</code> damage,<br />
*<code>string</code> teamType,<br />
*<code>string</code> damageType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>int</code> damageRepeatTimeout,<br />
*<code>string</code> damageRepeatGroup<br />
<br />
<pre> {<br />
"poly" : [ [-0.75, 0.5], [0.0, 8.0], [0.75, 0.5] ],<br />
"damage" : 5,<br />
"teamType" : "friendly",<br />
"damageType" : "IgnoresDef",<br />
"damageSourceKind" : "axe",<br />
"damageRepeatTimeout" : 10,<br />
"damageRepeatGroup" : "largefloorspike"<br />
},</pre><br />
<br />
<hr><br />
<br />
===<code>damageRequest</code>===<br />
JSON object which contains at least:<br />
*<code>string</code> damageType,<br />
*<code>int</code> damage or damageDealt,<br />
*<code>entityId</code> sourceEntityId,<br />
And optionally(?)<br />
*<code>entityId</code> targetEntityId,<br />
*<code>Vec2F</code> position,<br />
*<code>int</code> healthLost,<br />
*<code>string</code> hitType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>string</code> targetMaterialKind,<br />
*<code>bool</code> killed<br />
<br />
<pre>{ damageType = "IgnoresDef", damage = 1, sourceEntityId = activeItem.ownerEntityId() }</pre><br />
<pre>{healthLost: 1, damageSourceKind: , sourceEntityId: -65536, hitType: Hit, targetMaterialKind: organic, damageDealt: 1, position: {1: 847.35, 2: 903.7}, targetEntityId: -65536}</pre><br />
<br />
<hr><br />
<br />
===<code>damageNotification</code>===<br />
Probably be the same as damageRequest?<br />
<br />
<hr><br />
<br />
===<code>collisionKinds</code>===<br />
Collision Kind is a case-insensitive <code>string</code> used by the world table's collision check functions. A "CollisionSet" is an array of collisionKinds. For materials, they're defined in their .material file. For metamaterials, they're defined in the /assets/metamaterials.config file.<br />
*<code>Null</code>: For non-loaded areas and some specific metamaterials in vanilla <br />
*<code>None</code>: No collisions<br />
*<code>Block</code>: For block materials <br />
*<code>Platform</code>: For platform materials <br />
*<code>Dynamic</code>: For eg. the light platforms in the Ancient areas, and doors(?) <br />
*<code>Slippery</code>: Vanilla uses it so that the Spike Sphere doesn't attach to materials <br />
<br />
<hr><br />
<br />
===<code>PhysicsForceRegion</code>===<br />
JSON object usually put in an array called <code>forceRegions</code>.<br />
Vanilla currently only uses it for the kluex boss and the guardianminions.<br />
<pre> {<br />
"right" : {<br />
"type" : "RadialForceRegion",<br />
"outerRadius" : 4,<br />
"innerRadius" : 0.5,<br />
"baseTargetRadialVelocity" : -5,<br />
"controlForce" : 100,<br />
"categoryWhitelist" : [ "guardianminion" ]<br />
}<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::Path</code>===<br />
A list of pathfind nodes<br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::PathFinder</code>===<br />
Lua UserData value which can be used for pathfinding over multiple frames. Has the following two methods:<br />
<br />
<li><code>explore([`int` nodeLimit])</code>: Explores the path up to the specified node count limit. Returns `true` if the pathfinding is complete and `false` if it is still incomplete. If nodeLimit is unspecified, this will search up to the configured maximum number of nodes, making it equivalent to world.platformerPathStart</li><br />
<br />
<li><code>result()</code></li>: Returns the completed path.<br />
<br />
<hr><br />
<br />
===<code>imageSet</code>===<br />
JSON object used to define an image<br />
<pre>{<br />
base = "image.png",<br />
hover = "image.png",<br />
pressed = "image.png",<br />
disabled = "image.png",<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>MovementParameters</code>===<br />
A vehicle or projectile's movement parameters, returned by <code>mcontroller.parameters()</code>. Not to be confused with <code>ActorMovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>ActorMovementParameters</code>===<br />
A monster, npc, player(...)'s base movement parameters, returned by <code>mcontroller.baseParameters()</code>. Not to be confused with <code>MovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>directives</code>===<br />
a <code>string</code> defining [http://starbounder.org/Modding:Image_Processing_Directives Image Processing Directives].<br />
<br />
<hr><br />
<br />
===<code>entityType</code>===<br />
A self-explaining <code>string</code> returned by <code>world.entityType()</code> and <code>entity.entityType()</code>:<br />
*<code>player</code><br />
*<code>npc</code><br />
*<code>monster</code><br />
*<code>object</code><br />
*<code>vehicle</code><br />
*<code>itemDrop</code><br />
*<code>projectile</code><br />
*<code>creature</code> ? (seems to be used by switches)<br />
<br />
<hr><br />
<br />
</div><br />
{{Modding}}<br />
__NOTOC__</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Lua/Starbound_Datatypes&diff=181962Modding:Lua/Starbound Datatypes2018-01-29T00:28:46Z<p>😺: Added entityType</p>
<hr />
<div>Starbound makes extensive use of Lua and JSON, and their data types. There are some types that could use some small amount of documentation, and that is the goal of this page.<br />
<br><br />
<br><br />
Note that a JSON array and a Lua array aren't the same. [http://community.playstarbound.com/threads/why-wont-this-work-please-help-me.132290/#post-3148429 This post and the following ones] give some beginner-level differentiation.<br />
<br><br />
<br><br />
<hr><br />
<div id="moddingcode"><br />
===<code>*Id</code>===<br />
These are <code>integers</code>, not to be confused with callable script objects.<br />
<br />
<hr><br />
<br />
===<code>RpcPromise</code>===<br />
Returned by functions requiring asynchronous data, such as world.sendEntityMessage(). It has four methods that can be called to determine its status: <br />
<br />
<li><code>RpcPromiseVariable:finished()</code> returns a boolean indicating whether the promise has finished.</li><br />
<li><code>RpcPromiseVariable:succeeded()</code> returns a boolean indicating whether the promise has succeeded.</li><br />
<li><code>RpcPromiseVariable:result()</code> returns the return value(s) of the called function</li><br />
<li><code>RpcPromiseVariable:error()</code> returns the error string, or nil if no error occured. (Internal radio messages (eg. sendRadioMessage) always return an error, even if they executed properly)</li><br />
<hr><br />
<br />
===<code>liquidLevel</code>===<br />
Surprisingly simple, just the liquid ID and its amount.<br />
*<code>int</code> liquidId<br />
*<code>int</code> amount<br />
<br />
<hr><br />
<br />
===<code>ItemDescriptor</code>=== <br />
JSON object which contains key-value pairs for name and amount, as well as additional parameters:<br />
*<code>string</code> name<br />
*<code>int</code> count<br />
*<code>JSON</code> parameters<br />
If count or parameters is omitted, it seems they'll be considered as 1 and {} respectively.<br />
<br />
<hr><br />
<br />
===<code>Map<EntityId, unsigned></code>===<br />
This bears some small note, to prevent potential confusion. It is a Lua table, not an explicit key-value pair.<br />
<br />
<hr><br />
<br />
===<code>ItemBag</code>===<br />
First noted usage by widget.itemGridItems(String widgetName). this entry needs filling.<br />
<br />
<hr><br />
<br />
===<code>Vec2F</code> and <code>Vec2I</code>===<br />
JSON object which contains <code>x</code> and <code>y</code>.<br />
"I" is for Integer, "F" is for "Float"<br />
<pre>[x = 0, y = 2]</pre><br />
<br />
<hr><br />
<br />
===<code>rectF</code> and <code>rectI</code>===<br />
Json array which contains the top right and bottom left's X and Y coordinates of a rectangle.<br />
"I" is for Integer, "F" is for "Float"<br />
<pre>[-1, -1, 1, 1]</pre><br />
<br />
<hr><br />
<br />
===<code>polyF</code>===<br />
Json array which contains sets of x;y coordinates, forming a polygon's edges.<br />
The last coordinates form a line with the first ones.<br />
<pre>[ [-0.75, -2.0], [-0.35, -2.5], [0.35, -2.5], [0.75, -2.0], [0.75, 0.65], [0.35, 1.22], [-0.35, 1.22], [-0.75, 0.65] ]</pre><br />
<br />
<hr><br />
<br />
===<code>harvestLevel</code>===<br />
Seems to be the poor man's boolean, where 0 = false and 1 = true?<br />
<br />
<hr><br />
<br />
===<code>teamType</code>===<br />
Case-insensitive <code>string</code> used to define things like who can damage who. Vanilla types:<br />
*<code>friendly</code>: (players, non-agressive NPCs, pets...)<br />
*<code>enemy</code>: (monsters, agressive NPCs...)<br />
*<code>passive</code>: (critters...)<br />
*<code>ghostly</code>: Cannot be hit, unaffected by terrain hazards<br />
*<code>assistant</code>: (Glitch mission's castle friendly NPC (castle archers, nuru...))<br />
*<code>Environment</code>: (volcanic trap...)<br />
*<code>indiscriminate</code>: able to hit anything regardless of their damageTeam (traps...)<br />
*<code>pvp</code>: pvp-enabled players<br />
<br />
<hr><br />
<br />
===<code>damageType</code> and <code>tileDamageType</code>===<br />
Case-insensitive <code>string</code>:<br />
*<code>blockish</code>: damages to blocks<br />
*<code>plantish</code>: damages to plants<br />
*<code>beamish</code>: Used by the pickslash weaponability<br />
*<code>explosive</code>: Used by the meteor explosions<br />
*<code>fire</code>: <br />
*<code>tilling</code>: <br />
*<code>damage</code>: <br />
*<code>knockback</code>: used by shields<br />
*<code>Environment</code>: <br />
*<code>IgnoresDef</code>: Ignores the target's protection stat.<br />
*<code>NoDamage</code>: <br />
<br />
<hr><br />
<br />
===<code>damageSourceKind</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly. Might be to define which sound to play? Vanilla ones:<br />
<pre>applystatus, axe, bite, broadsword, bugnet, dagger, default, electric, electricbroadsword, electricfist, electrichammer, electricplasma, falling, fire, firebroadsword, firehammer, fireplasma, fist, fiststrong, foldingchair, fryingpan, gnomebeam, hammer, hidden, ice, icehammer, iceplasma, nodamage, plasma, poison, poisondagger, poisonhammer, poisonlash, poisonplasma, sawblade, shield, shortsword, slash, spear, standardbullet</pre><br />
<br />
<hr><br />
<br />
===<code>damageRepeatGroup</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly.<br />
<pre>monsterfire, crystalbossbeam, shockhopper-flamethrower, npcTouchKnockback, largefloorspike, smallfloorspike, guardiandamagebuff</pre><br />
Weapons build their own with<br />
<pre>activeItem.ownerEntityId() .. config.getParameter("itemName") .. activeItem.hand() .. mode</pre><br />
Where "mode" is one of<br />
<pre>primary, alt, hold</pre><br />
<br />
<hr><br />
<br />
===<code>DamageTeam</code>===<br />
JSON object which contains:<br />
*<code>string</code> type<br />
*<code>int</code> team<br />
<br />
<code>type</code> = teamType above. <code>team</code> is used to differentiate multiple groups of the same type.<br />
<br />
<pre>{type = "enemy", team = 2}</pre><br />
<br />
<hr><br />
<br />
===<code>DamageSource</code>===<br />
JSON object which contains:<br />
*<code>List<PolyF></code> poly,<br />
*<code>int</code> damage,<br />
*<code>string</code> teamType,<br />
*<code>string</code> damageType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>int</code> damageRepeatTimeout,<br />
*<code>string</code> damageRepeatGroup<br />
<br />
<pre> {<br />
"poly" : [ [-0.75, 0.5], [0.0, 8.0], [0.75, 0.5] ],<br />
"damage" : 5,<br />
"teamType" : "friendly",<br />
"damageType" : "IgnoresDef",<br />
"damageSourceKind" : "axe",<br />
"damageRepeatTimeout" : 10,<br />
"damageRepeatGroup" : "largefloorspike"<br />
},</pre><br />
<br />
<hr><br />
<br />
===<code>damageRequest</code>===<br />
JSON object which contains at least:<br />
*<code>string</code> damageType,<br />
*<code>int</code> damage or damageDealt,<br />
*<code>entityId</code> sourceEntityId,<br />
And optionally(?)<br />
*<code>entityId</code> targetEntityId,<br />
*<code>Vec2F</code> position,<br />
*<code>int</code> healthLost,<br />
*<code>string</code> hitType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>string</code> targetMaterialKind,<br />
*<code>bool</code> killed<br />
<br />
<pre>{ damageType = "IgnoresDef", damage = 1, sourceEntityId = activeItem.ownerEntityId() }</pre><br />
<pre>{healthLost: 1, damageSourceKind: , sourceEntityId: -65536, hitType: Hit, targetMaterialKind: organic, damageDealt: 1, position: {1: 847.35, 2: 903.7}, targetEntityId: -65536}</pre><br />
<br />
<hr><br />
<br />
===<code>damageNotification</code>===<br />
Probably be the same as damageRequest?<br />
<br />
<hr><br />
<br />
===<code>collisionKinds</code>===<br />
Collision Kind is a case-insensitive <code>string</code> used by the world table's collision check functions. A "CollisionSet" is an array of collisionKinds. For materials, they're defined in their .material file. For metamaterials, they're defined in the /assets/metamaterials.config file.<br />
*<code>Null</code>: For non-loaded areas and some specific metamaterials in vanilla <br />
*<code>None</code>: No collisions<br />
*<code>Block</code>: For block materials <br />
*<code>Platform</code>: For platform materials <br />
*<code>Dynamic</code>: For eg. the light platforms in the Ancient areas, and doors(?) <br />
*<code>Slippery</code>: Vanilla uses it so that the Spike Sphere doesn't attach to materials <br />
<br />
<hr><br />
<br />
===<code>PhysicsForceRegion</code>===<br />
JSON object usually put in an array called <code>forceRegions</code>.<br />
Vanilla currently only uses it for the kluex boss and the guardianminions.<br />
<pre> {<br />
"right" : {<br />
"type" : "RadialForceRegion",<br />
"outerRadius" : 4,<br />
"innerRadius" : 0.5,<br />
"baseTargetRadialVelocity" : -5,<br />
"controlForce" : 100,<br />
"categoryWhitelist" : [ "guardianminion" ]<br />
}<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::Path</code>===<br />
A list of pathfind nodes<br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::PathFinder</code>===<br />
Lua UserData value which can be used for pathfinding over multiple frames. Has the following two methods:<br />
<br />
<li><code>explore([`int` nodeLimit])</code>: Explores the path up to the specified node count limit. Returns `true` if the pathfinding is complete and `false` if it is still incomplete. If nodeLimit is unspecified, this will search up to the configured maximum number of nodes, making it equivalent to world.platformerPathStart</li><br />
<br />
<li><code>result()</code></li>: Returns the completed path.<br />
<br />
<hr><br />
<br />
===<code>imageSet</code>===<br />
JSON object used to define an image<br />
<pre>{<br />
base = "image.png",<br />
hover = "image.png",<br />
pressed = "image.png",<br />
disabled = "image.png",<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>MovementParameters</code>===<br />
A vehicle or projectile's movement parameters, returned by <code>mcontroller.parameters()</code>. Not to be confused with <code>ActorMovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>ActorMovementParameters</code>===<br />
A monster, npc, player(...)'s base movement parameters, returned by <code>mcontroller.baseParameters()</code>. Not to be confused with <code>MovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>directives</code>===<br />
a <code>string</code> defining [http://starbounder.org/Modding:Image_Processing_Directives Image Processing Directives].<br />
<br />
<hr><br />
<br />
===<code>entityType</code>===<br />
A self-explaining <code>string</code> returned by <code>world.entityType()</code> and <code>entity.entityType()</code>:<br />
*<code>player</code><br />
*<code>npc</code><br />
*<code>monster</code><br />
*<code>object</code><br />
*<code>vehicle</code><br />
*<code>itemDrop</code><br />
*<code>creature</code> ? (seems to be used by switches)<br />
<br />
<hr><br />
<br />
</div><br />
{{Modding}}<br />
__NOTOC__</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Lua/Hooks/Monster&diff=181785Modding:Lua/Hooks/Monster2017-12-14T16:07:02Z<p>😺: added interact()</p>
<hr />
<div><div style="float:right;">__TOC__</div><br />
= Description =<br />
<br />
These monster hooks are stubs for global functions that monster scripts can define, which will be called by the C++ engine. Documentation for it was removed from the assets, but an old and outdated (2015) version can be found here: https://pastebin.com/cuAdqBtV<br />
<br />
= Hooks =<br />
==init()==<br />
Called (once) after the monster is added to the world. Note that the monster's position may not yet be valid<br />
<br />
==update(dt)==<br />
Update loop handler.<br /><br />
Called once every scriptDelta (defined in *.monstertype) ticks<br />
<br />
==interact(args)==<br />
Not tested, but probably works the same way [[Modding:Lua/Hooks/Object#onInteraction.28args.29|object's onInteract()]] works.<br />
<br />
==damage(args)==<br />
Called after the monster has taken damage.<br /><br />
'args' is a map of info about the damage, structured as:<br />
{<br />
sourceId = <entity id of entity that caused the damage>,<br />
damage = <numeric amount of damage that was taken>,<br />
sourceDamage = <numeric amount of damage that was originally dealt>,<br />
sourceKind = <string kind of damage being applied, as defined in "damageKind" value in a *.projectile config><br />
}<br />
Note that "sourceDamage" can be higher than "damage" if - for instance - some damage was blocked by a shield.<br />
<br />
==shouldDie()==<br />
Called each update to determine if the monster should die. If not defined in the monster's lua, will default to returning true when the monster's health has been depleted.<br />
<br />
Returns boolean - true if the monster can die, false to keep the monster alive<br />
<br />
==die()==<br />
Called when shouldDie has returned true and the monster and is about to be removed from the world<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding_talk:Metadata_file&diff=181781Modding talk:Metadata file2017-12-14T04:28:49Z<p>😺: /* Quotation marks around steamContentId's key */</p>
<hr />
<div>Updated some grammar and repositioned a topic for continuity's sake. <br />
TODO: create and link to Mod Uploader Tool for Windows, and create steamCMD instructions for linux/MacOS. Will of course borrow from The Suit https://community.playstarbound.com/threads/manually-uploading-to-steam-workshop-with-linux-and-mac-and-windows.118872/<br />
[[User:JustJinxed|JustJinxed]] ([[User talk:JustJinxed|talk]]) 05:18, 3 November 2017 (UTC)<br />
<br />
== Quotation marks around steamContentId's key ==<br />
<br />
>(Fixed not having quotation marks around 000000001 when there should be.)<br />
<br><br />
I don't think this is actually required; <code>000000001</code> is interpreted as a number, while <code>"000000001"</code> is interpreted as a string. Conversions are probably done if necessary.<br />
----</div>😺https://starbounder.org/mediawiki/index.php?title=Modding_talk:Metadata_file&diff=181780Modding talk:Metadata file2017-12-14T04:28:06Z<p>😺: /* Quotation marks around steamContentId's key */ new section</p>
<hr />
<div>Updated some grammar and repositioned a topic for continuity's sake. <br />
TODO: create and link to Mod Uploader Tool for Windows, and create steamCMD instructions for linux/MacOS. Will of course borrow from The Suit https://community.playstarbound.com/threads/manually-uploading-to-steam-workshop-with-linux-and-mac-and-windows.118872/<br />
[[User:JustJinxed|JustJinxed]] ([[User talk:JustJinxed|talk]]) 05:18, 3 November 2017 (UTC)<br />
<br />
== Quotation marks around steamContentId's key ==<br />
<br />
>(Fixed not having quotation marks around 000000001 when there should be.)<br />
I don't think this is actually required; <code>000000001</code> is interpreted as a number, while <code>"000000001"</code> is interpreted as a string. Conversions are probably done if necessary.</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Metadata_file&diff=181779Modding:Metadata file2017-12-14T04:24:36Z<p>😺: minor writing edits, fixed example missing a comma, added mention that steamContentId's key can be or not be quoted, added entry in the table for the tags key</p>
<hr />
<div>The metadata file replaces the [MODNAME].modinfo file as of version 1.0 (Cheerful Giraffe, released July 22nd, 2016)<ref>https://www.reddit.com/r/starbound/comments/4smkzj/2_quick_tips_about_mod_formats_for_unstable/</ref>. It's an entirely optional [[Modding:JSON|JSON]] file that contains a set of entirely optional parameters.<br />
<ref>http://community.playstarbound.com/threads/modding-for-1-0.117818/#post-2956738 <br />
The | Suit, Jul 22, 2016</ref>.<br />
<br />
The metadata file can be named either <code>_metadata</code> or <code>.metadata</code><ref>http://community.playstarbound.com/threads/how-do-we-format-metadata-files.118150/#post-2957094 <br />
The | Suit, Jul 22, 2016</ref> and is placed at the root of a mod's folder. <br />
<br />
(Note: Windows generally takes issue with any file that starts with a period. It's been suggested to either use <code>_metadata</code> for the filename, or name it <code>.metadata.</code> <ref>http://i.imgur.com/PyNZqbg.gif</ref> Windows will strip the trailing period.<br />
<br />
If you are using Steam for windows, you can upload a mod using the Mod Uploader Tool. This will automatically generate a metadata file for you. Simply click the normal play from Stream, and select the "Launch Mod Uploader Tool" and follow along with the instructions.<br />
<br />
The metadata file contains general information about the mod, much of which will be displayed in mod's information section via the mod list on the Starbound title screen. (Note: parameter order doesn't matter, and that '''each parameter is optional'''; Starbound will load just fine without it. You could for example create a metadata file that only contained an author parameter, or a metadata file that included every parameter except a version number. If you don't need a parameter, don't include it. However, for the sake of releasing mods on Steam, it's strongly suggested you set the name, friendlyname, description and version parameters. <br />
<br />
Here's an example of a metadata file that includes every parameter: <pre><br />
{<br />
"name" : "coolmod",<br />
"friendlyName" : "Cool mod",<br />
"description" : "This a cool mod!",<br />
"author" : "XxX-Cool mod Creator-XxX",<br />
"version" : "2.00 Alpha Gold",<br />
"link" : "http://example.com/coolmod",<br />
"steamContentId" : "000000001",<br />
"tags" : "Crafting and Building|Weapons|Armor and Clothes",<br />
"includes" : ["coolmodv1"],<br />
"requires" : ["anothermod", "coolmod2"],<br />
"priority" : 0<br />
}</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! Entry !! Description<br />
|-<br />
| <tt>name</tt> || The "behind the scenes" name that is used by other mods. The "requires" and "includes" use this parameter.<br />
|-<br />
| <tt>friendlyName</tt> || The name that'll show up mostly everywhere else.<br />
|-<br />
| <tt>description</tt> || The description of the mod.<br>Type '\n' for a new line, and escape quotations with a \, such as <pre>"description" : "This mod is \"cool\", if you know what I mean.\n:)"</pre><br />
|-<br />
| <tt>author</tt> || The author of the mod.<br />
|-<br />
| <tt>version</tt> || The version of the mod.<br />
|-<br />
| <tt>link</tt> || An URL that links to the mod. (Steam Workshop URL, Chucklefish Forum, Github, yourwebsite.net, etc)<br />
|-<br />
| <tt>steamContentId</tt> || The workshop's unique id that steam uses. The Mod Uploader Tool available with Starbound's Steam version will fill this in automatically. Can be quoted (string) or not (number).<br />
|-<br />
| <tt>tags</tt> || The workshop's tags this mod is classified as that steam uses. The Mod Uploader Tool offers a list of tags to select from.<br />
|-<br />
| <tt>includes</tt> || Any mods listed here will be loaded before this mod, if they exist. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>requires</tt> || Any mods listed here will be '''required''', will be loaded before this mod, and the game will error at startup if these mods aren't present. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>priority</tt> || The lower the number, the sooner it'll be loaded<ref>https://steamcommunity.com/app/211820/discussions/4/353916838209436654/#c355043117501118531 Mod Load Order, 17 Aug, 2016</ref>. The base assets.pak has a priority of -9999. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
|}<br />
<br />
<noinclude>{{Modding}} {{Category:Modding:Documentation}}</noinclude></div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Lua/Libraries&diff=176245Modding:Lua/Libraries2017-07-05T23:27:16Z<p>😺: Added updated penguinGUI and stardustLib</p>
<hr />
<div>= Libraries =<br />
<noinclude>{{Stub|Can these pages actually be FILLED with content?}}</noinclude><br />
<br />
These are libraries containing "utilitary" functions and scripts, for coding convenience.<br />
<br />
Starbound already provides a bunch in /scripts/<br />
<br />
<br />
----<br />
<includeonly>{{Modding:Lua/Libraries/.Nav}}</includeonly><br />
- [http://community.playstarbound.com/resources/library-tech-keybinds.3558/ Tech Keybinds] is ''an easy to use library that allows tech modders to bind input values to functions.''<br />
<br />
- [https://github.com/StormyUK/Macrochip/tree/master/scripts/Storm_UI Storm_UI] is used by StormyUK for his [http://steamcommunity.com/sharedfiles/filedetails/?id=729444820 Macrochip] mod's U.I.<br />
<br />
- [http://community.playstarbound.com/resources/penguintoasts-penguingui-updated-to-work-in-1-3.4759 PenguinToast's PenguinGUI] is a pretty old library to make custom U.I.s updated for 1.3 (original version and infos can be found [http://penguintoast.github.io/PenguinGUI/index.html here].)<br />
<br />
- [https://github.com/zetaPRIME/sb.StardustSuite/tree/master/StardustLib/lib/stardust StardustLib] is a bunch of scripts zetaPRIME uses for his [https://github.com/zetaPRIME/sb.StardustSuite StardustSuite] mod.<br />
<noinclude>{{Modding}}</noinclude></div>😺https://starbounder.org/mediawiki/index.php?title=Modding:JSON/Variables/Panes_(GUI)&diff=173986Modding:JSON/Variables/Panes (GUI)2017-06-06T14:24:02Z<p>😺: /* ProgressBarWidget */ more infos on progressSet</p>
<hr />
<div>{{WorkInProgress}}<br />
Interface descriptions are also stored in JSON, found in the [[Data:Assets/interface|assets/interface]] folder. Note that some of those are hardcoded (namely assets/interface/windowconfig) - you can modify parameters at your own risk but adding more scripts/callbacks to those is impossible.<br />
<p>Interfaces can be of several types, including CraftingPanes, ContainerPanes ([[Modding:Lua/Tables/Containerpane|ContainerPane Lua functions]]) and ScriptPanes ([[Modding:Lua/Tables/Scriptpane|ScriptPane Lua functions]]). The "pane" is basically a in-game window, usually consisting of a background and some window elements (widgets - [[Modding:Lua/Tables/Widget|Widget Lua functions]]). Their syntax is more or less the same.</p><br />
In-window coordinates are always counted from down-left corner (zero). Window size is limited by its background (if the header and footer are present, they are considered part of the background).<br />
__TOC__<br />
==All widgets==<br />
These parameters are the same for all widgets (with few exceptions).<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string||Type of the widget dependent on this. See below.<br />
|- <br />
|position||yes||Vec2F||Position in pixels [x, y]. Counted from down-left corner (header+background+footer).<br />
Background doesn't have it.<br />
|- <br />
|zlevel||no||int||Layer. The window is drawn from negative layers to positive. Widgets with higher zlevel will overlap the rest.<br />
Default: '''0'''.<br />
|- <br />
|disabled||no||bool||Defines if a widget can be used (for active widgets with callbacks). Disabled buttons are grayed out.<br />
Default: '''false'''.<br />
|- <br />
|data||no||string|| Data readable via '''widget.getData()''' and writable via '''widget.setData()'''. Default: '''nil'''.<br />
|- <br />
|visible||no||bool||Defines if a widget is visible. Default: '''true'''.<br />
|- <br />
|mouseTransparent||no||bool|| Determines if the gui will ignore this widget when toggling mouseover effects. Useful on labels and images that are displayed over interactive widgets such as buttons and radio groups. Default: '''false'''.<br />
|}<br />
<br />
==Background==<br />
Background is the base of your pane. Window size depends on it. Note that background doesn't have position parameter as it always occupies the whole window. It, however, can be semi-transparent or have transparent parts.<br />
Background is rendered in the following order: header, body, footer. It's best to declare it at the top of your interface.<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string||Always ''background''. '''Required'''<br />
|- <br />
|fileHeader||no||string||Header image path. Must be absolute.<br />
|- <br />
|fileBody||yes||string||Body image path. Must be absolute.<br />
|- <br />
|fileFooter||no||string||Footer image path. Must be absolute.<br />
|}<br />
<br />
==LabelWidget==<br />
A simple text label.<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string ||Always ''label''. '''Required'''<br />
|- <br />
|value||yes||string||Label text. Can be an empty string or include \n to start a new line.<br />
|- <br />
|hAnchor||no||string||''left'', ''mid'' or ''right''. Horisontal text alignment.<br />
|- <br />
|vAnchor||no||string||''top'', ''mid'' or ''bottom''. Vertical text alignment.<br />
|- <br />
|color||no||string||Text color in HTML format #NNNNNN, color name (for named colors) or Vec3I ([R, G, B]). White by default.<br />
You can also apply color in the value itself (or to the part of the value) as a pre-directive, format ^#NNNNNN;text. The text before the directive will use ''color'' if it is available.<br />
|- <br />
|wrapWidth||no||int||Max label width ''in pixels''. If label text is bigger than that, it will be "wrapped" using "line feed", automatically making two-line etc labels as required. The game first tries breaking the text on spaces. If the resulting substrings still don't fit into target width they are further broken between characters.<br />
Useful when using LabelWidget inside ScrollAreaWidget.<br />
|-<br />
|fontSize||no||float||Size usually increases/decreases in 0.3 increments.<br />
|}<br />
====Example====<br />
<pre>"ra_lblTemplate" : {<br />
"type" : "label",<br />
"position" : [207, 189],<br />
"hAnchor" : "mid",<br />
"value" : "Template"<br />
}</pre><br />
<br />
==TitleWidget==<br />
==ButtonWidget==<br />
Buttons can have "pressed" images, using them when, well, pressed, or pressedOffset, imitating button shifting when pressed.<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string ||Always ''button''. '''Required'''<br />
|- <br />
|base||||string||Button image path when idle.<br />
|- <br />
|hover||||string||Button image path on hover.<br />
|- <br />
|pressed||||string||Button image path when pressed.<br />
|- <br />
|disabledImage||||string||Button image path when disabled.<br />
|- <br />
|pressedOffset||no||Vec2F||Button moves [x,y] inside the window when pressed.<br />
|- <br />
|caption||no||string||Text on the button.<br />
|- <br />
|fontColor||no||||Color of the caption.<br />
|- <br />
|fontColorDisabled||no||||Color of the caption when the button is disabled.<br />
|- <br />
|textAlign||no||||"left", "mid" or "right". Caption alignment.<br />
|- <br />
|textOffset||no||Vec2I||Caption offset (based on align).<br />
|- <br />
|callback||no||string||Name of the function called on click. Defaults to button's '''name'''.<br />
|}<br />
===CheckBoxWidget===<br />
Any button can be made into a checkbox. A checkbox is essentially a button that can be toggled on/off. In addition to standart button properties, it has these:<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|checkable||yes||bool||Always ''true''. '''Required'''. This is what makes a button a checkbox.<br />
|- <br />
|checked||||bool||Checkbox state.<br />
|- <br />
|baseImageChecked||||string||Checkbox image path when toggled on.<br />
|- <br />
|hoverImageChecked||||string||Checkbox image path when toggled on and on hover.<br />
|}<br />
<br />
==TextBoxWidget==<br />
This widget's functions are what you would expect from your usual textbox. It is used for user text input - with some nuances.<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string ||Always ''textbox''. '''Required'''<br />
|- <br />
|regex||no||string||If present, it limits characters input by ''regular expression''. For example, a textbox with regex of "[a-zA-Z0-9 ]{0,30}" allows a text of 30 characters limited to English lowercase and uppercase letters, digits and a [Space] symbol. You can use online regex parsers like https://regex101.com/ to test your expression.<br />
|- <br />
|maxWidth||no||int||Maximal visible width of the textbox in pixels. Defines the amount of text visible to user. The user can still navigate the string using the keyboard cursor buttons even if the text does not "fit" into the textbox.<br />
|- <br />
|focus||no||bool||Defines if the user is "focused" on the textbox. Focus being "true" means the input cursor inside the textbox is active, and keyboard input will result in new text.<br />
|- <br />
|escapeKey||no||string||Function which is called when a player hits [Esc] while being in a textbox with '''focus = true'''. (Pressing [Esc} with focus = false usually results in current in-game window being closed)<br />
|- <br />
|enterKey||no||string||Function which is called when a player hits [Esc] while being in a textbox. Focus is '''not required'''.<br />
|- <br />
|callback||no||string||Function called on left click on the textbox. Usually you need this set to "null" is you want a left click to activate the textbox input cursor.<br />
|- <br />
|hint||no||string||Hint for input which is shown in grey letters when the textbox does not contain user text.<br />
|}<br />
<br />
==ImageWidget==<br />
You may want to use [[Modding:Image_Processing_Directives|Image post-processing directives]]<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string ||Always ''image''. '''Required'''<br />
|- <br />
|file||||string||Image path.<br />
|- <br />
|centered||no||bool||<br />
|- <br />
|trim||no||bool||<br />
|}<br />
<br />
==CanvasWidget==<br />
<br />
Not necessarily a "functional" widget in the sense that this widget needs to be outside of the "gui" table to function correctly. For more information, take a look at the easel, fossil tool, and Mazebound64 ScriptCanvas's.<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string ||Always ''canvas''. '''Required'''<br />
|- <br />
|rect||yes||Vec4I||Bounding rectangle, [xmin, ymin, xmax, ymax].<br />
|- <br />
|captureMouseEvents||||bool||<br />
|}<br />
<br />
==ItemGridWidget==<br />
A grid of slots for putting items in. Typically can be seen in containers or different kinds.<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string||Always ''itemgrid''. '''Required'''.<br />
|- <br />
|dimensions||yes||Vec2I||"Size" of the itemgrid in slots, [x,y]. An itemgrid of [2,3] will have 2 columns of 3 slots each.<br />
|- <br />
|spacing||yes||Vec2I||<br />
|- <br />
|slotOffset||no||int||If you have 2 itemgrids or more, you can set an offset for 2nd itemgrid here to prevent itemgrids from "overlapping". Example: if you have 2 slots in itemGrid and 4 slots in itemGrid2, you can set slotOffset for itemGrid2 to 2 (its slots' numeration will thus skip 1-2 and proceed with 3-6).<br />
|- <br />
|backingImage||no||string||Path to background image for each slot.<br />
|- <br />
|callback||no||string||Name of the function called on ''left'' click. Warning! If you add this property, putting items with ''left'' click will be impossible (callback replaces default slot functionality).<br />
|- <br />
|rightClickCallback||no||string||Name of the function called on ''right'' click. Warning! If you add this property, putting items with ''right'' click will be impossible (callback replaces default slot functionality).<br />
|}<br />
<br />
''Note: adding both callback and rightClickCallback makes the itemgrid impossible to use normally (you won't be able to put/pick items manually).''<br />
<br />
==ItemSlotWidget==<br />
<br />
90% of this widget was made for engine only callbacks, as it is used in the player inventory pane. That being said, it can be used as a quick way to mimic a container slot via the use of "widget.setItemSlotItem(`Json` itemDescriptor)" and for non-container ScriptPanes.<br />
<br />
Unlike actual container slots, hovering over a filled itemSlot will not automatically show a popup window with the itemDescription and trying to place items into the itemslot will only call the widget's callback.<br />
<br />
Take a look at the interaction menu provided by the ancient vault key trader for a good example. He is the robed guy that wanders around the balcony just above the 2StopTeleshop.<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string ||Always ''itemslot''. '''Required'''<br />
|- <br />
|position||yes||Vec2I|| [x, y].<br />
|- <br />
|backingImage||yes||String|| Absolute image path to an image file. This parameter works in the same manner as the one used in a button widget.<br />
|- <br />
|callback||yes||String|| Callback when left-clicking the itemSlot. The widgetName is passed as a argument.<br />
|- <br />
|rightClickCallback||yes||String|| Callback when right-clicking the itemSlot. The widgetName is passed to the callback function as an argument.<br />
|- <br />
|iconMode||no||Boolean|| Not sure if this is used, may be an internal thing.<br />
|- <br />
|showBackingImageWhenFull||no||Boolean|| Not sure if this is used either, again, may be an internal thing.<br />
|}<br />
<br />
==RadioGroupWidget==<br />
A grouped collection of selectable buttons. At most, only one button can be selected at the same time.<br />
:[[File:GUI-RadioGroupWidget.png]]<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string||Always ''radioGroup''. '''Required'''<br />
|- <br />
|toggleMode||no||boolean||Value indicating whether the selected button can be deselected by clicking on it again. Defaults to false.<br />
|- <br />
|callback||no||string||The name of the function to call when a button has been (de)selected. The same function should be defined in the '''scriptWidgetCallbacks''' array. Default to the name of the widget.<br />
|- <br />
|buttons||yes||array||Collection of buttons that belong in the radio group. The parameters of each button are described below. '''Required'''<br />
|}<br />
Button parameters:<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|id||no||int|| While not mandatory, setting the id with the index position of the button array (base 0) will change the radiogroup widget's behavior.<br />
Callback functions will pass in this argument, along with the radioGroup name. You will be able to access each button widget directly via a json path. See example for more information.<br />
|- <br />
|baseImage||yes||string||Button image path when not selected. Not required, but the button is invisible unless a value is set.<br />
|- <br />
|hoverImage||no||string||Button image path when not selected and hovered over.<br />
|- <br />
|baseImageChecked||no||string||Button image path when selected.<br />
|- <br />
|hoverImageChecked||no||string||Button image path when selected and hovered over.<br />
|- <br />
|pressedOffset||no||Vec2F||Offset to the default position while the button is pressed. If no '''baseImageChecked''' is set this offset persists until the button is deselected. Defaults to [1,-1].<br />
|- <br />
|position||no||Vec2F||Position of the button relative to the radio group. Defaults to [0, 0].<br />
|- <br />
|selected||no||boolean||Value indicating whether this button is selected by default. If multiple buttons have this value set true, no button will be selected. Defaults to false.<br />
|- <br />
|visible||no||boolean||Value indicating whether this button is visible. Defaults to true.<br />
|}<br />
====Example====<br />
<pre>"sampleRadioGroup" : {<br />
"type": "radioGroup",<br />
"toggleMode": true,<br />
"callback": "radioGroupCallback",<br />
"position": [<br />
100,<br />
100<br />
],<br />
"zlevel": 1,<br />
"buttons": [<br />
{<br />
"id" : 0,<br />
"baseImage": "/interface/crafting/items.png",<br />
"hoverImage": "/interface/crafting/items.png?brightness=30",<br />
"baseImageChecked": "/interface/crafting/itemsSelected.png",<br />
"hoverImageChecked": "/interface/crafting/itemsSelected.png?brightness=30",<br />
"pressedOffset": [ 0, -1 ],<br />
"selected": true<br />
},<br />
{<br />
"id" : 1,<br />
"baseImage": "/interface/crafting/main.png",<br />
"hoverImage": "/interface/crafting/main.png?brightness=30",<br />
"baseImageChecked": "/interface/crafting/mainSelected.png",<br />
"hoverImageChecked": "/interface/crafting/mainSelected.png?brightness=30",<br />
"pressedOffset": [ 0, -1 ],<br />
"position": [ 19, 0 ]<br />
}<br />
]<br />
}</pre><br />
<br />
'''Note:'''RadioGroup widget buttons, with defined id's, are viewed as ButtonWidgets. Therefore certain widget functions that modify the visuals of ButtonWidgets will work on a button in a radiogroup. Access each button by using the json path : "<'string' radiogroupWidgetName>.<'string' id>".<br />
<br />
Using the example config above, this lua function will change the overlay image of both buttons in "sampleRadioGroup":<br />
<pre><br />
function changeButtonImages()<br />
widget.setButtonOverlayImage("sampleRadioGroup.0", "/images/image.png")<br />
widget.setButtonOverlayImage("sampleRadioGroup.1", "/images/image2.png")<br />
end<br />
</pre><br />
<br />
'''Note:''' Strangely<code>Widget.setSelectedOption("sampleRadioGroup", 0)</code> '''DOES NOT''' select the button with <code>"id" : 0</code>, but rather it will select the second button in the "buttons" array.<br />
<code>Widget.setSelectedOption("sampleRadioGroup", -1)</code> will properly select the first button in the array. (its super weird)<br />
<br />
==ScrollAreaWidget==<br />
An empty widget of a predefined size with a scroll bar to the right side. If content exceeds the height of the widget the scroll bar becomes active, allowing you to scroll up and down. The scroll area is limited to having a vertical scroll bar; a horizontal scroll bar can not be added.<br />
<br />
The scroll area will automatically adjust the positions of all widgets to leave as little padding as possible. This means increasing the vertical position of '''all''' your widgets by 100 does not result in any changes.<br />
<br />
To reference any ScrollArea children widgets in Lua scripts (widget.* table) use the following format: <ScrollArea name>.<Children widget name>.<br />
<br />
:[[File:GUI-ScrollAreaWidget.png]]<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string||Always ''scrollArea''. '''Required'''<br />
|- <br />
|rect||no||Vec4F||Array of four numbers, indicating the bottom, left, top and right bound of the scroll area. Not required, but the scroll area won't show up if no value is set.<br />
|- <br />
|buttons||no||table||You can use this custom table to override default buttons. See below.<br />
|- <br />
|thumbs||no||table||You can use this custom table to override default thumbs (scrollers). See below.<br />
|- <br />
|children||no||table||Table of widgets. Not required, but not having any widgets renders the scroll area useless.<br />
|}<br />
<br />
Syntax for ''buttons'' override table for ScrollArea.<br />
If you override default buttons with this table ALL buttons are mandatory (even the unused horizontal ones), otherwise your pane will throw a <code>(JsonException) No such key in Json</code> exception. Seems like reading all the buttons is hardcoded in the game.<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|horizontal||yes||table||Includes overrides for "forward" and "backward" buttons. '''Required'''<br />
|- <br />
|horizontal/forward||yes||table||A table similar to that of a ButtonWidget. ''base'', ''hover'' and ''pressed'' parameters are '''mandatory''' (the paths can be empty strings).<br />
|- <br />
|horizontal/backward||yes||table||<br />
|- <br />
|vertical||yes||table||Includes overrides for "forward" and "backward" buttons. '''Required'''<br />
|- <br />
|vertical/forward||yes||table||<br />
|- <br />
|vertical/backward||yes||table||<br />
|}<br />
<br />
Syntax for ''thumbs'' (scrollers) override table for ScrollArea.<br />
If you override default thumbs with this table ALL parameters are mandatory (even the unused horizontal ones), otherwise your pane will throw a <code>(JsonException) No such key in Json</code> exception. <br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|horizontal||yes||table||Includes overrides for the unused horizontal scroller. '''Required'''<br />
|- <br />
|horizontal/base||yes||table||A table containing ''begin'', ''end'' and ''inner'' parameters for an unused horizontal scroller. All are '''mandatory''' and should hold parts if a scroller (since the scroller is a composite object the game authomatically readjusts its length as necessary). Paths can be empty.<br />
|- <br />
|horizontal/hover||yes||table||<br />
|- <br />
|horizontal/pressed||yes||table||<br />
|- <br />
|vertical||yes||table||Includes overrides for the vertical scroller. '''Required'''<br />
|- <br />
|vertical/base||yes||table||See horizontal/base<br />
|- <br />
|vertical/hover||yes||table||<br />
|- <br />
|vertical/pressed||yes||table||<br />
|- <br />
|}<br />
<br />
Thumbs (scrollers) and buttons can be overridden separately (i.e. you don't have to add both tables at once).<br />
====Example====<br />
<pre>"sampleScrollArea" : {<br />
"type": "scrollArea",<br />
"zlevel": 1,<br />
"rect": [<br />
100,<br />
40,<br />
200,<br />
80<br />
],<br />
"children": {<br />
"topLabel": {<br />
"type" : "label",<br />
"position" : [50, 60],<br />
"value" : "Top!"<br />
},<br />
"bottomLabel": {<br />
"type" : "label",<br />
"position" : [50, 0],<br />
"value" : "Bottom!"<br />
}<br />
}<br />
}</pre><br />
<br />
====Example with buttons/thumbs override===<br />
This setting uses recolored green buttons and thumbs (like those in the list of planet bookmarks). "Children" table is empty for the sake of simplicity.<br />
<br />
<pre>"SampleScrollArea" : {<br />
"type" : "scrollArea",<br />
"rect" : [6, 28, 123, 57],<br />
"buttons" : {<br />
"horizontal" : {<br />
"forward" : { "base" : "", "hover" : "", "pressed" : "" },<br />
"backward" : { "base" : "", "hover": "", "pressed" : "" }<br />
},<br />
"vertical" : {<br />
"forward" : {<br />
"base" : "/interface/bookmarks/scrollarea/varrow-forward.png",<br />
"hover" : "/interface/bookmarks/scrollarea/varrow-forwardhover.png",<br />
"pressed" : ""<br />
},<br />
"backward" : {<br />
"base" : "/interface/bookmarks/scrollarea/varrow-backward.png",<br />
"hover" : "/interface/bookmarks/scrollarea/varrow-backwardhover.png",<br />
"pressed" : ""<br />
}<br />
}<br />
},<br />
"thumbs" : {<br />
"horizontal" : {<br />
"base" : { "begin" : "", "end" : "", "inner" : "" },<br />
"hover" : { "begin" : "", "end" : "", "inner" : "" },<br />
"pressed" : { "begin" : "", "end" : "", "inner" : "" }<br />
},<br />
"vertical" : {<br />
"base" : {<br />
"begin" : "/interface/bookmarks/scrollarea/vthumb-begin.png",<br />
"end" : "/interface/bookmarks/scrollarea/vthumb-end.png",<br />
"inner" : "/interface/bookmarks/scrollarea/vthumb-inner.png"<br />
},<br />
"hover" : {<br />
"begin" : "/interface/bookmarks/scrollarea/vthumb-beginhover.png",<br />
"end" : "/interface/bookmarks/scrollarea/vthumb-endhover.png",<br />
"inner" : "/interface/bookmarks/scrollarea/vthumb-innerhover.png"<br />
},<br />
"pressed" : {<br />
"begin" : "/interface/bookmarks/scrollarea/vthumb-beginhover.png",<br />
"end" : "/interface/bookmarks/scrollarea/vthumb-endhover.png",<br />
"inner" : "/interface/bookmarks/scrollarea/vthumb-innerhover.png"<br />
}<br />
}<br />
},<br />
"children" : {}<br />
}</pre><br />
<br />
==LayoutWidget==<br />
We don't know much about it. Used, for example, in spaceship cockpit screen for displaying ores and weather types for the planet (icons with tooltip). Also used in the AI interface screen (the one used to access missions and crewmember info). <br />
<br />
Think of this as a scrollArea Widget without a scrollbar. <br />
<br />
It essentially is used to group individual widgets together. You can access children of a layout widget via 'LayoutWidgetName.childWidgetName'<br />
<br />
This widget is particularly useful if you wish to display multiple "Screens" in one pane.<br />
<br />
<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string||Always ''layout''. '''Required'''<br />
|- <br />
|layoutType||||||possible values: "basic", "flow".<br />
|- <br />
|rect||yes||Vec4I||Layout bounding rectangle, [xmin, ymin, xmax, ymax].<br />
|- <br />
|spacing||no||Vec2I||Spacing between elements. I believe this is not used in "basic" layout types, but perhaps used in "flow" layout types.<br />
|}<br />
<br />
==ItemListWidget==<br />
A widget that stores a list of items that a player can click on to select (one at any given time, like the radio button group). Often paired with a ScrollAreaWidget.<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string||Always ''list''. '''Required'''<br />
|- <br />
|callback||no||string||Name of the function called when the list's selected item changes. This includes being changed by player input, by the function ''widget.setListSelected()'', and when ''nil'' is selected due to the current selected item being removed, such as by ''widget.clearListItems()''.<br />
|- <br />
|schema||yes||table||Template for list items. The table's parameters are described below. '''Required'''<br />
|}<br />
Schema parameters:<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|selectedBG||no||string||Background image path when selected.<br />
|- <br />
|unselectedBG||no||string||Background image path when not selected.<br />
|- <br />
|spacing||no||Vec2F||Distance between list items.<br />
|- <br />
|memberSize||yes||Vec2F||Width and height of list items. Not required, but the item would be invisible unless a value is set.<br />
|- <br />
|listTemplate||yes||table||Table of widgets. Probably not required, but necessary to differentiate list items from one another (icons, labels etc). In other words the list template is where you would configure what sub-widgets are in each listitem. You can access each sub-widget with the path: "<listName>.<itemID>.<widgetTemplateName>". You get the labelID as the return variable from the function widget.addListItem("<WidgetListName>"), and can also get the itemID from widget.getListSelected("<WidgetListName>")<br />
|}<br />
====Example====<br />
<pre>"sampleList" : {<br />
"type" : "list",<br />
"schema" : {<br />
"selectedBG" : "/interface/crafting/craftableselected2.png",<br />
"unselectedBG" : "/interface/crafting/craftablebackground.png",<br />
"spacing" : [0, 1],<br />
"memberSize" : [159, 20],<br />
"listTemplate" : {<br />
"background" : {<br />
"type" : "image",<br />
"file" : "/interface/crafting/craftablebackground.png",<br />
"position" : [2, 0],<br />
"zlevel" : -1<br />
},<br />
"itemName" : {<br />
"type" : "label",<br />
"position" : [25, 5],<br />
"hAnchor" : "left",<br />
"wrapWidth" : 116,<br />
"value" : "Replace Me"<br />
},<br />
"itemIcon" : {<br />
"type" : "itemslot",<br />
"position" : [3, 1],<br />
"callback" : "null"<br />
}<br />
}<br />
}<br />
}</pre><br />
<br />
==SliderWidget==<br />
A slider with "left" and "right" buttons attached.<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string||Always ''slider''. '''Required'''<br />
|- <br />
|gridImage||unknown||string||Path to background image for the grid of a slider.<br />
|}<br />
==ProgressBarWidget==<br />
A widget comprised of a "progress bar", in the style of a health/energy bar or a durability bar.<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string||Always ''progress''. '''Required'''<br />
|- <br />
|background||no||string||Path to background image of bar; empty bar.<br />
|- <br />
|progressSet||yes||table||Contains ''begin'', ''inner'' and ''end'' (string), which are path to an image to use for each elements of the bar (only ''inner'' is mandatory), and ''type'' (string), which can be set as ''repeat'' or ''stretch'' and will affect how the ''inner'' image will be handled.<br />
|- <br />
|size||yes||Vec2F||Width and height of progress bar.<br />
|- <br />
|direction||no||string||''horizontal'' or (presumably) ''vertical''.<br />
|}<br />
====Example====<br />
<pre>"sampleProgress" : {<br />
"zlevel" : 7,<br />
"type" : "progress",<br />
"position" : [30, -22],<br />
"background" : "/interface/emptybar.png",<br />
"size" : [60, 8],<br />
"progressSet" : {<br />
"inner" : "/interface/healthbar.png",<br />
"type" : "repeat"<br />
},<br />
"direction" : "horizontal"<br />
}</pre><br />
<br />
==SpinnerWidget==<br />
A widget comprised of two horizontal arrows facing opposite directions. Used in the base game's crafting menu and character creation menu.<br />
<br />
{|class="wikitable sortable"<br />
!Parameter Name<br />
!Mandatory<br />
!Variable Type<br />
!Description<br />
|- <br />
|type||yes||string||Always ''spinner''. '''Required'''<br />
|- <br />
|upOffset||no||int||Distance the right arrow is placed away from the left arrow. If not present the buttons will be next to each other with a small distance. To place them with 0 interval set to 8.<br />
|- <br />
|hAnchor||no||string||''left'', ''mid'' or ''right''. Horizontal alignment.<br />
|- <br />
|callback||no||string||Name of the function called by the arrows. The left arrow calls <callback>.down, the right calls <callback>.up. In your .lua, these should be in a global table named the same as the callback.<br />
|}<br />
====Example====<br />
.Config file:<br />
<pre>"sampleSpinner" : {<br />
"type": "spinner",<br />
"position" : [220, 46],<br />
"upOffset" : 36<br />
}<br />
<br />
"scriptWidgetCallbacks" : [... ,"sampleSpinner.up", "sampleSpinner.down"]<br />
</pre><br />
<br />
connected .lua file:<br />
<pre><br />
sampleSpinner = {}<br />
<br />
--callback function when right button is pressed<br />
function sampleSpinner.up()<br />
--block<br />
end<br />
<br />
--called when left button is pressed<br />
function sampleSpinner.down()<br />
--block<br />
end<br />
<br />
init() {<br />
...<br />
<br />
</pre><br />
<br />
NOTE:<br />
<pre>self.sampleSpinner = {}</pre> <br />
does NOT work.<br />
<br />
==Widget general==<br />
{{Modding}}<br />
<br />
[[Category:JSON]]</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Lua/Starbound_Datatypes&diff=173983Modding:Lua/Starbound Datatypes2017-06-05T22:26:52Z<p>😺: Precisions on rectF/I & polyF</p>
<hr />
<div>Starbound makes extensive use of Lua and JSON, and their data types. There are some types that could use some small amount of documentation, and that is the goal of this page.<br />
<br><br />
<br><br />
Note that a JSON array and a Lua array aren't the same. [http://community.playstarbound.com/threads/why-wont-this-work-please-help-me.132290/#post-3148429 This post and the following ones] give some beginner-level differentiation.<br />
<br><br />
<br><br />
<hr><br />
<div id="moddingcode"><br />
===<code>*Id</code>===<br />
These are <code>integers</code>, not to be confused with callable script objects.<br />
<br />
<hr><br />
<br />
===<code>RpcPromise</code>===<br />
Returned by functions requiring asynchronous data, such as world.sendEntityMessage(). It has four methods that can be called to determine its status: <br />
<br />
<li><code>RpcPromiseVariable:finished()</code> returns a boolean indicating whether the promise has finished.</li><br />
<li><code>RpcPromiseVariable:succeeded()</code> returns a boolean indicating whether the promise has succeeded.</li><br />
<li><code>RpcPromiseVariable:result()</code> returns the return value(s) of the called function</li><br />
<li><code>RpcPromiseVariable:error()</code> returns the error string, or nil if no error occured. (Internal radio messages (eg. sendRadioMessage) always return an error, even if they executed properly)</li><br />
<hr><br />
<br />
===<code>liquidLevel</code>===<br />
Surprisingly simple, just the liquid ID and its amount.<br />
*<code>int</code> liquidId<br />
*<code>int</code> amount<br />
<br />
<hr><br />
<br />
===<code>ItemDescriptor</code>=== <br />
JSON object which contains key-value pairs for name and amount, as well as additional parameters:<br />
*<code>string</code> name<br />
*<code>int</code> count<br />
*<code>JSON</code> parameters<br />
If count or parameters is omitted, it seems they'll be considered as 1 and {} respectively.<br />
<br />
<hr><br />
<br />
===<code>Map<EntityId, unsigned></code>===<br />
This bears some small note, to prevent potential confusion. It is a Lua table, not an explicit key-value pair.<br />
<br />
<hr><br />
<br />
===<code>ItemBag</code>===<br />
First noted usage by widget.itemGridItems(String widgetName). this entry needs filling.<br />
<br />
<hr><br />
<br />
===<code>Vec2F</code> and <code>Vec2I</code>===<br />
JSON object which contains <code>x</code> and <code>y</code>.<br />
"I" is for Integer, "F" is for "Float"<br />
<pre>[x = 0, y = 2]</pre><br />
<br />
<hr><br />
<br />
===<code>rectF</code> and <code>rectI</code>===<br />
Json array which contains the top right and bottom left's X and Y coordinates of a rectangle.<br />
"I" is for Integer, "F" is for "Float"<br />
<pre>[-1, -1, 1, 1]</pre><br />
<br />
<hr><br />
<br />
===<code>polyF</code>===<br />
Json array which contains sets of x;y coordinates, forming a polygon's edges.<br />
The last coordinates form a line with the first ones.<br />
<pre>[ [-0.75, -2.0], [-0.35, -2.5], [0.35, -2.5], [0.75, -2.0], [0.75, 0.65], [0.35, 1.22], [-0.35, 1.22], [-0.75, 0.65] ]</pre><br />
<br />
<hr><br />
<br />
===<code>harvestLevel</code>===<br />
Seems to be the poor man's boolean, where 0 = false and 1 = true?<br />
<br />
<hr><br />
<br />
===<code>teamType</code>===<br />
Case-insensitive <code>string</code> used to define things like who can damage who. Vanilla types:<br />
*<code>friendly</code>: (players, non-agressive NPCs, pets...)<br />
*<code>enemy</code>: (monsters, agressive NPCs...)<br />
*<code>passive</code>: (critters...)<br />
*<code>ghostly</code>: Cannot be hit, unaffected by terrain hazards<br />
*<code>assistant</code>: (Glitch mission's castle friendly NPC (castle archers, nuru...))<br />
*<code>Environment</code>: (volcanic trap...)<br />
*<code>indiscriminate</code>: able to hit anything regardless of their damageTeam (traps...)<br />
*<code>pvp</code>: pvp-enabled players<br />
<br />
<hr><br />
<br />
===<code>damageType</code> and <code>tileDamageType</code>===<br />
Case-insensitive <code>string</code>:<br />
*<code>blockish</code>: damages to blocks<br />
*<code>plantish</code>: damages to plants<br />
*<code>beamish</code>: Used by the pickslash weaponability<br />
*<code>explosive</code>: Used by the meteor explosions<br />
*<code>fire</code>: <br />
*<code>tilling</code>: <br />
*<code>damage</code>: <br />
*<code>knockback</code>: used by shields<br />
*<code>Environment</code>: <br />
*<code>IgnoresDef</code>: Ignores the target's protection stat.<br />
*<code>NoDamage</code>: <br />
<br />
<hr><br />
<br />
===<code>damageSourceKind</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly. Might be to define which sound to play? Vanilla ones:<br />
<pre>applystatus, axe, bite, broadsword, bugnet, dagger, default, electric, electricbroadsword, electricfist, electrichammer, electricplasma, falling, fire, firebroadsword, firehammer, fireplasma, fist, fiststrong, foldingchair, fryingpan, gnomebeam, hammer, hidden, ice, icehammer, iceplasma, nodamage, plasma, poison, poisondagger, poisonhammer, poisonlash, poisonplasma, sawblade, shield, shortsword, slash, spear, standardbullet</pre><br />
<br />
<hr><br />
<br />
===<code>damageRepeatGroup</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly.<br />
<pre>monsterfire, crystalbossbeam, shockhopper-flamethrower, npcTouchKnockback, largefloorspike, smallfloorspike, guardiandamagebuff</pre><br />
Weapons build their own with<br />
<pre>activeItem.ownerEntityId() .. config.getParameter("itemName") .. activeItem.hand() .. mode</pre><br />
Where "mode" is one of<br />
<pre>primary, alt, hold</pre><br />
<br />
<hr><br />
<br />
===<code>DamageTeam</code>===<br />
JSON object which contains:<br />
*<code>string</code> type<br />
*<code>int</code> team<br />
<br />
<code>type</code> = teamType above. <code>team</code> is used to differentiate multiple groups of the same type.<br />
<br />
<pre>{type = "enemy", team = 2}</pre><br />
<br />
<hr><br />
<br />
===<code>DamageSource</code>===<br />
JSON object which contains:<br />
*<code>List<PolyF></code> poly,<br />
*<code>int</code> damage,<br />
*<code>string</code> teamType,<br />
*<code>string</code> damageType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>int</code> damageRepeatTimeout,<br />
*<code>string</code> damageRepeatGroup<br />
<br />
<pre> {<br />
"poly" : [ [-0.75, 0.5], [0.0, 8.0], [0.75, 0.5] ],<br />
"damage" : 5,<br />
"teamType" : "friendly",<br />
"damageType" : "IgnoresDef",<br />
"damageSourceKind" : "axe",<br />
"damageRepeatTimeout" : 10,<br />
"damageRepeatGroup" : "largefloorspike"<br />
},</pre><br />
<br />
<hr><br />
<br />
===<code>damageRequest</code>===<br />
JSON object which contains at least:<br />
*<code>string</code> damageType,<br />
*<code>int</code> damage or damageDealt,<br />
*<code>entityId</code> sourceEntityId,<br />
And optionally(?)<br />
*<code>entityId</code> targetEntityId,<br />
*<code>Vec2F</code> position,<br />
*<code>int</code> healthLost,<br />
*<code>string</code> hitType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>string</code> targetMaterialKind,<br />
*<code>bool</code> killed<br />
<br />
<pre>{ damageType = "IgnoresDef", damage = 1, sourceEntityId = activeItem.ownerEntityId() }</pre><br />
<pre>{healthLost: 1, damageSourceKind: , sourceEntityId: -65536, hitType: Hit, targetMaterialKind: organic, damageDealt: 1, position: {1: 847.35, 2: 903.7}, targetEntityId: -65536}</pre><br />
<br />
<hr><br />
<br />
===<code>damageNotification</code>===<br />
Probably be the same as damageRequest?<br />
<br />
<hr><br />
<br />
===<code>collisionKinds</code>===<br />
Collision Kind is a case-insensitive <code>string</code> used by the world table's collision check functions. A "CollisionSet" is an array of collisionKinds. For materials, they're defined in their .material file. For metamaterials, they're defined in the /assets/metamaterials.config file.<br />
*<code>Null</code>: For non-loaded areas and some specific metamaterials in vanilla <br />
*<code>None</code>: No collisions<br />
*<code>Block</code>: For block materials <br />
*<code>Platform</code>: For platform materials <br />
*<code>Dynamic</code>: For eg. the light platforms in the Ancient areas, and doors(?) <br />
*<code>Slippery</code>: Vanilla uses it so that the Spike Sphere doesn't attach to materials <br />
<br />
<hr><br />
<br />
===<code>PhysicsForceRegion</code>===<br />
JSON object usually put in an array called <code>forceRegions</code>.<br />
Vanilla currently only uses it for the kluex boss and the guardianminions.<br />
<pre> {<br />
"right" : {<br />
"type" : "RadialForceRegion",<br />
"outerRadius" : 4,<br />
"innerRadius" : 0.5,<br />
"baseTargetRadialVelocity" : -5,<br />
"controlForce" : 100,<br />
"categoryWhitelist" : [ "guardianminion" ]<br />
}<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::Path</code>===<br />
A list of pathfind nodes<br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::PathFinder</code>===<br />
Lua UserData value which can be used for pathfinding over multiple frames. Has the following two methods:<br />
<br />
<li><code>explore([`int` nodeLimit])</code>: Explores the path up to the specified node count limit. Returns `true` if the pathfinding is complete and `false` if it is still incomplete. If nodeLimit is unspecified, this will search up to the configured maximum number of nodes, making it equivalent to world.platformerPathStart</li><br />
<br />
<li><code>result()</code></li>: Returns the completed path.<br />
<br />
<hr><br />
<br />
===<code>imageSet</code>===<br />
JSON object used to define an image<br />
<pre>{<br />
base = "image.png",<br />
hover = "image.png",<br />
pressed = "image.png",<br />
disabled = "image.png",<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>MovementParameters</code>===<br />
A vehicle or projectile's movement parameters, returned by <code>mcontroller.parameters()</code>. Not to be confused with <code>ActorMovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>ActorMovementParameters</code>===<br />
A monster, npc, player(...)'s base movement parameters, returned by <code>mcontroller.baseParameters()</code>. Not to be confused with <code>MovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>directives</code>===<br />
a <code>string</code> defining [http://starbounder.org/Modding:Image_Processing_Directives Image Processing Directives].<br />
<br />
<hr><br />
<br />
</div><br />
{{Modding}}<br />
__NOTOC__</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Lua/Starbound_Datatypes&diff=173930Modding:Lua/Starbound Datatypes2017-06-05T13:24:53Z<p>😺: corrected RpcPromise success() -> succeeded(), a bit more info about error()</p>
<hr />
<div>Starbound makes extensive use of Lua and JSON, and their data types. There are some types that could use some small amount of documentation, and that is the goal of this page.<br />
<br><br />
<br><br />
Note that a JSON array and a Lua array aren't the same. [http://community.playstarbound.com/threads/why-wont-this-work-please-help-me.132290/#post-3148429 This post and the following ones] give some beginner-level differentiation.<br />
<br><br />
<br><br />
<hr><br />
<div id="moddingcode"><br />
===<code>*Id</code>===<br />
These are <code>integers</code>, not to be confused with callable script objects.<br />
<br />
<hr><br />
<br />
===<code>RpcPromise</code>===<br />
Returned by functions requiring asynchronous data, such as world.sendEntityMessage(). It has four methods that can be called to determine its status: <br />
<br />
<li><code>RpcPromiseVariable:finished()</code> returns a boolean indicating whether the promise has finished.</li><br />
<li><code>RpcPromiseVariable:succeeded()</code> returns a boolean indicating whether the promise has succeeded.</li><br />
<li><code>RpcPromiseVariable:result()</code> returns the return value(s) of the called function</li><br />
<li><code>RpcPromiseVariable:error()</code> returns the error string, or nil if no error occured. (Internal radio messages (eg. sendRadioMessage) always return an error, even if they executed properly)</li><br />
<hr><br />
<br />
===<code>liquidLevel</code>===<br />
Surprisingly simple, just the liquid ID and its amount.<br />
*<code>int</code> liquidId<br />
*<code>int</code> amount<br />
<br />
<hr><br />
<br />
===<code>ItemDescriptor</code>=== <br />
JSON object which contains key-value pairs for name and amount, as well as additional parameters:<br />
*<code>string</code> name<br />
*<code>int</code> count<br />
*<code>JSON</code> parameters<br />
If count or parameters is omitted, it seems they'll be considered as 1 and {} respectively.<br />
<br />
<hr><br />
<br />
===<code>Map<EntityId, unsigned></code>===<br />
This bears some small note, to prevent potential confusion. It is a Lua table, not an explicit key-value pair.<br />
<br />
<hr><br />
<br />
===<code>ItemBag</code>===<br />
First noted usage by widget.itemGridItems(String widgetName). this entry needs filling.<br />
<br />
<hr><br />
<br />
===<code>Vec2F</code> and <code>Vec2I</code>===<br />
JSON object which contains <code>x</code> and <code>y</code>. "I" is for Integer, "F" is for "Float"<br />
<pre>[x = 0, y = 2]</pre><br />
<br />
<hr><br />
<br />
===<code>rectF</code> and <code>rectI</code>===<br />
Json array which contains 4 values being the 4 edges of a rectangle? Need confirmation. "I" is for Integer, "F" is for "Float"<br />
<pre>[-1, -1, 1, 1]</pre><br />
<br />
<hr><br />
<br />
===<code>polyF</code>===<br />
Json array which contains multiple sets of x;y coordinates, forming a polygon. <br />
<pre>[ [-0.75, -2.0], [-0.35, -2.5], [0.35, -2.5], [0.75, -2.0], [0.75, 0.65], [0.35, 1.22], [-0.35, 1.22], [-0.75, 0.65] ]</pre><br />
<br />
<hr><br />
<br />
===<code>harvestLevel</code>===<br />
Seems to be the poor man's boolean, where 0 = false and 1 = true?<br />
<br />
<hr><br />
<br />
===<code>teamType</code>===<br />
Case-insensitive <code>string</code> used to define things like who can damage who. Vanilla types:<br />
*<code>friendly</code>: (players, non-agressive NPCs, pets...)<br />
*<code>enemy</code>: (monsters, agressive NPCs...)<br />
*<code>passive</code>: (critters...)<br />
*<code>ghostly</code>: Cannot be hit, unaffected by terrain hazards<br />
*<code>assistant</code>: (Glitch mission's castle friendly NPC (castle archers, nuru...))<br />
*<code>Environment</code>: (volcanic trap...)<br />
*<code>indiscriminate</code>: able to hit anything regardless of their damageTeam (traps...)<br />
*<code>pvp</code>: pvp-enabled players<br />
<br />
<hr><br />
<br />
===<code>damageType</code> and <code>tileDamageType</code>===<br />
Case-insensitive <code>string</code>:<br />
*<code>blockish</code>: damages to blocks<br />
*<code>plantish</code>: damages to plants<br />
*<code>beamish</code>: Used by the pickslash weaponability<br />
*<code>explosive</code>: Used by the meteor explosions<br />
*<code>fire</code>: <br />
*<code>tilling</code>: <br />
*<code>damage</code>: <br />
*<code>knockback</code>: used by shields<br />
*<code>Environment</code>: <br />
*<code>IgnoresDef</code>: Ignores the target's protection stat.<br />
*<code>NoDamage</code>: <br />
<br />
<hr><br />
<br />
===<code>damageSourceKind</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly. Might be to define which sound to play? Vanilla ones:<br />
<pre>applystatus, axe, bite, broadsword, bugnet, dagger, default, electric, electricbroadsword, electricfist, electrichammer, electricplasma, falling, fire, firebroadsword, firehammer, fireplasma, fist, fiststrong, foldingchair, fryingpan, gnomebeam, hammer, hidden, ice, icehammer, iceplasma, nodamage, plasma, poison, poisondagger, poisonhammer, poisonlash, poisonplasma, sawblade, shield, shortsword, slash, spear, standardbullet</pre><br />
<br />
<hr><br />
<br />
===<code>damageRepeatGroup</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly.<br />
<pre>monsterfire, crystalbossbeam, shockhopper-flamethrower, npcTouchKnockback, largefloorspike, smallfloorspike, guardiandamagebuff</pre><br />
Weapons build their own with<br />
<pre>activeItem.ownerEntityId() .. config.getParameter("itemName") .. activeItem.hand() .. mode</pre><br />
Where "mode" is one of<br />
<pre>primary, alt, hold</pre><br />
<br />
<hr><br />
<br />
===<code>DamageTeam</code>===<br />
JSON object which contains:<br />
*<code>string</code> type<br />
*<code>int</code> team<br />
<br />
<code>type</code> = teamType above. <code>team</code> is used to differentiate multiple groups of the same type.<br />
<br />
<pre>{type = "enemy", team = 2}</pre><br />
<br />
<hr><br />
<br />
===<code>DamageSource</code>===<br />
JSON object which contains:<br />
*<code>List<PolyF></code> poly,<br />
*<code>int</code> damage,<br />
*<code>string</code> teamType,<br />
*<code>string</code> damageType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>int</code> damageRepeatTimeout,<br />
*<code>string</code> damageRepeatGroup<br />
<br />
<pre> {<br />
"poly" : [ [-0.75, 0.5], [0.0, 8.0], [0.75, 0.5] ],<br />
"damage" : 5,<br />
"teamType" : "friendly",<br />
"damageType" : "IgnoresDef",<br />
"damageSourceKind" : "axe",<br />
"damageRepeatTimeout" : 10,<br />
"damageRepeatGroup" : "largefloorspike"<br />
},</pre><br />
<br />
<hr><br />
<br />
===<code>damageRequest</code>===<br />
JSON object which contains at least:<br />
*<code>string</code> damageType,<br />
*<code>int</code> damage or damageDealt,<br />
*<code>entityId</code> sourceEntityId,<br />
And optionally(?)<br />
*<code>entityId</code> targetEntityId,<br />
*<code>Vec2F</code> position,<br />
*<code>int</code> healthLost,<br />
*<code>string</code> hitType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>string</code> targetMaterialKind,<br />
*<code>bool</code> killed<br />
<br />
<pre>{ damageType = "IgnoresDef", damage = 1, sourceEntityId = activeItem.ownerEntityId() }</pre><br />
<pre>{healthLost: 1, damageSourceKind: , sourceEntityId: -65536, hitType: Hit, targetMaterialKind: organic, damageDealt: 1, position: {1: 847.35, 2: 903.7}, targetEntityId: -65536}</pre><br />
<br />
<hr><br />
<br />
===<code>damageNotification</code>===<br />
Probably be the same as damageRequest?<br />
<br />
<hr><br />
<br />
===<code>collisionKinds</code>===<br />
Collision Kind is a case-insensitive <code>string</code> used by the world table's collision check functions. A "CollisionSet" is an array of collisionKinds. For materials, they're defined in their .material file. For metamaterials, they're defined in the /assets/metamaterials.config file.<br />
*<code>Null</code>: For non-loaded areas and some specific metamaterials in vanilla <br />
*<code>None</code>: No collisions<br />
*<code>Block</code>: For block materials <br />
*<code>Platform</code>: For platform materials <br />
*<code>Dynamic</code>: For eg. the light platforms in the Ancient areas, and doors(?) <br />
*<code>Slippery</code>: Vanilla uses it so that the Spike Sphere doesn't attach to materials <br />
<br />
<hr><br />
<br />
===<code>PhysicsForceRegion</code>===<br />
JSON object usually put in an array called <code>forceRegions</code>.<br />
Vanilla currently only uses it for the kluex boss and the guardianminions.<br />
<pre> {<br />
"right" : {<br />
"type" : "RadialForceRegion",<br />
"outerRadius" : 4,<br />
"innerRadius" : 0.5,<br />
"baseTargetRadialVelocity" : -5,<br />
"controlForce" : 100,<br />
"categoryWhitelist" : [ "guardianminion" ]<br />
}<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::Path</code>===<br />
A list of pathfind nodes<br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::PathFinder</code>===<br />
Lua UserData value which can be used for pathfinding over multiple frames. Has the following two methods:<br />
<br />
<li><code>explore([`int` nodeLimit])</code>: Explores the path up to the specified node count limit. Returns `true` if the pathfinding is complete and `false` if it is still incomplete. If nodeLimit is unspecified, this will search up to the configured maximum number of nodes, making it equivalent to world.platformerPathStart</li><br />
<br />
<li><code>result()</code></li>: Returns the completed path.<br />
<br />
<hr><br />
<br />
===<code>imageSet</code>===<br />
JSON object used to define an image<br />
<pre>{<br />
base = "image.png",<br />
hover = "image.png",<br />
pressed = "image.png",<br />
disabled = "image.png",<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>MovementParameters</code>===<br />
A vehicle or projectile's movement parameters, returned by <code>mcontroller.parameters()</code>. Not to be confused with <code>ActorMovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>ActorMovementParameters</code>===<br />
A monster, npc, player(...)'s base movement parameters, returned by <code>mcontroller.baseParameters()</code>. Not to be confused with <code>MovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>directives</code>===<br />
a <code>string</code> defining [http://starbounder.org/Modding:Image_Processing_Directives Image Processing Directives].<br />
<br />
<hr><br />
<br />
</div><br />
{{Modding}}<br />
__NOTOC__</div>😺https://starbounder.org/mediawiki/index.php?title=Mechs&diff=173574Mechs2017-06-01T06:33:49Z<p>😺: reworded a few things, added some more details, edited the page to better differentiate older mechs from new ones</p>
<hr />
<div>Mechs are [[vehicles]] that provide the player protection, adjusted movement as well offensive and defensive abilities. <br />
They were present as techs in the beta, and were removed. They were re-added as vehicles useable in both space and on ground, in the [[Version_1.3.0|Unstable 1.3 release]]<ref>http://playstarbound.com/starbound-1-3-unstable/</ref>.<br />
<br />
<br />
The Dr. Agakky, a penguin scienctist, holds it's Mech Workshop at the outpost. This is where the player gets introduced to Mechs, and get their first, specie-themed one.<br />
<br />
<br />
Mechs are composed of 6 customisable parts, which each change different characteristics of the Mech: <br />
* The Body affects the Maximum Energy of the mech and it's Defense;<br />
* The Boosters affects the Flight Speed and Maneuverability;<br />
* The Left and Right Arms are weapons, with different effects and energy usage;<br />
* The Legs affects the Ground Speed and the Jump Power;<br />
* The horn. --in space, nobody can hear you honk<br />
<br />
Different parts can be obtained by learning their corresponding blueprints, usually founnd in non-planet locations in space. They can be equipped to the mech by using the [[Mech_Assembly_Station|Mech Assembly Station]] on your [[Space_Station|space station]], or in Dr. Agakky's workshop.<br />
<br />
<br />
Mechs have their own energy reserve, visualised as the blue bar above the vehicle. Using the mech will deplete it at a specified rate, which can be found on the Mech Assembly Station interface. Receiving damages and using weapons also use energy. Hostile space entities can, when killed, drop energy batteries that the mech can absorb to restore it's own energy. Once the energy bar hits 0, the player is automatically expulsed from the mech, which explode, damaging the player and most likely killing them.<br />
<br />
<br />
<br />
==Older Mechs==<br />
Older mechs were [[Techs]] powered by the player's [[Energy|energy bar]], and could be beamed down from a player's ship to a planet. Taking damage in a mech would slowly drain the player's energy. When the energy was depleted, the mech would de-spawn, requiring a cool down before being re-summonable. <ref>http://community.playstarbound.com/index.php?threads/ask-us-anything.24965/page-3#post-1001447</ref><br><br />
<br />
<br />
The developers confirmed there would be at least one unique mech per race at launch <ref>http://playstarbound.com/24th-may-progress/</ref><br />
<br />
<br />
[[File:Mech X5C-1.gif|X5C-1 Mech|link=X5C-1 Mech]][[File:Mech_03.gif|Hylotl Mech|link=]][[File:Apex_Mech.gif|Apex Mech|link=Apex_Mech]][[File:Glitch_Mech.png|Glitch Mech|link=Glitch_Mech]]<br />
<br />
==Sources==<br />
<references/></div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Lua/Starbound_Datatypes&diff=172745Modding:Lua/Starbound Datatypes2017-05-06T22:49:38Z<p>😺: /* collisionKinds */ name correction</p>
<hr />
<div>Starbound makes extensive use of Lua and JSON, and their data types. There are some types that could use some small amount of documentation, and that is the goal of this page.<br />
<br><br />
<br><br />
Note that a JSON array and a Lua array aren't the same. [http://community.playstarbound.com/threads/why-wont-this-work-please-help-me.132290/#post-3148429 This post and the following ones] give some beginner-level differentiation.<br />
<br><br />
<br><br />
<hr><br />
<div id="moddingcode"><br />
===<code>*Id</code>===<br />
These are <code>integers</code>, not to be confused with callable script objects.<br />
<br />
<hr><br />
<br />
===<code>RpcPromise</code>===<br />
Returned by functions requiring asynchronous data, such as world.sendEntityMessage(). It has four methods that can be called to determine its status: <br />
<br />
<li><code>RpcPromiseVariable:finished()</code> returns whether the promise has finished.</li><br />
<li><code>RpcPromiseVariable:success()</code> returns whether the promise has succeeded.</li><br />
<li><code>RpcPromiseVariable:result()</code> returns the return value(s) of the called function</li><br />
<li><code>RpcPromiseVariable:error()</code> returns the error string, if one occurs. (Need clarification on this one)</li><br />
<br />
<hr><br />
<br />
===<code>liquidLevel</code>===<br />
Surprisingly simple, just the liquid ID and its amount.<br />
*<code>int</code> liquidId<br />
*<code>int</code> amount<br />
<br />
<hr><br />
<br />
===<code>ItemDescriptor</code>=== <br />
JSON object which contains key-value pairs for name and amount, as well as additional parameters:<br />
*<code>string</code> name<br />
*<code>int</code> count<br />
*<code>JSON</code> parameters<br />
If count or parameters is omitted, it seems they'll be considered as 1 and {} respectively.<br />
<br />
<hr><br />
<br />
===<code>Map<EntityId, unsigned></code>===<br />
This bears some small note, to prevent potential confusion. It is a Lua table, not an explicit key-value pair.<br />
<br />
<hr><br />
<br />
===<code>ItemBag</code>===<br />
First noted usage by widget.itemGridItems(String widgetName). this entry needs filling.<br />
<br />
<hr><br />
<br />
===<code>Vec2F</code> and <code>Vec2I</code>===<br />
JSON object which contains <code>x</code> and <code>y</code>. "I" is for Integer, "F" is for "Float"<br />
<pre>[x = 0, y = 2]</pre><br />
<br />
<hr><br />
<br />
===<code>rectF</code> and <code>rectI</code>===<br />
Json array which contains 4 values being the 4 edges of a rectangle? Need confirmation. "I" is for Integer, "F" is for "Float"<br />
<pre>[-1, -1, 1, 1]</pre><br />
<br />
<hr><br />
<br />
===<code>polyF</code>===<br />
Json array which contains multiple sets of x;y coordinates, forming a polygon. <br />
<pre>[ [-0.75, -2.0], [-0.35, -2.5], [0.35, -2.5], [0.75, -2.0], [0.75, 0.65], [0.35, 1.22], [-0.35, 1.22], [-0.75, 0.65] ]</pre><br />
<br />
<hr><br />
<br />
===<code>harvestLevel</code>===<br />
Seems to be the poor man's boolean, where 0 = false and 1 = true?<br />
<br />
<hr><br />
<br />
===<code>teamType</code>===<br />
Case-insensitive <code>string</code> used to define things like who can damage who. Vanilla types:<br />
*<code>friendly</code>: (players, non-agressive NPCs, pets...)<br />
*<code>enemy</code>: (monsters, agressive NPCs...)<br />
*<code>passive</code>: (critters...)<br />
*<code>ghostly</code>: Cannot be hit, unaffected by terrain hazards<br />
*<code>assistant</code>: (Glitch mission's castle friendly NPC (castle archers, nuru...))<br />
*<code>Environment</code>: (volcanic trap...)<br />
*<code>indiscriminate</code>: able to hit anything regardless of their damageTeam (traps...)<br />
*<code>pvp</code>: pvp-enabled players<br />
<br />
<hr><br />
<br />
===<code>damageType</code> and <code>tileDamageType</code>===<br />
Case-insensitive <code>string</code>:<br />
*<code>blockish</code>: damages to blocks<br />
*<code>plantish</code>: damages to plants<br />
*<code>beamish</code>: Used by the pickslash weaponability<br />
*<code>explosive</code>: Used by the meteor explosions<br />
*<code>fire</code>: <br />
*<code>tilling</code>: <br />
*<code>damage</code>: <br />
*<code>knockback</code>: used by shields<br />
*<code>Environment</code>: <br />
*<code>IgnoresDef</code>: Ignores the target's protection stat.<br />
*<code>NoDamage</code>: <br />
<br />
<hr><br />
<br />
===<code>damageSourceKind</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly. Might be to define which sound to play? Vanilla ones:<br />
<pre>applystatus, axe, bite, broadsword, bugnet, dagger, default, electric, electricbroadsword, electricfist, electrichammer, electricplasma, falling, fire, firebroadsword, firehammer, fireplasma, fist, fiststrong, foldingchair, fryingpan, gnomebeam, hammer, hidden, ice, icehammer, iceplasma, nodamage, plasma, poison, poisondagger, poisonhammer, poisonlash, poisonplasma, sawblade, shield, shortsword, slash, spear, standardbullet</pre><br />
<br />
<hr><br />
<br />
===<code>damageRepeatGroup</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly.<br />
<pre>monsterfire, crystalbossbeam, shockhopper-flamethrower, npcTouchKnockback, largefloorspike, smallfloorspike, guardiandamagebuff</pre><br />
Weapons build their own with<br />
<pre>activeItem.ownerEntityId() .. config.getParameter("itemName") .. activeItem.hand() .. mode</pre><br />
Where "mode" is one of<br />
<pre>primary, alt, hold</pre><br />
<br />
<hr><br />
<br />
===<code>DamageTeam</code>===<br />
JSON object which contains:<br />
*<code>string</code> type<br />
*<code>int</code> team<br />
<br />
<code>type</code> = teamType above. <code>team</code> is used to differentiate multiple groups of the same type.<br />
<br />
<pre>{type = "enemy", team = 2}</pre><br />
<br />
<hr><br />
<br />
===<code>DamageSource</code>===<br />
JSON object which contains:<br />
*<code>List<PolyF></code> poly,<br />
*<code>int</code> damage,<br />
*<code>string</code> teamType,<br />
*<code>string</code> damageType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>int</code> damageRepeatTimeout,<br />
*<code>string</code> damageRepeatGroup<br />
<br />
<pre> {<br />
"poly" : [ [-0.75, 0.5], [0.0, 8.0], [0.75, 0.5] ],<br />
"damage" : 5,<br />
"teamType" : "friendly",<br />
"damageType" : "IgnoresDef",<br />
"damageSourceKind" : "axe",<br />
"damageRepeatTimeout" : 10,<br />
"damageRepeatGroup" : "largefloorspike"<br />
},</pre><br />
<br />
<hr><br />
<br />
===<code>damageRequest</code>===<br />
JSON object which contains at least:<br />
*<code>string</code> damageType,<br />
*<code>int</code> damage or damageDealt,<br />
*<code>entityId</code> sourceEntityId,<br />
And optionally(?)<br />
*<code>entityId</code> targetEntityId,<br />
*<code>Vec2F</code> position,<br />
*<code>int</code> healthLost,<br />
*<code>string</code> hitType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>string</code> targetMaterialKind,<br />
*<code>bool</code> killed<br />
<br />
<pre>{ damageType = "IgnoresDef", damage = 1, sourceEntityId = activeItem.ownerEntityId() }</pre><br />
<pre>{healthLost: 1, damageSourceKind: , sourceEntityId: -65536, hitType: Hit, targetMaterialKind: organic, damageDealt: 1, position: {1: 847.35, 2: 903.7}, targetEntityId: -65536}</pre><br />
<br />
<hr><br />
<br />
===<code>damageNotification</code>===<br />
Probably be the same as damageRequest?<br />
<br />
<hr><br />
<br />
===<code>collisionKinds</code>===<br />
Collision Kind is a case-insensitive <code>string</code> used by the world table's collision check functions. A "CollisionSet" is an array of collisionKinds. For materials, they're defined in their .material file. For metamaterials, they're defined in the /assets/metamaterials.config file.<br />
*<code>Null</code>: For non-loaded areas and some specific metamaterials in vanilla <br />
*<code>None</code>: No collisions<br />
*<code>Block</code>: For block materials <br />
*<code>Platform</code>: For platform materials <br />
*<code>Dynamic</code>: For eg. the light platforms in the Ancient areas, and doors(?) <br />
*<code>Slippery</code>: Vanilla uses it so that the Spike Sphere doesn't attach to materials <br />
<br />
<hr><br />
<br />
===<code>PhysicsForceRegion</code>===<br />
JSON object usually put in an array called <code>forceRegions</code>.<br />
Vanilla currently only uses it for the kluex boss and the guardianminions.<br />
<pre> {<br />
"right" : {<br />
"type" : "RadialForceRegion",<br />
"outerRadius" : 4,<br />
"innerRadius" : 0.5,<br />
"baseTargetRadialVelocity" : -5,<br />
"controlForce" : 100,<br />
"categoryWhitelist" : [ "guardianminion" ]<br />
}<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::Path</code>===<br />
A list of pathfind nodes<br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::PathFinder</code>===<br />
Lua UserData value which can be used for pathfinding over multiple frames. Has the following two methods:<br />
<br />
<li><code>explore([`int` nodeLimit])</code>: Explores the path up to the specified node count limit. Returns `true` if the pathfinding is complete and `false` if it is still incomplete. If nodeLimit is unspecified, this will search up to the configured maximum number of nodes, making it equivalent to world.platformerPathStart</li><br />
<br />
<li><code>result()</code></li>: Returns the completed path.<br />
<br />
<hr><br />
<br />
===<code>imageSet</code>===<br />
JSON object used to define an image<br />
<pre>{<br />
base = "image.png",<br />
hover = "image.png",<br />
pressed = "image.png",<br />
disabled = "image.png",<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>MovementParameters</code>===<br />
A vehicle or projectile's movement parameters, returned by <code>mcontroller.parameters()</code>. Not to be confused with <code>ActorMovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>ActorMovementParameters</code>===<br />
A monster, npc, player(...)'s base movement parameters, returned by <code>mcontroller.baseParameters()</code>. Not to be confused with <code>MovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>directives</code>===<br />
a <code>string</code> defining [http://starbounder.org/Modding:Image_Processing_Directives Image Processing Directives].<br />
<br />
<hr><br />
<br />
</div><br />
{{Modding}}<br />
__NOTOC__</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Metadata_file&diff=172726Modding:Metadata file2017-05-02T09:09:06Z<p>😺: addition about Windows behavior on .metadata filename</p>
<hr />
<div>The metadata file replaces the [MODNAME].modinfo file since version 1.0 (Cheerful Giraffe, July 22nd, 2016)<ref>https://www.reddit.com/r/starbound/comments/4smkzj/2_quick_tips_about_mod_formats_for_unstable/</ref>. It is [[Modding:JSON|JSON]]-formatted and is entirely optional<ref>http://community.playstarbound.com/threads/modding-for-1-0.117818/#post-2956738 <br />
The | Suit, Jul 22, 2016</ref>. It can be named either <code>_metadata</code> or <code>.metadata</code><ref>http://community.playstarbound.com/threads/how-do-we-format-metadata-files.118150/#post-2957094 <br />
The | Suit, Jul 22, 2016</ref> (Note: Windows won't allow <code>.metadata</code> unless you add a <code>.</code> at the end<ref>http://i.imgur.com/PyNZqbg.gif</ref>) and is placed at the root of a mod's folder. The [[Modding:Mod_uploader_tool|Mod Uploader Tool]] provides a GUI to edit it.<br />
<br><br><br />
It contains general information about the mod which will be displayed in the mod list on the Starbound title screen, informations the game uses to determine load order if needed, and informations the Mod Uploader Tool uses if needed. Note that parameters' order doesn't matter, and that '''each parameter is optional'''; Starbound will deal without it. You could for example only fill the author field and not put the rest, or put everything but the version number. If you don't need a parameter, don't include it.<br />
<br><br><br />
Here's an example of a metadata file that includes every parameters: <pre><br />
{<br />
"name" : "coolmod",<br />
"friendlyName" : "Cool mod",<br />
"description" : "This a cool mod!",<br />
"author" : "XxX-Cool mod Creator-XxX",<br />
"version" : "2.00 Alpha Gold",<br />
"link" : "http://example.com/coolmod",<br />
"steamContentId" : 000000001,<br />
"includes" : ["coolmodv1"],<br />
"requires" : ["anothermod", "coolmod2"],<br />
"priority" : 0<br />
}</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! Entry !! Description<br />
|-<br />
| <tt>name</tt> || The "behind the scenes" name that is used for other mods' "requires" and "includes" parameters.<br />
|-<br />
| <tt>friendlyName</tt> || The name that'll show up mostly everywhere else.<br />
|-<br />
| <tt>description</tt> || The description of the mod.<br>Type '\n' for a new line, and escape quotations with a \, such as <pre>"description" : "This mod is \"cool\", if you know what I mean.\n:)"</pre><br />
|-<br />
| <tt>author</tt> || The author of the mod.<br />
|-<br />
| <tt>version</tt> || The version of the mod.<br />
|-<br />
| <tt>link</tt> || An URL that links to the mod.<br />
|-<br />
| <tt>steamContentId</tt> || The workshop's unique id that steam uses. The Mod Uploader Tool available with Starbound's Steam version will fill this automatically.<br />
|-<br />
| <tt>includes</tt> || Any mods listed here will be loaded before this mod, if they exist. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>requires</tt> || Any mods listed here will be '''required''', will be loaded before this mod, and the game will crash at startup if those mods aren't present. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>priority</tt> || The lower the number, the sooner it'll be loaded<ref>https://steamcommunity.com/app/211820/discussions/4/353916838209436654/#c355043117501118531 Mod Load Order, 17 Aug, 2016</ref>. The base assets.pak has a priority of -9999. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
|}<br />
<br />
<noinclude>{{Modding}} {{Category:Modding:Documentation}}</noinclude></div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Metadata_file&diff=172716Modding:Metadata file2017-05-02T00:34:16Z<p>😺: Added more refs and a mention of previous .modinfo files to clarify the changes, in case someone comes across outdated infos</p>
<hr />
<div>The metadata file replaces the [MODNAME].modinfo file since version 1.0 (Cheerful Giraffe, July 22nd, 2016)<ref>https://www.reddit.com/r/starbound/comments/4smkzj/2_quick_tips_about_mod_formats_for_unstable/</ref>. It is [[Modding:JSON|JSON]]-formatted and is entirely optional<ref>http://community.playstarbound.com/threads/modding-for-1-0.117818/#post-2956738 <br />
The | Suit, Jul 22, 2016</ref>. It can be named either <code>_metadata</code> or <code>.metadata</code><ref>http://community.playstarbound.com/threads/how-do-we-format-metadata-files.118150/#post-2957094 <br />
The | Suit, Jul 22, 2016</ref> <!--- with a possible underscore (_) or dot (.) at the end? If someone could confirm http://community.playstarbound.com/threads/uploading-a-mod-onto-the-steam-workshop-step-by-step-how-to.118399/ ---> and is placed at the root of a mod's folder. The [[Modding:Mod_uploader_tool|Mod Uploader Tool]] provides a GUI to edit it.<br />
<br><br><br />
It contains general information about the mod which will be displayed in the mod list on the Starbound title screen, informations the game uses to determine load order if needed, and informations the Mod Uploader Tool uses if needed. Note that parameters' order doesn't matter, and that '''each parameter is optional'''; Starbound will deal without it. You could for example only fill the author field and not put the rest, or put everything but the version number. If you don't need a parameter, don't include it.<br />
<br><br><br />
Here's an example of a metadata file that includes every parameters: <pre><br />
{<br />
"name" : "coolmod",<br />
"friendlyName" : "Cool mod",<br />
"description" : "This a cool mod!",<br />
"author" : "XxX-Cool mod Creator-XxX",<br />
"version" : "2.00 Alpha Gold",<br />
"link" : "http://example.com/coolmod",<br />
"steamContentId" : 000000001,<br />
"includes" : ["coolmodv1"],<br />
"requires" : ["anothermod", "coolmod2"],<br />
"priority" : 0<br />
}</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! Entry !! Description<br />
|-<br />
| <tt>name</tt> || The "behind the scenes" name that is used for other mods' "requires" and "includes" parameters.<br />
|-<br />
| <tt>friendlyName</tt> || The name that'll show up mostly everywhere else.<br />
|-<br />
| <tt>description</tt> || The description of the mod.<br>Type '\n' for a new line, and escape quotations with a \, such as <pre>"description" : "This mod is \"cool\", if you know what I mean.\n:)"</pre><br />
|-<br />
| <tt>author</tt> || The author of the mod.<br />
|-<br />
| <tt>version</tt> || The version of the mod.<br />
|-<br />
| <tt>link</tt> || An URL that links to the mod.<br />
|-<br />
| <tt>steamContentId</tt> || The workshop's unique id that steam uses. The Mod Uploader Tool available with Starbound's Steam version will fill this automatically.<br />
|-<br />
| <tt>includes</tt> || Any mods listed here will be loaded before this mod, if they exist. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>requires</tt> || Any mods listed here will be '''required''', will be loaded before this mod, and the game will crash at startup if those mods aren't present. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>priority</tt> || The lower the number, the sooner it'll be loaded<ref>https://steamcommunity.com/app/211820/discussions/4/353916838209436654/#c355043117501118531 Mod Load Order, 17 Aug, 2016</ref>. The base assets.pak has a priority of -9999. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
|}<br />
<br />
<noinclude>{{Modding}} {{Category:Modding:Documentation}}</noinclude></div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Metadata_file&diff=172715Modding:Metadata file2017-05-02T00:13:38Z<p>😺: your -> the for consistency</p>
<hr />
<div>The metadata file is [[Modding:JSON|JSON]]-formatted and is entirely optional. It can be called either <code>_metadata</code> or <code>.metadata</code> <ref>http://community.playstarbound.com/threads/how-do-we-format-metadata-files.118150/#post-2957094 <br />
The | Suit, Jul 22, 2016</ref> <!--- with a possible underscore (_) at the end? If someone could confirm http://community.playstarbound.com/threads/uploading-a-mod-onto-the-steam-workshop-step-by-step-how-to.118399/ ---> and is placed at the root of a mod's folder. The [[Modding:Mod_uploader_tool|Mod Uploader Tool]] provides a GUI to edit it.<br />
<br><br><br />
It contains general information about the mod which will be displayed in the mod list on the Starbound title screen, informations the game uses to determine load order if needed, and informations the Mod Uploader Tool uses if needed. Note that parameters' order doesn't matter, and that '''each parameter is optional'''; Starbound will deal without it. You could for example only fill the author field and not put the rest, or put everything but the version number. If you don't need a parameter, don't include it.<br />
<br><br><br />
Here's an example of a metadata file that includes every parameters: <pre><br />
{<br />
"name" : "coolmod",<br />
"friendlyName" : "Cool mod",<br />
"description" : "This a cool mod!",<br />
"author" : "XxX-Cool mod Creator-XxX",<br />
"version" : "2.00 Alpha Gold",<br />
"link" : "http://example.com/coolmod",<br />
"steamContentId" : 000000001,<br />
"includes" : ["coolmodv1"],<br />
"requires" : ["anothermod", "coolmod2"],<br />
"priority" : 0<br />
}</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! Entry !! Description<br />
|-<br />
| <tt>name</tt> || The "behind the scenes" name that is used for other mods' "requires" and "includes" parameters.<br />
|-<br />
| <tt>friendlyName</tt> || The name that'll show up mostly everywhere else.<br />
|-<br />
| <tt>description</tt> || The description of the mod.<br>Type '\n' for a new line, and escape quotations with a \, such as <pre>"description" : "This mod is \"cool\", if you know what I mean.\n:)"</pre><br />
|-<br />
| <tt>author</tt> || The author of the mod.<br />
|-<br />
| <tt>version</tt> || The version of the mod.<br />
|-<br />
| <tt>link</tt> || An URL that links to the mod.<br />
|-<br />
| <tt>steamContentId</tt> || The workshop's unique id that steam uses. The Mod Uploader Tool available with Starbound's Steam version will fill this automatically.<br />
|-<br />
| <tt>includes</tt> || Any mods listed here will be loaded before this mod, if they exist. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>requires</tt> || Any mods listed here will be '''required''', will be loaded before this mod, and the game will crash at startup if those mods aren't present. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>priority</tt> || The lower the number, the sooner it'll be loaded<ref>https://steamcommunity.com/app/211820/discussions/4/353916838209436654/#c355043117501118531 Mod Load Order, 17 Aug, 2016</ref>. The base assets.pak has a priority of -9999. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
|}<br />
<br />
<noinclude>{{Modding}} {{Category:Modding:Documentation}}</noinclude></div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Basics/Helping_Out&diff=172713Modding:Basics/Helping Out2017-05-01T23:38:58Z<p>😺: </p>
<hr />
<div>{{InfoBoxInner|__TOC__|style=float:right;}}<br />
<br />
This page represents a list of needed documentation for [[Modding|modding]]. Feel free to add to it so that someone from the modding community can help contribute. Please tag any created pages with <nowiki>[[Category:Modding]]</nowiki> to help organize the pages into the Modding space. Alternatively add <nowiki>{{Modding}}</nowiki> to the bottom of the page, which will automatically do that and insert a quick navigation for Modding related pages.<br />
<br />
* Category revamp: It'd probably be easier to use if things were categorized by "systems" instead of what they are; for example, Modding:Object/Lua, Modding:Object/Parameters instead of Modding:Lua/Object, Modding:Lua/Parameters, etc<br />
*: Luckily the wiki allows for a page to be in multiple categories so Lua tables could still be accessible via eg. Modding:Lua/Tables or something?<br />
* Clean up [[Modding:Lua/Variables]]: they're missnamed "variables" when it'd more be "parameters", and these pages mix both what the scripts use and what the C++ engine uses<br />
<br />
* [[Modding:Basic_Property_Modification]] rewrite; it talks about the depreciated __merge feature, should be rewrote for the patching feature. [[Modding:Advanced_Modding]] talks about it, maybe use it instead directly?<br />
*: The best probably would be to make a separate page documenting the patching system http://community.playstarbound.com/threads/basic-patching-now-with-path-guide-v1-9.84496/ and separate tutorials making use of it<br />
* [[Asset_Tree]] documentation (exploding folders into their own articles)<br />
* [[Modding/tutorials]] list?<br />
*: There's [[Projects:Guides#Modding Guides]] -- should probably be linked on the [[Modding:Portal]] page<br />
* list of tech moves (not exhaustive, there is also "altFire" and possibly others): http://pastebin.com/Kfa09N7q<br />
* list of all(?) UI elements: http://pastebin.com/tC3WkVP4<br />
*: ^is this still required?<br />
* A page about the Mod Uploader Tool http://community.playstarbound.com/threads/uploading-a-mod-onto-the-steam-workshop-step-by-step-how-to.118399/<br />
*: Maybe separate from a "Upload to the workshop" page?<br />
* Fix / merge [[Modding:.codexitem]] -> [[Modding:.codex]]<br />
* Fix / merge [[.sword]] -> activeitems<br />
* When 1.3 comes out, [[Modding:Lua/Tables/ScriptCanvas]]<br />
<br />
== Using the Templates ==<br />
<br />
There are a few templates that are used across all Modding related pages. The primary one being the Quick Navigation feature, which you can access using <nowiki>{{Modding}}</nowiki>, which consists of many <nowiki>.Nav</nowiki> templates. The first one is at Modding:.nav and from there on you should be able to access all of them.<br />
<br />
=== [//starbounder.org/Category:Lua/Templates Lua Templates] ===<br />
<br />
* [http://starbounder.org/Form:Lua/Function Form-based Assistant] (Use this when editing Lua documentation!)<br />
* http://starbounder.org/Template:Lua/Type<br />
* http://starbounder.org/Template:Lua/Link<br />
* http://starbounder.org/Template:Lua/Variable<br />
* http://starbounder.org/Template:Lua/Function <br />
* http://starbounder.org/Template:Lua/Parameter<br />
* http://starbounder.org/Template:Lua/Argument<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Basics/Helping_Out&diff=172712Modding:Basics/Helping Out2017-05-01T23:35:04Z<p>😺: </p>
<hr />
<div>{{InfoBoxInner|__TOC__|style=float:right;}}<br />
<br />
This page represents a list of needed documentation for [[Modding|modding]]. Feel free to add to it so that someone from the modding community can help contribute. Please tag any created pages with <nowiki>[[Category:Modding]]</nowiki> to help organize the pages into the Modding space. Alternatively add <nowiki>{{Modding}}</nowiki> to the bottom of the page, which will automatically do that and insert a quick navigation for Modding related pages.<br />
<br />
* Category revamp: It'd probably be easier to use if things were categorized by "systems" instead of what they are; for example, Modding:Object/Lua, Modding:Object/Parameters instead of Modding:Lua/Object, Modding:Lua/Parameters, etc<br />
*: Luckily the wiki allows for a page to be in multiple categories so Lua tables could still be accessible via eg. Modding:Lua/Tables or something?<br />
*: Clean up [[Modding:Lua/Variables]]: they're missnamed "variables" when it'd more be "parameters", and these pages mix both what the scripts use and what the C++ engine uses<br />
<br />
* [[Modding:Basic_Property_Modification]] rewrite; it talks about the depreciated __merge feature, should be rewrote for the patching feature. [[Modding:Advanced_Modding]] talks about it, maybe use it instead directly?<br />
*: The best probably would be to make a separate page documenting the patching system http://community.playstarbound.com/threads/basic-patching-now-with-path-guide-v1-9.84496/ and separate tutorials making use of it<br />
* [[Asset_Tree]] documentation (exploding folders into their own articles)<br />
* [[Modding/tutorials]] list?<br />
*: There's [[Projects:Guides#Modding Guides]] -- should probably be linked on the [[Modding:Portal]] page<br />
* list of tech moves (not exhaustive, there is also "altFire" and possibly others): http://pastebin.com/Kfa09N7q<br />
* list of all(?) UI elements: http://pastebin.com/tC3WkVP4<br />
*: ^is this still required?<br />
* A page about the Mod Uploader Tool http://community.playstarbound.com/threads/uploading-a-mod-onto-the-steam-workshop-step-by-step-how-to.118399/<br />
*: Maybe separate from a "Upload to the workshop" page?<br />
* Fix / merge [[Modding:.codexitem]] -> [[Modding:.codex]]<br />
* Fix / merge [[.sword]] -> activeitems<br />
* When 1.3 comes out, [[Modding:Lua/Tables/ScriptCanvas]]<br />
<br />
== Using the Templates ==<br />
<br />
There are a few templates that are used across all Modding related pages. The primary one being the Quick Navigation feature, which you can access using <nowiki>{{Modding}}</nowiki>, which consists of many <nowiki>.Nav</nowiki> templates. The first one is at Modding:.nav and from there on you should be able to access all of them.<br />
<br />
=== [//starbounder.org/Category:Lua/Templates Lua Templates] ===<br />
<br />
* [http://starbounder.org/Form:Lua/Function Form-based Assistant] (Use this when editing Lua documentation!)<br />
* http://starbounder.org/Template:Lua/Type<br />
* http://starbounder.org/Template:Lua/Link<br />
* http://starbounder.org/Template:Lua/Variable<br />
* http://starbounder.org/Template:Lua/Function <br />
* http://starbounder.org/Template:Lua/Parameter<br />
* http://starbounder.org/Template:Lua/Argument<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Basics&diff=172711Modding:Basics2017-05-01T22:47:41Z<p>😺: Made a separate metadata page and included it here</p>
<hr />
<div>{{WorkInProgress}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
This article will show you the steps you need to take before you can start actually modding, and also the steps you can take after you are done modding, to pack and publish your mod.<br />
<br />
You will need a [[Modding:Text Editors|text editor]]. Do not use a word processor such as MS Word instead of a text editor. Also do not use the basic notepad.exe, as it does not support UNIX line endings. Only UTF-8 is supported, other encodings are likely to cause crashes.<br />
<br />
Alternative sources for getting started in modding include the Official Chucklefish Forums, the Unofficial Modding Ebook, the third-party program ModPakHelper that can be used for both unpacking and packing assets, a video, and some more. See [[Modding:Basics#External links|external links]] below.<br />
<br />
= Step 1 - Unpacking Assets =<br />
[[Version_history#Furious_Koala|Furious Koala]] introduced a ''.pak'' format which improves loading times and eases mod distribution. This means we need to unpack the assets before we can start modding.<br />
<br />
Note - This step will not remove or change your ''packed.pak'' file, but simply extract its content for use as reference material. Changes you make to the unpacked assets will have no effect on your game.<br />
<br />
=== Windows ===<br />
''Current as of Version 1.2.2, January 18th, 2017''<br />
# Open up the main directory folder for Starbound.<br />
# Shift + right-click within the folder and select ''Open Command Prompt'' or equivalent (depends on Windows version).<br />
# Type the following into ''Command Prompt'': <code>"win32\asset_unpacker.exe" "assets\packed.pak" "_UnpackedAssets"</code><br />
# ''Command Prompt'' will do nothing until ''asset_unpacker.exe'' has finished. There are no progress updates.<br />
# Once ''Command Prompt'' displays a message equivalent to this, "Unpacked assets to _UnpackedAssets in 250.063s," you can close the program and move on to creating mods.<br />
<br />
'''<big>Notes</big>'''<br />
*If purchased from Steam, the location of the main Starbound directory folder typically looks like this: <CODE>Steam\steamapps\common\Starbound</CODE><br />
*The text typed into ''Command Prompt'' are three directory locations:<br />
*# The location of ''asset_unpacker.exe'', which is the program that does all of the unpacking.<br />
*# The location of Starbound assets, or Mod assets, to be unpacked.<br />
*# Where you want the unpacked assets to be dumped. This third string can be changed to whichever location or name you prefer.<br />
<br />
=== Mac ===<br />
'''''<font color="red">Possibly outdated</font>'''''<br />
<br />
Right click on Starbound.app and select "Show Package Contents". Next, locate your ''packed.pak'' file under ''Starbound/assets/''. Finally create a new directory for the unpacked files, for example ''Starbound/assets/unpacked/''.<br />
<br />
Now open your command prompt window and enter first the location of ''asset_unpacker'', then the location of ''packed.pak'', and lastly the directory you want to unpack it into. '''Let the script run'''. When it finishes, you should see a long list of files and folders in the location you chose.<br />
<br />
= Step 2 - Setting Up Your First Mod =<br />
The Starbound/mods folder is where you're going to place .pak files or unpacked mods folders. Create a directory inside this.<br />
===metadata file===<br />
{{Modding:Metadata_file}}<br />
<br />
= Step 3 - Modding =<br />
=== Tutorials ===<br />
* [[Basic Property Modification|Editing Vanilla Files]]<br />
<br />
=== Reference Pages ===<br />
* [[Data:Assets|Data Assets]]<br />
* [[Modding:Materials:Mods|New Custom Material ID Registration]]<br />
* [[Modding:Liquids:Mods|New Custom Liquid ID Registration]]<br />
<br />
If you did everything right, Starbound should load your new mod the next time you run it. If the game crashes, or your changes are not found in the game, check your [http://community.playstarbound.com/index.php?threads/how-to-report-mod-errors-fixing-most-problems-yourself.69198/ starbound.log] file.<br />
<br />
= Step 4 - Packing your mod =<br />
Before publishing your mod, it is better to pack it as a single ''<modname>.pak'' file.<br />
This process is recommended because it simplifies the installation (drop the file in the ''Starbound/mods/'' folder), as well as the required I/O to read it. The alternative is to just put all the files into a zip archive.<br />
<br />
To pack your mod, use the asset_packer(.exe) tool the same way you've used asset_unpacker to unpack your assets, or use ModPackHelper:<br />
<br />
=== Windows/Linux with ModPackHelper ===<br />
# If you haven't done it already, install modPackHelper (Simply drag script into Starbound\mods folder (and give executable rights for .sh))<br />
# Select the "pack mods" action<br />
# Choose the mod from the list (or set multiple choice with space, comma or semicolon)<br />
# Press Enter. The mod is available in the ''Starbound/mods/'' folder as <modname>.pak.<br />
<br />
= Step 5 - Publishing =<br />
Only one thing left to do - publish your mod! To do this, go to the official [http://community.playstarbound.com/index.php?resources/ modding forums], select "add mod" in the upper right hand section, select the category of your mod, fill out the information form and hit save. It is that easy.<br />
The Steam version provides an utility to pack and upload mods to the Steam Workshop directly (and can also generate your _metadata file).<br />
<br />
There are other places mods can be uploaded, or you can just share it with friends. What you do with your mod is up to you!<br />
<br />
= External links =<br />
* [http://community.playstarbound.com/forums/starbound-modding.111/ Chucklefish Forums - Starbound Modding]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/how-to-successfully-pack-and-unpack-pak-files.66649/ How to successfully pack and unpack .pak files]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/getting-started-in-making-mods-for-starbound.122055/ Getting started in making mods for Starbound]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/all-versions-win-linux-modpackhelper.92473/ ModPackHelper]<br />
* Chucklefish Mods: [http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/ Unofficial Modding Ebook 2.0]<br />
* Youtube: [https://www.youtube.com/watch?v=kAVn7JoYHp0 Starbound Tutorial, From Unpacking to Distribution and Everything Inbetween v1.2+ ]<br />
* Chucklefish Forums: [http://community.playstarbound.com/forums/starbound-modding.111/?prefix_id=52 Browse the "tutorial" tag] for more diverse and in-depth tutorials.<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Metadata_file&diff=172710Modding:Metadata file2017-05-01T22:44:46Z<p>😺: Created page with "The metadata file is JSON-formatted and is entirely optional. It can be called either <code>_metadata</code> or <code>.metadata</code> <ref>http://community.p..."</p>
<hr />
<div>The metadata file is [[Modding:JSON|JSON]]-formatted and is entirely optional. It can be called either <code>_metadata</code> or <code>.metadata</code> <ref>http://community.playstarbound.com/threads/how-do-we-format-metadata-files.118150/#post-2957094 <br />
The | Suit, Jul 22, 2016</ref> <!--- with a possible underscore (_) at the end? If someone could confirm http://community.playstarbound.com/threads/uploading-a-mod-onto-the-steam-workshop-step-by-step-how-to.118399/ ---> and is placed at the root of a mod's folder. The [[Modding:Mod_uploader_tool|Mod Uploader Tool]] provides a GUI to edit it.<br />
<br><br><br />
It contains general information about the mod which will be displayed in the mod list on the Starbound title screen, informations the game uses to determine load order if needed, and informations the Mod Uploader Tool uses if needed. Note that parameters' order doesn't matter, and that '''each parameter is optional'''; Starbound will deal without it. You could for example only fill the author field and not put the rest, or put everything but the version number. If you don't need a parameter, don't include it.<br />
<br><br><br />
Here's an example of a metadata file that includes every parameters: <pre><br />
{<br />
"name" : "coolmod",<br />
"friendlyName" : "Cool mod",<br />
"description" : "This a cool mod!",<br />
"author" : "XxX-Cool mod Creator-XxX",<br />
"version" : "2.00 Alpha Gold",<br />
"link" : "http://example.com/coolmod",<br />
"steamContentId" : 000000001,<br />
"includes" : ["coolmodv1"],<br />
"requires" : ["anothermod", "coolmod2"],<br />
"priority" : 0<br />
}</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! Entry !! Description<br />
|-<br />
| <tt>name</tt> || The "behind the scenes" name that is used for other mods' requires and includes options<br />
|-<br />
| <tt>friendlyName</tt> || The name that will show up in the mod list menu.<br />
|-<br />
| <tt>description</tt> || The description of the mod.<br>Type '\n' for a new line, and escape quotations with a \, such as <pre>"description" : "This mod is \"cool\", if you know what I mean.\n:)"</pre><br />
|-<br />
| <tt>author</tt> || The author of the mod.<br />
|-<br />
| <tt>version</tt> || The version of your mod.<br />
|-<br />
| <tt>link</tt> || An URL that links to the mod.<br />
|-<br />
| <tt>steamContentId</tt> || The workshop's unique id that steam uses. The Mod Uploader Tool available with Starbound's Steam version will fill this automatically.<br />
|-<br />
| <tt>includes</tt> || Any mods listed here will be loaded before this mod, if they exist. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>requires</tt> || Any mods listed here will be '''required''', will be loaded before this mod, and the game will crash at startup if those mods aren't present. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>priority</tt> || The lower the number, the sooner it'll be loaded<ref>https://steamcommunity.com/app/211820/discussions/4/353916838209436654/#c355043117501118531 Mod Load Order, 17 Aug, 2016</ref>. The base assets.pak has a priority of -9999. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
|}<br />
<br />
<noinclude>{{Modding}} {{Category:Modding:Documentation}}</noinclude></div>😺https://starbounder.org/mediawiki/index.php?title=.sword&diff=172709.sword2017-05-01T22:00:59Z<p>😺: Added a notice about outdated info</p>
<hr />
<div>'''''<font color="red">Note: this page is outdated, .sword files were changed to .activeitem files</font> --[[User:😺|😺]] ([[User talk:😺|talk]]) 23:00, 1 May 2017 (BST)'''''<br />
[[Category:JSON]]<br />
{|class="wikitable"<br />
|"itemName" || The itemname used in interlinking and spawning<br />
|-<br />
|"level" || The weapon-level, determines the strength of the sword (see also: levelingmultipliers)<br />
|-<br />
|"dropCollision" || An array of collider-points that's used when the weapon is dropped<br />
|-<br />
|"maxStack" || The maximum of items that one stack can contain<br />
|-<br />
|"rarity" || Defines the rarity of the item (influences the border color and sometimes the multiplier). Possible values: "common", "uncommon", "rare", "legendary"<br />
|-<br />
|"description" || The description of the item as found in the items tooltip<br />
|-<br />
|"shrotdescription" || The actual name of the item as shown ingame<br />
|-<br />
|"tooltipKind" || The kind of tooltip, influences the tooltip-style (only "sword" is ever used in .sword files)<br />
|-<br />
|"weaponType" || Defines the weapon type (Axes use "Axe", Broadswords use "Broadsword" and so on)<br />
|-<br />
|"image" || Relative path to the weapons image file (.png)<br />
|-<br />
|"firePosition" || Defines where the muzzle-effect is played relative to the frames PZ.<br />
|-<br />
|"fireTime" || Time value that affects attack speed (not "how fast it's fired" but "how long does it take to fire"!)<br />
|-<br />
|"fireAfterWindup" || [Guess] Faster attacks after the windup stance if set to true<br />
|-<br />
|"soundEffect" || Absolute path to the soundfile that's played when attacking (usual usage: { "fireSound" : [ {"file" : "/sfx/xx/xx/xx.wav"}]} )<br />
|-<br />
|"colorOptions" || Hex-directive replacement (Usual syntax: "ffca8a" : "b5b5b5" = "Where hex-value ffca8a, replace with hex-value b5b5b5")<br />
|-<br />
|"primaryStances" || The class for primary-stance functions<br />
|-<br />
|"directional" || Used to give / take the possibility of attacking in directional patterns. false = only linear, true = can hit in any direction<br />
|-<br />
|"projectileType" || Defines the projectile used for the sword, defined and set-up in the .projectile files<br />
|-<br />
|"projectile" || class to change the projectiles parameters<br />
|-<br />
|"speed" || Defines how fast the projectile is<br />
|-<br />
|"power" || Defines how strong the projectile is<br />
|-<br />
|"idle" || The class for idle-state functions<br />
|-<br />
|"twoHanded" || Defines if the weapon is held with two hands or not (during stances)<br />
|-<br />
|"armAngle" || Used to adjust weapons placement while held<br />
|-<br />
|"swordAngle" || Used to adjust weapons placement while held<br />
|-<br />
|"handPosition" || Used to adjust weapons placement while held<br />
|-<br />
|"duration" || The duration it takes for the weapon to enter (or to leave?) the current state on action<br />
|-<br />
|"windup" || The class for windup-state functions<br />
|-<br />
|"statusEffects" || Used to add certain statusEffects for specific stances, always an array<br />
|-<br />
|"cooldown" || The class for cooldown-state functions<br />
|-<br />
|"parryBlockCooldown" || The cooldown length that kicks in after a parry<br />
|-<br />
|"parrySound" || Absolute path to the soundfile used while parrying<br />
|-<br />
|"parryParticle" || Defines which particles are emitted during a successful parry (.particles file)<br />
|-<br />
|"altStances" || This is the class for alternative stances, usually used for parry in the case of swords<br />
|-<br />
|"type" || Defines the actual type of the altStance.<br />
|-<br />
|"rescaleTiming" || [Needs more info] I don't actually have a clue for this, but it's always set to "false" for swords<br />
|-<br />
|"parryPoly" || The collider-array that's applied to the weapon while parrying<br />
|}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:.codexitem&diff=172708Modding:.codexitem2017-05-01T21:59:49Z<p>😺: Added a notice about outdated info</p>
<hr />
<div>'''''<font color="red">Note: this page is outdated, .codexitems were changed to .codex items</font> --[[User:😺|😺]] ([[User talk:😺|talk]]) 22:59, 1 May 2017 (BST)'''''<br />
[[Category:JSON]]<br />
{|class="wikitable"<br />
|"codexId" || The link to the codex-entry, that's not the item's name!<br />
|-<br />
|"title" || The title of the codex-entry<br />
|-<br />
|"codexkind" || The kind of the codex, usually "codex"<br />
|-<br />
|"inventoryIcon" || Relative path to the icon that's used for the item (.png)<br />
|-<br />
|"itemName" || The name used for interlinking and spawning (of the item, not the codex-entry)<br />
|-<br />
|"rarity" || Influences the border-color (viable values: "common", "uncommon", "rare", "legendary")<br />
|-<br />
|"description" || The actual description as shown in the item's tooltip<br />
|-<br />
|"shortdescription" || The items name as shown ingame<br />
|}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Lua/Tables/ScriptCanvas&diff=172707Modding:Lua/Tables/ScriptCanvas2017-05-01T20:31:44Z<p>😺: Added a notice about outdated info</p>
<hr />
<div>'''''<font color="red">Note: this page is mostly outdated. These bindings will be moved to the widget table in 1.3</font> --[[User:😺|😺]] ([[User talk:😺|talk]]) 21:31, 1 May 2017 (BST)'''''<br />
== scriptCanvas ==<br />
<br />
The scriptCanvas is an awesome tool you can use to make custom interfaces.<br />
<br />
See the [http://playstarbound.com/october-14th-interface-foundations/ original dev blog entry] for more information.<br />
<br />
<br />
=== Functions ===<br />
<br />
* canvasDrawText(text, {position = x, y}}, fontsize, {r, g, b [, a]})<br />
* canvasDrawImage("/interface/quest.png", {50, 50}, 1)<br />
* canvasDrawImageRect("someimage.png", {sourceX,sourceY, sourceX2,sourceY2}, {destX, destY, destX2,destY2}, {r,g,b[,a]})<br />
* canvasDrawRect({x1, y1, x2, y2}, {color})<br />
* configParameter() -- retrieve values from .config file<br />
* canvasMousePosition()<br />
* canvasDrawLine({x1, y1}, {x2, y2}, {color}, width)<br />
* sourceEntity() -- entity id of the object tied to the console<br />
* canvasDrawPoly({list of coordinate pairs},{color})<br />
* canvasDrawImageCentered("/interface/quest.png", {50, 50}, 1)<br />
* dismiss() -- close window<br />
* playSound<br />
<br />
=== Callbacks ===<br />
<br />
<br />
* canvasKeyEvent(key, keyDown)<br />
* canvasClickEvent(position, button, buttonDown)<br />
<br />
=== The Origin Story ===<br />
<br />
<kyren> what about<br />
<kyren> what about what about whata bout<br />
<kyren> whaaaaaat about<br />
<kyren> a client side, lua based<br />
<kyren> window<br />
<kyren> that has a connection to an object<br />
<kyren> and drawing primitive operations<br />
...<br />
<kyren> okay doing that<br />
<kyren> this weekend<br />
<br />
...And the rest was history!<br />
<br />
<br />
=== Links ===<br />
<br />
* Available functions and arguments: http://pastebin.com/3Ekd3by4 (fixed drawRect)<br />
<br />
* A couple sample mods, including Metadept's "Pong" and Kyren's "Lights Out": http://metadept.com/starbound/testconsoles.zip<br />
<br />
* API dump from within Kyren's testconsole: http://pastebin.com/3m2kEieU<br />
<br />
* SeveredSkullz IMGUI library project for interface API: http://community.playstarbound.com/index.php?threads/imgui-library-for-interface-api.85161/<br />
<br />
* Neurisko's computer project: http://community.playstarbound.com/index.php?threads/my-in-game-scriptcanvas-based-computer-apex64-bananastar-8200.85178/<br />
<br />
* Member function documentation: http://doc.playstarbound.com/classStar_1_1CanvasWidget.html#a8b0ccf7e472ab70120fd5fc4575985b6<br />
<br />
* Text color codes: http://pastebin.com/Tr0AGj4G<br />
<br />
* scriptCanvas Environment Dump: http://pastebin.com/xcyNXQEk<br />
<br />
* MrMagical's Persistent Storage: http://pastebin.com/DtWDSWZ4<br />
<br />
* SpiderDave's [http://community.playstarbound.com/index.php?resources/robot-spider-invasion-rampaging-koala.2325/ spider fighting game] and his [http://pastebin.com/ayVQ5vvq circle drawing function].<br />
<br />
* PenguinToast's Object-oriented GUI library: http://penguintoast.github.io/PenguinGUI/<br />
<br />
* RPC-like functionality (healthire) http://pastebin.com/RjTZWLAc<br />
<br />
* PenguinToast's StarModMenu mod for mod user interfaces: http://community.playstarbound.com/index.php?resources/starmodmenu.2368/<br />
<br />
=== Notes ===<br />
<br />
* <strike>You have to click on a canvas window to gain focus before it will recognize input.</strike> Fixed<br />
* There is an off-by-one error with displaying graphics within the canvas; the right and bottom sides are off by one pixel. Maybe? I dunno, maybe I'm doing it wrong. --Neurisko<br />
* canvasClickEvent now has a third parameter "buttonDown". The Lights Out Game needs a small modification to account for this.<br />
* canvasDrawText has weird behavior where if the string starts with a space, it will remove that space, but not any following spaces. Bug?<br />
<br />
= Quick Navigation =<br />
{{Modding}}<br />
[[Category:Lua/Hooks|Self]]<br />
[[Category:Lua|Hooks: Self]]</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Portal&diff=172706Modding:Portal2017-05-01T20:25:55Z<p>😺: Removing outdated info</p>
<hr />
<div>{{Modding}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
<br />
Many aspects of Starbound are available for modifying or expanding, from items and monsters, to villagers, towns, and even whole planets.<br />
<br />
= Installing Mods =<br />
Chucklefish Games provides two official sources for mods, the [http://community.playstarbound.com/resources/categories/starbound.21/ Starbound Mod Repository] and the [http://community.playstarbound.com/forums/mod-releases-wips.103/ Starbound Modding Forum]. Steam users can also browse the [http://steamcommunity.com/app/211820/workshop/ Steam Workshop]. Once downloaded, you will want to place the files within Starbound's mod directory: <br />
: <font face="Starbound">Starbound\mods\</font><br />
If purchased from Steam, the location of the main Starbound directory folder typically looks like this: <br />
:<font face="Starbound">Steam\steamapps\common\Starbound</font><br />
Workshop mods are automatically downloaded in <font face="Starbound">Steam\steamapps\workshop\content\211820</font>.<br><br />
They do not need to be moved to the Starbound\mods\ folder, the game will load them automatically.<br />
<br />
<br />
Mods can be found in three forms:<br />
* compressed (.zip, .7zip, .rar, ...): those are generally unpacked compressed mods. Starbound cannot handle them, and you'll have to unzip them first.<br />
* unpacked: those are the raw files, directories, etc.<br />
*: <font face="Starbound">\mods\''modname''</font><br />
* packed (.pak): those are "packed" in a format that Starbound can read, and is generally prefered for faster loading.<br />
*: <font face="Starbound">\mods\''modname.pak''</font><br />
<br />
A more in-depth installation guide is available [http://community.playstarbound.com/threads/installing-mods-for-starbound-1-0.118081/ on the official forum].<br />
<br />
= How do I mod Starbound? =<br />
<br />
The moddable assets are located in the [[Modding:Asset_Tree|Asset Tree]], which is located in your Starbound directory under /Starbound/assets. There are several types of assets. Editing an existing asset will change the base behavior of the game. You can add new assets, although getting those assets into the game may be tricky depending on what you're trying to add. The official modding forums are the best source of up-to-date information on specifics.<br />
<br />
* [[Modding:JSON_Object_Types|JSON Objects]]: There are hundreds of [[Modding:JSON|JSON]] configuration files in various directories inside /assets/, with dozens of different extensions, like .config, .frames, .animation, .gun, etc. Any files with extensions that do not match the ones listed below are probably JSON config files.<br />
* [[Modding:Lua Language|Lua Scripting]]: Monsters, NPCs, and certain objects use Lua scripts to control their behavior. Lua scripting has a lot of potential, but currently suffers from severe scoping limitations. Lua files always end with the extension ".lua." The Lua API is documented in some Lua files in the 'Starbound/doc/lua' game's folder, and is also [[Modding:Lua API|explained here]] and although it may sometimes be a little outdated, should help.<br />
* Sound files: File extensions are either ".wav" or ".ogg"<br />
* Graphics: File extension is ".png" for graphics.<br />
<br />
= Yeah man, but how do I mod Starbound?! =<br />
The developers are very responsive to requests from the community and have already implemented some things by request since the beginning of beta. The best way for you to learn how to mod is go to the official forums, do a bunch of reading, look at some existing mods, and of course do extensive browsing of the asset files until you form some understanding of them.<br />
<br />
* Multiple ressources are available to get you started, pick your media of preference:<br />
** [[Modding:Basics|The Modding Basics]] is a step-by-step guide on this very wiki<br />
** [http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/ An unofficial ebook] was created especially for those completely new to the modding scene.<br />
** [https://www.youtube.com/watch?v=kAVn7JoYHp0 This video] covers everything from how to unpack your Starbound assets to making a basic decorative custom object, how to make a recipe for that object, how to learn that recipe and finally how to pack and distribute it when you are done<br />
** For more specific needs, the official forums have [http://community.playstarbound.com/forums/starbound-modding.111/?prefix_id=52 a "tutorial" tag that you can browse].<br />
<br />
* Information on the [[Modding:Lua_API|Lua API]] is documented in .md files in the Starbound/doc/lua folder.<br />
<br />
* If you have any problems, comb through the included assets. They are a rich source of examples you can follow. Before you try to make anything complex, you should start with copying something simple.<br />
<br />
* You can also download some sample mods (make sure they are up to date, as the mod specifications changed a few times in the beta) to learn from.<br />
<br />
= Where is ''feature X''? =<br />
Now that the game is officially released, if there is a feature that is in your opinion missing from the game, you are free to submit mod requests at [http://community.playstarbound.com/forums/modding.111/ Offical Starbound Mod Forums]. Another area that allows modding requests is the subreddit [https://www.reddit.com/r/starboundmods/ /r/starboundmods].<br />
<br />
= Text Editing =<br />
==== What text editor should I use? ====<br />
This is a complex question, but the simple answer is, "Just about anything except Windows Notepad."<br />
<br />
We have a list of [[Modding:Text Editors|suggested text editors]] and a few tips for using them with JSON and Lua.<br />
<br />
= Graphics Editing =<br />
==== What image editor should I use? ====<br />
<br />
Please see this [[Modding:Image Editing|list of suggested image editors.]] There's a guide detailing the game's specific art styling [[Guide:Art|here]].<br />
<br />
= Troubleshooting =<br />
<br />
=== My game keeps crashing! ===<br />
<br />
You can start by checking the [[Modding:Starbound_Log_File|log file]]. You can find errors in there telling you which line in your code caused the crash. Loading the multiplayer server will give you a console, but restarting it frequently is tedious.<br />
<br />
An online [[Modding:JSON|JSON]] parser will help catch some common mistakes, such as missing commas and unmatched braces in your modified files. For more information about JSON, see the [[Modding:JSON|JSON]] page, or see the index of JSON configuration file types [[Modding:JSON Object Types|here]].<br />
<br />
= How can I help the modding community? =<br />
<br />
Check out [[Modding:Modding/DocumentationTODO]] to see a list of things that need to be done for modding documentation on this wiki.<br />
<br />
<br />
= Where can I get more information? =<br />
<br />
[http://community.playstarbound.com/forums/starbound-modding.111/ The official modding forums]<br />
<br />
[https://discordapp.com/invite/Starbound The official discord server] has a #modding channel<br />
<br />
There is also the IRC channel ##starbound-modding on the Freenode network, which can be accessed [http://webchat.freenode.net/?channels=%23%23starbound-modding&uio=d4 here]. Please note that this channel is dedicated to the ins and outs of modding, and is '''not''' the place to ask about a mod you downloaded! We don't kick or ban for minor netiquette breaches, but if the room is busy, be courteous and obey the rules or you may have a problem.<br />
<br />
If you use the IRC channel, follow these simple rules:<br />
* Use a pastebin like pastebin.com for anything over 2-3 lines.<br />
* Check the [http://starbounder.org/Modding:Starbound_Log_File log files] first. If there's an error you don't understand and want us to look at, post it on a pastebin for us to look at, along with any relevant code.<br />
* Do not spam the chat with excessive emotes or offtopic chat. Some offtopic is fine, but if people are talking about modding, try not to spam up the chat with fluff. You can go to #starbound or #starbound-overflow for that.<br />
* Constructive criticism is welcome, but be thoughtful and respectful of others.<br />
* Don't walk into chat and ask "hay guise how do i mod lol." We're all bootstrapping our own modding efforts by doing a lot of reading through the example code, reading others' mods, and experimentation.</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Lua/Hooks/Quest&diff=172705Modding:Lua/Hooks/Quest2017-05-01T20:19:42Z<p>😺: Tagging to Lua/Hooks category, reformatting to fit the Lua tables's format</p>
<hr />
<div><div style="float:right;">__TOC__</div><br />
= Hooks =<br />
<br />
These quest hooks are stubs for global functions that object scripts can define, which will be called by the C++ engine. No documentation for them is available, but they're mentionned (april 2017) in /assets/quests/scripts/generated/common.lua<br />
<div id="moddingcode"><br />
===<code>init()</code>===<br />
<br />
<hr><br />
<br />
Called when the quest is loaded<br />
===<code>uninit()</code>===<br />
<br />
<hr><br />
<br />
Called when the quest is unloaded<br />
===<code>update(dt)</code>===<br />
<br />
<hr><br />
<br />
Called each scriptDelta ticks<br />
===<code>questOffer()</code>===<br />
<br />
<hr><br />
<br />
Called when the quest is offered<br />
===<code>questDecline()</code>===<br />
<br />
<hr><br />
<br />
Called when the player declines the quest<br />
===<code>questStart()</code>===<br />
<br />
<hr><br />
<br />
Called when the player accepts the quest<br />
===<code>questComplete()</code>===<br />
<br />
<hr><br />
<br />
Called when the player completes the quest<br />
===<code>questFail()</code>===<br />
<br />
<hr><br />
<br />
Called when the player fails the quest<br />
===<code>questInteract(entityId)</code>===<br />
<br />
<hr><br />
<br />
Called when the player interacts with something?<br />
===<code>conditionsMet()</code>===<br />
<br />
<hr><br />
<br />
Called when the player meets the requirements to return the quest?<br />
<br />
<br><br />
= Messages =<br />
Alternatively, the C++ engine sends messages to quest scripts which can be handled by <code>message.setHandler()</code>.<br />
<br />
<hr><br />
<br />
===<code>objectScanned</code>===<br />
Seems to be sent whenever the player scans an object.<br />
Parameters:<br />
objectName<br />
<br />
<hr><br />
<br />
===<code>interestingObjects</code>===<br />
Seems to be sent whenever the player scans an "interesting" object, in the context of scan-type quests.<br />
</div><br />
{{Modding}}<br />
[[Category:Lua/Hooks/|Quest]]<br />
[[Category:Lua/Hooks/: Quest]]</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Starbound_Log_File&diff=172704Modding:Starbound Log File2017-05-01T20:11:46Z<p>😺: </p>
<hr />
<div>{{InfoBoxInner|__TOC__|style=float:right;}}<br />
The Starbound log file is a text file where the game engine writes a lot of debugging and status information, along with errors. Lua scripts can also write to it by using [[Modding:Lua/Tables/Utility&action=submit#void_sb.logInfo.28String_formatString.2C_.5BLuaValue_formatValues_....5D.29|sb.logInfo()]] and similar utility functions.<br />
This file can get quite large, and is rotated everytime the game restart. This means "starbound.log" becomes "starbound.log.0", "starbound.log.0" becomes "starbound.log.1" and so on.<br />
<br />
==File location==<br />
You can find your log files at this path:<br />
: <font face="Starbound">Starbound/starbound.log</font><br />
Or for steam:<br />
:<font face="Starbound">SteamApps/common/Starbound/starbound.log</font><br />
If you run a server, there is a log file specifically for it:<br />
: <font face="Starbound">Starbound/starbound_server.log</font><br />
: <font face="Starbound">Steam/SteamApps/common/Starbound/starbound_server.log</font><br />
<br />
==Monitoring the file in real-time==<br />
For debug purposes, it can be interesting to see what gets written to this file in real-time. There are tools you can use to monitor it as it update in (almost) realtime. On Linux & MacOS, the most common would be, from a console:<br />
<code>tail -f starbound.log</code><br />
<br />
For Windows, there are several tail-like options with graphical interface such as [http://ophilipp.free.fr/op_tail.htm mTail].<br />
If you prefer the *nix-like tools, you can use [http://www.cygwin.com/ Cygwin] and, on the latest versions of Windows, the [https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux Windows Subsystem for Linux]; for more informations, refer to your favorite search engine.<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Starbound_Log_File&diff=172703Modding:Starbound Log File2017-05-01T20:10:57Z<p>😺: Removing outdated info, rewording, added sections and mention of sb.logInfo etc</p>
<hr />
<div>{{InfoBoxInner|__TOC__|style=float:right;}}<br />
The Starbound log file is a text file where the game engine writes a lot of debugging and status information, along with errors. Lua scripts can also write to it by using [[Modding:Lua/Tables/Utility&action=submit#void_sb.logInfo.28String_formatString.2C_.5BLuaValue_formatValues_....5D.29|sb.logInfo()]] and similar utility functions.<br />
This file can get quite large, and is rotated everytime the game restart. This means "starbound.log" becomes "starbound.log.0", "starbound.log.0" becomes "starbound.log.1" and so on.<br />
<br />
==File location==<br />
You can find your log files at this path:<br />
: <font face="Starbound">Starbound/starbound.log</font><br />
Or for steam:<br />
:<font face="Starbound">SteamApps/common/Starbound/starbound.log</font><br />
If you run a server, there is a log file specifically for it:<br />
: <font face="Starbound">Starbound/starbound_server.log</font><br />
: <font face="Starbound">Steam/SteamApps/common/Starbound/starbound_server.log</font><br />
<br />
==Monitoring the file in real-time==<br />
For debug purposes, it can be interesting to see what gets written to this file. There are tools you can use to monitor it as it update in (almost) realtime. On Linux & MacOS, the most common would be, from a console:<br />
<code>tail -f starbound.log</code><br />
<br />
For Windows, there are several tail-like options with graphical interface such as [http://ophilipp.free.fr/op_tail.htm mTail].<br />
If you prefer the *nix-like tools, you can use [http://www.cygwin.com/ Cygwin] and, on the latest versions of Windows, the [https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux Windows Subsystem for Linux]; for more informations, refer to your favorite search engine.<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Basics&diff=172694Modding:Basics2017-05-01T10:18:07Z<p>😺: /* Step 2 - Setting Up Your First Mod */</p>
<hr />
<div>{{WorkInProgress}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
This article will show you the steps you need to take before you can start actually modding, and also the steps you can take after you are done modding, to pack and publish your mod.<br />
<br />
You will need a [[Modding:Text Editors|text editor]]. Do not use a word processor such as MS Word instead of a text editor. Also do not use the basic notepad.exe, as it does not support UNIX line endings. Only UTF-8 is supported, other encodings are likely to cause crashes.<br />
<br />
Alternative sources for getting started in modding include the Official Chucklefish Forums, the Unofficial Modding Ebook, the third-party program ModPakHelper that can be used for both unpacking and packing assets, a video, and some more. See [[Modding:Basics#External links|external links]] below.<br />
<br />
= Step 1 - Unpacking Assets =<br />
[[Version_history#Furious_Koala|Furious Koala]] introduced a ''.pak'' format which improves loading times and eases mod distribution. This means we need to unpack the assets before we can start modding.<br />
<br />
Note - This step will not remove or change your ''packed.pak'' file, but simply extract its content for use as reference material. Changes you make to the unpacked assets will have no effect on your game.<br />
<br />
=== Windows ===<br />
''Current as of Version 1.2.2, January 18th, 2017''<br />
# Open up the main directory folder for Starbound.<br />
# Shift + right-click within the folder and select ''Open Command Prompt'' or equivalent (depends on Windows version).<br />
# Type the following into ''Command Prompt'': <code>"win32\asset_unpacker.exe" "assets\packed.pak" "_UnpackedAssets"</code><br />
# ''Command Prompt'' will do nothing until ''asset_unpacker.exe'' has finished. There are no progress updates.<br />
# Once ''Command Prompt'' displays a message equivalent to this, "Unpacked assets to _UnpackedAssets in 250.063s," you can close the program and move on to creating mods.<br />
<br />
'''<big>Notes</big>'''<br />
*If purchased from Steam, the location of the main Starbound directory folder typically looks like this: <CODE>Steam\steamapps\common\Starbound</CODE><br />
*The text typed into ''Command Prompt'' are three directory locations:<br />
*# The location of ''asset_unpacker.exe'', which is the program that does all of the unpacking.<br />
*# The location of Starbound assets, or Mod assets, to be unpacked.<br />
*# Where you want the unpacked assets to be dumped. This third string can be changed to whichever location or name you prefer.<br />
<br />
=== Mac ===<br />
'''''<font color="red">Possibly outdated</font>'''''<br />
<br />
Right click on Starbound.app and select "Show Package Contents". Next, locate your ''packed.pak'' file under ''Starbound/assets/''. Finally create a new directory for the unpacked files, for example ''Starbound/assets/unpacked/''.<br />
<br />
Now open your command prompt window and enter first the location of ''asset_unpacker'', then the location of ''packed.pak'', and lastly the directory you want to unpack it into. '''Let the script run'''. When it finishes, you should see a long list of files and folders in the location you chose.<br />
<br />
= Step 2 - Setting Up Your First Mod =<br />
The Starbound/mods folder is where you're going to place .pak files or unpacked mods folders. Create a directory inside this.<br />
===_metadata file===<br />
The _metadata file is entirely optional. It is placed at the root of a mod's folder, and contains general information about the mod which will be displayed in the mod list on the Starbound title screen, and informations the game uses to determine load order if needed. Note that parameter's order doesn't matter, and that '''each parameter is optional'''; Starbound will deal without it. You could for example only fill the author field and not put the rest, or put everything but the version number. If you don't need a parameter, don't write it.<br />
<br />
A _metadata file including every parameters looks like this<pre><br />
{<br />
"version" : "2.00 Alpha Gold",<br />
"friendlyName" : "Cool mod",<br />
"link" : "http://example.com/coolmod",<br />
"name" : "coolmod",<br />
"description" : "This a cool mod!",<br />
"author" : "NAME",<br />
"steamContentId" : 000000001,<br />
"requires" : ["anothermod", "coolmod2"],<br />
"includes" : ["coolmodv1"],<br />
"priority" : 0<br />
}</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! Entry !! Description<br />
|-<br />
| <tt>version</tt> || The version number of your mod.<br />
|-<br />
| <tt>friendlyname</tt> || The name that will show up in the mod list menu.<br />
|-<br />
| <tt>link</tt> || A URL that links to the mod.<br />
|-<br />
| <tt>name</tt> || The "behind the scenes" name that is used for other mods' requires and includes options<br />
|-<br />
| <tt>description</tt> || The description of the mod. Type '\n' for a new line, and escape quotations with a \, such as <pre>"description" : "This mod is \"cool\", if you know what I mean."</pre><br />
|-<br />
| <tt>author</tt> || The author of the mod.<br />
|-<br />
| <tt>steamContentId</tt> || The workshop's unique id that steam uses. The Mod Uploader Tool available with Starbound's Steam version will fill this automatically.<br />
|-<br />
| <tt>priority</tt> || The lower the number, the sooner it'll be loaded. The base assets.pak has a priority of -9999. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>includes</tt> || Any mods listed here will be loaded before this mod, if they exist. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>requires</tt> || Any mods listed here will be '''required''' and the game will crash at startup if those mods aren't present. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
|}<br />
<br />
= Step 3 - Modding =<br />
=== Tutorials ===<br />
* [[Basic Property Modification|Editing Vanilla Files]]<br />
<br />
=== Reference Pages ===<br />
* [[Data:Assets|Data Assets]]<br />
* [[Modding:Materials:Mods|New Custom Material ID Registration]]<br />
* [[Modding:Liquids:Mods|New Custom Liquid ID Registration]]<br />
<br />
If you did everything right, Starbound should load your new mod the next time you run it. If the game crashes, or your changes are not found in the game, check your [http://community.playstarbound.com/index.php?threads/how-to-report-mod-errors-fixing-most-problems-yourself.69198/ starbound.log] file.<br />
<br />
= Step 4 - Packing your mod =<br />
Before publishing your mod, it is better to pack it as a single ''<modname>.pak'' file.<br />
This process is recommended because it simplifies the installation (drop the file in the ''Starbound/mods/'' folder), as well as the required I/O to read it. The alternative is to just put all the files into a zip archive.<br />
<br />
To pack your mod, use the asset_packer(.exe) tool the same way you've used asset_unpacker to unpack your assets, or use ModPackHelper:<br />
<br />
=== Windows/Linux with ModPackHelper ===<br />
# If you haven't done it already, install modPackHelper (Simply drag script into Starbound\mods folder (and give executable rights for .sh))<br />
# Select the "pack mods" action<br />
# Choose the mod from the list (or set multiple choice with space, comma or semicolon)<br />
# Press Enter. The mod is available in the ''Starbound/mods/'' folder as <modname>.pak.<br />
<br />
= Step 5 - Publishing =<br />
Only one thing left to do - publish your mod! To do this, go to the official [http://community.playstarbound.com/index.php?resources/ modding forums], select "add mod" in the upper right hand section, select the category of your mod, fill out the information form and hit save. It is that easy.<br />
The Steam version provides an utility to pack and upload mods to the Steam Workshop directly (and can also generate your _metadata file).<br />
<br />
There are other places mods can be uploaded, or you can just share it with friends. What you do with your mod is up to you!<br />
<br />
= External links =<br />
* [http://community.playstarbound.com/forums/starbound-modding.111/ Chucklefish Forums - Starbound Modding]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/how-to-successfully-pack-and-unpack-pak-files.66649/ How to successfully pack and unpack .pak files]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/getting-started-in-making-mods-for-starbound.122055/ Getting started in making mods for Starbound]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/all-versions-win-linux-modpackhelper.92473/ ModPackHelper]<br />
* Chucklefish Mods: [http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/ Unofficial Modding Ebook 2.0]<br />
* Youtube: [https://www.youtube.com/watch?v=kAVn7JoYHp0 Starbound Tutorial, From Unpacking to Distribution and Everything Inbetween v1.2+ ]<br />
* Chucklefish Forums: [http://community.playstarbound.com/forums/starbound-modding.111/?prefix_id=52 Browse the "tutorial" tag] for more diverse and in-depth tutorials.<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Basics&diff=172693Modding:Basics2017-05-01T10:17:28Z<p>😺: /* Step 2 - Setting Up Your First Mod */ woops fixed section</p>
<hr />
<div>{{WorkInProgress}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
This article will show you the steps you need to take before you can start actually modding, and also the steps you can take after you are done modding, to pack and publish your mod.<br />
<br />
You will need a [[Modding:Text Editors|text editor]]. Do not use a word processor such as MS Word instead of a text editor. Also do not use the basic notepad.exe, as it does not support UNIX line endings. Only UTF-8 is supported, other encodings are likely to cause crashes.<br />
<br />
Alternative sources for getting started in modding include the Official Chucklefish Forums, the Unofficial Modding Ebook, the third-party program ModPakHelper that can be used for both unpacking and packing assets, a video, and some more. See [[Modding:Basics#External links|external links]] below.<br />
<br />
= Step 1 - Unpacking Assets =<br />
[[Version_history#Furious_Koala|Furious Koala]] introduced a ''.pak'' format which improves loading times and eases mod distribution. This means we need to unpack the assets before we can start modding.<br />
<br />
Note - This step will not remove or change your ''packed.pak'' file, but simply extract its content for use as reference material. Changes you make to the unpacked assets will have no effect on your game.<br />
<br />
=== Windows ===<br />
''Current as of Version 1.2.2, January 18th, 2017''<br />
# Open up the main directory folder for Starbound.<br />
# Shift + right-click within the folder and select ''Open Command Prompt'' or equivalent (depends on Windows version).<br />
# Type the following into ''Command Prompt'': <code>"win32\asset_unpacker.exe" "assets\packed.pak" "_UnpackedAssets"</code><br />
# ''Command Prompt'' will do nothing until ''asset_unpacker.exe'' has finished. There are no progress updates.<br />
# Once ''Command Prompt'' displays a message equivalent to this, "Unpacked assets to _UnpackedAssets in 250.063s," you can close the program and move on to creating mods.<br />
<br />
'''<big>Notes</big>'''<br />
*If purchased from Steam, the location of the main Starbound directory folder typically looks like this: <CODE>Steam\steamapps\common\Starbound</CODE><br />
*The text typed into ''Command Prompt'' are three directory locations:<br />
*# The location of ''asset_unpacker.exe'', which is the program that does all of the unpacking.<br />
*# The location of Starbound assets, or Mod assets, to be unpacked.<br />
*# Where you want the unpacked assets to be dumped. This third string can be changed to whichever location or name you prefer.<br />
<br />
=== Mac ===<br />
'''''<font color="red">Possibly outdated</font>'''''<br />
<br />
Right click on Starbound.app and select "Show Package Contents". Next, locate your ''packed.pak'' file under ''Starbound/assets/''. Finally create a new directory for the unpacked files, for example ''Starbound/assets/unpacked/''.<br />
<br />
Now open your command prompt window and enter first the location of ''asset_unpacker'', then the location of ''packed.pak'', and lastly the directory you want to unpack it into. '''Let the script run'''. When it finishes, you should see a long list of files and folders in the location you chose.<br />
<br />
= Step 2 - Setting Up Your First Mod =<br />
===_metadata file===<br />
The Starbound/mods folder is where you're going to place .pak files or unpacked mods folders. Create a directory inside this.<br />
The _metadata file is entirely optional. It is placed at the root of a mod's folder, and contains general information about the mod which will be displayed in the mod list on the Starbound title screen, and informations the game uses to determine load order if needed. Note that parameter's order doesn't matter, and that '''each parameter is optional'''; Starbound will deal without it. You could for example only fill the author field and not put the rest, or put everything but the version number. If you don't need a parameter, don't write it.<br />
<br />
A _metadata file including every parameters looks like this<pre><br />
{<br />
"version" : "2.00 Alpha Gold",<br />
"friendlyName" : "Cool mod",<br />
"link" : "http://example.com/coolmod",<br />
"name" : "coolmod",<br />
"description" : "This a cool mod!",<br />
"author" : "NAME",<br />
"steamContentId" : 000000001,<br />
"requires" : ["anothermod", "coolmod2"],<br />
"includes" : ["coolmodv1"],<br />
"priority" : 0<br />
}</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! Entry !! Description<br />
|-<br />
| <tt>version</tt> || The version number of your mod.<br />
|-<br />
| <tt>friendlyname</tt> || The name that will show up in the mod list menu.<br />
|-<br />
| <tt>link</tt> || A URL that links to the mod.<br />
|-<br />
| <tt>name</tt> || The "behind the scenes" name that is used for other mods' requires and includes options<br />
|-<br />
| <tt>description</tt> || The description of the mod. Type '\n' for a new line, and escape quotations with a \, such as <pre>"description" : "This mod is \"cool\", if you know what I mean."</pre><br />
|-<br />
| <tt>author</tt> || The author of the mod.<br />
|-<br />
| <tt>steamContentId</tt> || The workshop's unique id that steam uses. The Mod Uploader Tool available with Starbound's Steam version will fill this automatically.<br />
|-<br />
| <tt>priority</tt> || The lower the number, the sooner it'll be loaded. The base assets.pak has a priority of -9999. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>includes</tt> || Any mods listed here will be loaded before this mod, if they exist. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>requires</tt> || Any mods listed here will be '''required''' and the game will crash at startup if those mods aren't present. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
|}<br />
<br />
= Step 3 - Modding =<br />
=== Tutorials ===<br />
* [[Basic Property Modification|Editing Vanilla Files]]<br />
<br />
=== Reference Pages ===<br />
* [[Data:Assets|Data Assets]]<br />
* [[Modding:Materials:Mods|New Custom Material ID Registration]]<br />
* [[Modding:Liquids:Mods|New Custom Liquid ID Registration]]<br />
<br />
If you did everything right, Starbound should load your new mod the next time you run it. If the game crashes, or your changes are not found in the game, check your [http://community.playstarbound.com/index.php?threads/how-to-report-mod-errors-fixing-most-problems-yourself.69198/ starbound.log] file.<br />
<br />
= Step 4 - Packing your mod =<br />
Before publishing your mod, it is better to pack it as a single ''<modname>.pak'' file.<br />
This process is recommended because it simplifies the installation (drop the file in the ''Starbound/mods/'' folder), as well as the required I/O to read it. The alternative is to just put all the files into a zip archive.<br />
<br />
To pack your mod, use the asset_packer(.exe) tool the same way you've used asset_unpacker to unpack your assets, or use ModPackHelper:<br />
<br />
=== Windows/Linux with ModPackHelper ===<br />
# If you haven't done it already, install modPackHelper (Simply drag script into Starbound\mods folder (and give executable rights for .sh))<br />
# Select the "pack mods" action<br />
# Choose the mod from the list (or set multiple choice with space, comma or semicolon)<br />
# Press Enter. The mod is available in the ''Starbound/mods/'' folder as <modname>.pak.<br />
<br />
= Step 5 - Publishing =<br />
Only one thing left to do - publish your mod! To do this, go to the official [http://community.playstarbound.com/index.php?resources/ modding forums], select "add mod" in the upper right hand section, select the category of your mod, fill out the information form and hit save. It is that easy.<br />
The Steam version provides an utility to pack and upload mods to the Steam Workshop directly (and can also generate your _metadata file).<br />
<br />
There are other places mods can be uploaded, or you can just share it with friends. What you do with your mod is up to you!<br />
<br />
= External links =<br />
* [http://community.playstarbound.com/forums/starbound-modding.111/ Chucklefish Forums - Starbound Modding]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/how-to-successfully-pack-and-unpack-pak-files.66649/ How to successfully pack and unpack .pak files]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/getting-started-in-making-mods-for-starbound.122055/ Getting started in making mods for Starbound]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/all-versions-win-linux-modpackhelper.92473/ ModPackHelper]<br />
* Chucklefish Mods: [http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/ Unofficial Modding Ebook 2.0]<br />
* Youtube: [https://www.youtube.com/watch?v=kAVn7JoYHp0 Starbound Tutorial, From Unpacking to Distribution and Everything Inbetween v1.2+ ]<br />
* Chucklefish Forums: [http://community.playstarbound.com/forums/starbound-modding.111/?prefix_id=52 Browse the "tutorial" tag] for more diverse and in-depth tutorials.<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Basics&diff=172692Modding:Basics2017-05-01T10:16:02Z<p>😺: /* _metadata file */ Further info</p>
<hr />
<div>{{WorkInProgress}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
This article will show you the steps you need to take before you can start actually modding, and also the steps you can take after you are done modding, to pack and publish your mod.<br />
<br />
You will need a [[Modding:Text Editors|text editor]]. Do not use a word processor such as MS Word instead of a text editor. Also do not use the basic notepad.exe, as it does not support UNIX line endings. Only UTF-8 is supported, other encodings are likely to cause crashes.<br />
<br />
Alternative sources for getting started in modding include the Official Chucklefish Forums, the Unofficial Modding Ebook, the third-party program ModPakHelper that can be used for both unpacking and packing assets, a video, and some more. See [[Modding:Basics#External links|external links]] below.<br />
<br />
= Step 1 - Unpacking Assets =<br />
[[Version_history#Furious_Koala|Furious Koala]] introduced a ''.pak'' format which improves loading times and eases mod distribution. This means we need to unpack the assets before we can start modding.<br />
<br />
Note - This step will not remove or change your ''packed.pak'' file, but simply extract its content for use as reference material. Changes you make to the unpacked assets will have no effect on your game.<br />
<br />
=== Windows ===<br />
''Current as of Version 1.2.2, January 18th, 2017''<br />
# Open up the main directory folder for Starbound.<br />
# Shift + right-click within the folder and select ''Open Command Prompt'' or equivalent (depends on Windows version).<br />
# Type the following into ''Command Prompt'': <code>"win32\asset_unpacker.exe" "assets\packed.pak" "_UnpackedAssets"</code><br />
# ''Command Prompt'' will do nothing until ''asset_unpacker.exe'' has finished. There are no progress updates.<br />
# Once ''Command Prompt'' displays a message equivalent to this, "Unpacked assets to _UnpackedAssets in 250.063s," you can close the program and move on to creating mods.<br />
<br />
'''<big>Notes</big>'''<br />
*If purchased from Steam, the location of the main Starbound directory folder typically looks like this: <CODE>Steam\steamapps\common\Starbound</CODE><br />
*The text typed into ''Command Prompt'' are three directory locations:<br />
*# The location of ''asset_unpacker.exe'', which is the program that does all of the unpacking.<br />
*# The location of Starbound assets, or Mod assets, to be unpacked.<br />
*# Where you want the unpacked assets to be dumped. This third string can be changed to whichever location or name you prefer.<br />
<br />
=== Mac ===<br />
'''''<font color="red">Possibly outdated</font>'''''<br />
<br />
Right click on Starbound.app and select "Show Package Contents". Next, locate your ''packed.pak'' file under ''Starbound/assets/''. Finally create a new directory for the unpacked files, for example ''Starbound/assets/unpacked/''.<br />
<br />
Now open your command prompt window and enter first the location of ''asset_unpacker'', then the location of ''packed.pak'', and lastly the directory you want to unpack it into. '''Let the script run'''. When it finishes, you should see a long list of files and folders in the location you chose.<br />
<br />
= Step 2 - Setting Up Your First Mod =<br />
The Starbound/mods folder is where you're going to place .pak files or unpacked mods folders. Create a directory inside this.<br />
The _metadata file is entirely optional. It is placed at the root of a mod's folder, and contains general information about the mod which will be displayed in the mod list on the Starbound title screen, and informations the game uses to determine load order if needed. Note that parameter's order doesn't matter, and that '''each parameter is optional'''; Starbound will deal without it. You could for example only fill the author field and not put the rest, or put everything but the version number. If you don't need a parameter, don't write it.<br />
<br />
A _metadata file including every parameters looks like this<pre><br />
{<br />
"version" : "2.00 Alpha Gold",<br />
"friendlyName" : "Cool mod",<br />
"link" : "http://example.com/coolmod",<br />
"name" : "coolmod",<br />
"description" : "This a cool mod!",<br />
"author" : "NAME",<br />
"steamContentId" : 000000001,<br />
"requires" : ["anothermod", "coolmod2"],<br />
"includes" : ["coolmodv1"],<br />
"priority" : 0<br />
}</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! Entry !! Description<br />
|-<br />
| <tt>version</tt> || The version number of your mod.<br />
|-<br />
| <tt>friendlyname</tt> || The name that will show up in the mod list menu.<br />
|-<br />
| <tt>link</tt> || A URL that links to the mod.<br />
|-<br />
| <tt>name</tt> || The "behind the scenes" name that is used for other mods' requires and includes options<br />
|-<br />
| <tt>description</tt> || The description of the mod. Type '\n' for a new line, and escape quotations with a \, such as <pre>"description" : "This mod is \"cool\", if you know what I mean."</pre><br />
|-<br />
| <tt>author</tt> || The author of the mod.<br />
|-<br />
| <tt>steamContentId</tt> || The workshop's unique id that steam uses. The Mod Uploader Tool available with Starbound's Steam version will fill this automatically.<br />
|-<br />
| <tt>priority</tt> || The lower the number, the sooner it'll be loaded. The base assets.pak has a priority of -9999. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>includes</tt> || Any mods listed here will be loaded before this mod, if they exist. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>requires</tt> || Any mods listed here will be '''required''' and the game will crash at startup if those mods aren't present. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
|}<br />
<br />
= Step 3 - Modding =<br />
=== Tutorials ===<br />
* [[Basic Property Modification|Editing Vanilla Files]]<br />
<br />
=== Reference Pages ===<br />
* [[Data:Assets|Data Assets]]<br />
* [[Modding:Materials:Mods|New Custom Material ID Registration]]<br />
* [[Modding:Liquids:Mods|New Custom Liquid ID Registration]]<br />
<br />
If you did everything right, Starbound should load your new mod the next time you run it. If the game crashes, or your changes are not found in the game, check your [http://community.playstarbound.com/index.php?threads/how-to-report-mod-errors-fixing-most-problems-yourself.69198/ starbound.log] file.<br />
<br />
= Step 4 - Packing your mod =<br />
Before publishing your mod, it is better to pack it as a single ''<modname>.pak'' file.<br />
This process is recommended because it simplifies the installation (drop the file in the ''Starbound/mods/'' folder), as well as the required I/O to read it. The alternative is to just put all the files into a zip archive.<br />
<br />
To pack your mod, use the asset_packer(.exe) tool the same way you've used asset_unpacker to unpack your assets, or use ModPackHelper:<br />
<br />
=== Windows/Linux with ModPackHelper ===<br />
# If you haven't done it already, install modPackHelper (Simply drag script into Starbound\mods folder (and give executable rights for .sh))<br />
# Select the "pack mods" action<br />
# Choose the mod from the list (or set multiple choice with space, comma or semicolon)<br />
# Press Enter. The mod is available in the ''Starbound/mods/'' folder as <modname>.pak.<br />
<br />
= Step 5 - Publishing =<br />
Only one thing left to do - publish your mod! To do this, go to the official [http://community.playstarbound.com/index.php?resources/ modding forums], select "add mod" in the upper right hand section, select the category of your mod, fill out the information form and hit save. It is that easy.<br />
The Steam version provides an utility to pack and upload mods to the Steam Workshop directly (and can also generate your _metadata file).<br />
<br />
There are other places mods can be uploaded, or you can just share it with friends. What you do with your mod is up to you!<br />
<br />
= External links =<br />
* [http://community.playstarbound.com/forums/starbound-modding.111/ Chucklefish Forums - Starbound Modding]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/how-to-successfully-pack-and-unpack-pak-files.66649/ How to successfully pack and unpack .pak files]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/getting-started-in-making-mods-for-starbound.122055/ Getting started in making mods for Starbound]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/all-versions-win-linux-modpackhelper.92473/ ModPackHelper]<br />
* Chucklefish Mods: [http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/ Unofficial Modding Ebook 2.0]<br />
* Youtube: [https://www.youtube.com/watch?v=kAVn7JoYHp0 Starbound Tutorial, From Unpacking to Distribution and Everything Inbetween v1.2+ ]<br />
* Chucklefish Forums: [http://community.playstarbound.com/forums/starbound-modding.111/?prefix_id=52 Browse the "tutorial" tag] for more diverse and in-depth tutorials.<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Starbound_Log_File&diff=172691Modding:Starbound Log File2017-05-01T10:00:16Z<p>😺: formatting</p>
<hr />
<div>The Starbound log file is a text file where the game engine writes a lot of debugging and status information, along with errors. This file can get quite large, and is rotated everytime the game restart. "starbound.log" becomes "starbound.log.0", "starbound.log.0" becomes "starbound.log.1" and so on.<br />
<br />
You can find your log files at this path:<br />
: <font face="Starbound">Starbound/starbound.log</font><br />
Or for steam:<br />
:<font face="Starbound">SteamApps/common/Starbound/starbound.log</font><br />
If you run a server, there is a log file specifically for it:<br />
: <font face="Starbound">Starbound/starbound_server.log</font><br />
: <font face="Starbound">Steam/SteamApps/common/Starbound/starbound_server.log</font><br />
<br />
<br />
Using a terminal on Linux/Mac or Windows with Cygwin or the Windows Subsystem for Linux, you can use this command from the star bound directory:<br />
<br />
<code>tail -f starbound.log</code><br />
<br />
to monitor the log in (mostly) realtime; it can sometimes be delayed for a few seconds. For more information on Linux, Cygwin, and the tail command, see your local Google.<br />
<br />
On the Mac you can additionally open the log in the GUI console.app from the terminal by using the command:<br />
<br />
<pre>open ~/Library/Application\ Support/Steam/SteamApps/common/Starbound/starbound.log</pre><br />
<br />
For Windows, there are several tail-like options with graphical interface such as [http://ophilipp.free.fr/op_tail.htm mTail].<br />
<br />
If you prefer the command line (which is only natural because of its superiority) [http://www.cygwin.com/ Cygwin] provides a suite of *nix-like utilities for Windows, including a shell with all of the usual commands like tail, cat, grep, egrep, awk, sed, diff, etc.<br />
<br />
<br />
=== Mac specific problem with .DS_Store files ===<br />
<br />
Currently (beta v. Offended Koala) the Mac version will crash if the data directory ( ~/Library/Application\ Support/Steam/SteamApps/common/Starbound for Steam users) is opened with the Finder, because doing so creates invisible [http://en.wikipedia.org/wiki/.DS_Store .DS_Store] files, and these cause the Starbound client to crash on launch. <br />
<br />
Until the bug is fixed, Mac-based modders can remove the files from their Starbound directory using the terminal (the following command removes them from all steam apps - this should be non-problematic, but if so append the star bound directory name to the path): <br />
<br />
<pre>find ~/Library/Application\ Support/Steam/SteamApps/common -name .DS_Store -exec rm {} \;</pre><br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Starbound_Log_File&diff=172690Modding:Starbound Log File2017-05-01T09:58:26Z<p>😺: Updated some infos</p>
<hr />
<div>The Starbound log file is a text file where the game engine writes a lot of debugging and status information, along with errors. This file can get quite large, and is rotated everytime the game restart. "starbound.log" becomes "starbound.log.0", "starbound.log.0" becomes "starbound.log.1" and so on.<br />
<br />
You can find your log files at this path:<br />
<pre>Starbound/starbound.log</pre><br />
Or for steam:<br />
<pre>SteamApps/common/Starbound/starbound.log</pre><br />
<br />
If you run a server, there is a log file specifically for it:<br />
<pre>Starbound/starbound_server.log</pre><br />
<pre>Steam/SteamApps/common/Starbound/starbound_server.log</pre><br />
<br />
Using a terminal on Linux/Mac or Windows with Cygwin or the Windows Subsystem for Linux, you can use this command from the star bound directory:<br />
<br />
<pre>tail -f starbound.log</pre><br />
<br />
to monitor the log in (mostly) realtime; it can sometimes be delayed for a few seconds. For more information on Linux, Cygwin, and the tail command, see your local Google.<br />
<br />
On the Mac you can additionally open the log in the GUI console.app from the terminal by using the command:<br />
<br />
<pre>open ~/Library/Application\ Support/Steam/SteamApps/common/Starbound/starbound.log</pre><br />
<br />
For Windows, there are several tail-like options with graphical interface such as [http://ophilipp.free.fr/op_tail.htm mTail].<br />
<br />
If you prefer the command line (which is only natural because of its superiority) [http://www.cygwin.com/ Cygwin] provides a suite of *nix-like utilities for Windows, including a shell with all of the usual commands like tail, cat, grep, egrep, awk, sed, diff, etc.<br />
<br />
<br />
=== Mac specific problem with .DS_Store files ===<br />
<br />
Currently (beta v. Offended Koala) the Mac version will crash if the data directory ( ~/Library/Application\ Support/Steam/SteamApps/common/Starbound for Steam users) is opened with the Finder, because doing so creates invisible [http://en.wikipedia.org/wiki/.DS_Store .DS_Store] files, and these cause the Starbound client to crash on launch. <br />
<br />
Until the bug is fixed, Mac-based modders can remove the files from their Starbound directory using the terminal (the following command removes them from all steam apps - this should be non-problematic, but if so append the star bound directory name to the path): <br />
<br />
<pre>find ~/Library/Application\ Support/Steam/SteamApps/common -name .DS_Store -exec rm {} \;</pre><br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding&diff=172689Modding2017-05-01T09:49:26Z<p>😺: Setting a redirection to the modding portal</p>
<hr />
<div>#REDIRECT [[Modding:Portal]]<br />
{{delete|This is outdated and redundant with [[Modding:Portal|Modding:Portal]]"}}<br />
<br />
{{Modding}}<br />
For a general explanation of what a mod is, see the [https://en.wikipedia.org/wiki/Mod_(video_gaming) Wikipedia article] on the subject.<br />
<br />
Specific to Starbound, through modding, the game can be substantially changed. You can add new items, change item functionality, change the appearance of sprites and textures, and much more. Although some things are hard coded, there are still many possibilities for modifying Starbound.<br />
<br />
== Obtaining Mods for Starbound ==<br />
* The [http://community.playstarbound.com/index.php?resources/ official mod section] on the Starbound website is the best place to find and share mods.<br />
* The official [http://community.playstarbound.com/index.php?forums/mod-releases.103/ mod release forum section] is also available.<br />
* NexusMods.com also has a [http://www.nexusmods.com/starbound/ Starbound section].<br />
<br />
== Installing Mods for Starbound ==<br />
The [[Version history#Angry Koala|Angry Koala]] version has introduced [[Modding:Merge|merge functionality]] for all [[Modding:JSON|JSON]] files, and the previous patch introduced [[Modding:Modinfo|modinfo files]]. Please see the [http://community.playstarbound.com/index.php?forums/mod-releases-modding-help.111/ modding forums] for help and more information.<br />
<br />
== How do I make my own mods? ==<br />
<br />
* [[Modding:Modding/FAQ|Modding FAQ]]<br />
* [[Modding:Modding_Basics|Modding Basics]]<br />
<br />
== IRC Communities ==<br />
Please feel free to join other Starbound enthusiasts in these chat channels that are live 24 hours a day, 7 days a week! People aren't necessarily active 24 hours a day, but there's always someone in the channel. If you just want to hang out, that's fine, or you can ask questions!<br />
<br />
=== The official general Starbound chat channel ===<br />
* [http://webchat.freenode.net/?channels=%23starbound #starbound]: General gameplay questions and chat.<br />
<br />
=== The unofficial official channel for Starbound modders ===<br />
* [http://webchat.freenode.net/?channels=%23%23starbound-modding ##starbound-modding]: Ask questions, talk about mod ideas, or mods in progress, whatever!<br />
<br />
Use any IRC client of your choice, or just click on the channel to open the Freenode webchat.</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Nightlies&diff=172685Modding:Nightlies2017-05-01T09:42:24Z<p>😺: Setting a redirection to the version history page</p>
<hr />
<div>#REDIRECT [[Version_history#Nightly_Build]]<br />
<div style="float:right;">__TOC__</div><br />
= Modding on Nightlies =<br />
<br />
The "nightly" branch is updated automatically every day. With the nightlies, you can experience whatever cutting-edge features and cutting-edge bugs have been introduced. Expect to see a lot of unfinished things and game-breaking issues that may destroy your saved characters/worlds.<br />
<br />
If you find the game starting with an error, try deleting Starbound.config, /player folder, and /universe folder. Often some change to these make your old data incompatible (Make backups in case you want to narrow things down and try to save your progress).<br />
<br />
See [http://playstarbound.com/nightly-builds-are-live/ this] post for instructions on switching to nightlies.<br />
<br />
== scriptCanvas ==<br />
<br />
Right now, this page is mostly about the scriptCanvas because it's awesome and opens up a world of possibility. You *are* Neo, and the scriptCanvas is your Matrix.<br />
<br />
See the [http://playstarbound.com/october-14th-interface-foundations/ original dev blog entry] for more information.<br />
<br />
=== The Origin Story ===<br />
<br />
<kyren> what about<br />
<kyren> what about what about whata bout<br />
<kyren> whaaaaaat about<br />
<kyren> a client side, lua based<br />
<kyren> window<br />
<kyren> that has a connection to an object<br />
<kyren> and drawing primitive operations<br />
...<br />
<kyren> okay doing that<br />
<kyren> this weekend<br />
<br />
...And the rest was history!<br />
<br />
<br />
=== Links ===<br />
<br />
* Available functions and arguments: http://pastebin.com/3Ekd3by4 (fixed drawRect)<br />
<br />
* A couple sample mods, including Metadept's "Pong" and Kyren's "Lights Out": http://metadept.com/starbound/testconsoles.zip<br />
<br />
* API dump from within Kyren's testconsole: http://pastebin.com/3m2kEieU<br />
<br />
* SeveredSkullz IMGUI library project for interface API: http://community.playstarbound.com/index.php?threads/imgui-library-for-interface-api.85161/<br />
<br />
* Neurisko's computer project: http://community.playstarbound.com/index.php?threads/my-in-game-scriptcanvas-based-computer-apex64-bananastar-8200.85178/<br />
<br />
* Member function documentation: http://doc.playstarbound.com/classStar_1_1CanvasWidget.html#a8b0ccf7e472ab70120fd5fc4575985b6<br />
<br />
* Text color codes: http://pastebin.com/Tr0AGj4G<br />
<br />
* scriptCanvas Environment Dump: http://pastebin.com/xcyNXQEk<br />
<br />
* MrMagical's Persistent Storage: http://pastebin.com/DtWDSWZ4<br />
<br />
* SpiderDave's [http://community.playstarbound.com/index.php?resources/robot-spider-invasion-rampaging-koala.2325/ spider fighting game] and his [http://pastebin.com/ayVQ5vvq circle drawing function].<br />
<br />
* PenguinToast's Object-oriented GUI library: http://penguintoast.github.io/PenguinGUI/<br />
<br />
* RPC-like functionality (healthire) http://pastebin.com/RjTZWLAc<br />
<br />
* PenguinToast's StarModMenu mod for mod user interfaces: http://community.playstarbound.com/index.php?resources/starmodmenu.2368/<br />
<br />
=== Notes ===<br />
<br />
* <strike>You have to click on a canvas window to gain focus before it will recognize input.</strike> Fixed<br />
* There is an off-by-one error with displaying graphics within the canvas; the right and bottom sides are off by one pixel. Maybe? I dunno, maybe I'm doing it wrong. --Neurisko<br />
* canvasClickEvent now has a third parameter "buttonDown". The Lights Out Game needs a small modification to account for this.<br />
* canvasDrawText has weird behavior where if the string starts with a space, it will remove that space, but not any following spaces. Bug?<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding&diff=172682Modding2017-05-01T09:21:55Z<p>😺: marked for deletion</p>
<hr />
<div>{{delete|This is outdated and redundant with [[Modding:Portal|Modding:Portal]]"}}<br />
<br />
{{Modding}}<br />
For a general explanation of what a mod is, see the [https://en.wikipedia.org/wiki/Mod_(video_gaming) Wikipedia article] on the subject.<br />
<br />
Specific to Starbound, through modding, the game can be substantially changed. You can add new items, change item functionality, change the appearance of sprites and textures, and much more. Although some things are hard coded, there are still many possibilities for modifying Starbound.<br />
<br />
== Obtaining Mods for Starbound ==<br />
* The [http://community.playstarbound.com/index.php?resources/ official mod section] on the Starbound website is the best place to find and share mods.<br />
* The official [http://community.playstarbound.com/index.php?forums/mod-releases.103/ mod release forum section] is also available.<br />
* NexusMods.com also has a [http://www.nexusmods.com/starbound/ Starbound section].<br />
<br />
== Installing Mods for Starbound ==<br />
The [[Version history#Angry Koala|Angry Koala]] version has introduced [[Modding:Merge|merge functionality]] for all [[Modding:JSON|JSON]] files, and the previous patch introduced [[Modding:Modinfo|modinfo files]]. Please see the [http://community.playstarbound.com/index.php?forums/mod-releases-modding-help.111/ modding forums] for help and more information.<br />
<br />
== How do I make my own mods? ==<br />
<br />
* [[Modding:Modding/FAQ|Modding FAQ]]<br />
* [[Modding:Modding_Basics|Modding Basics]]<br />
<br />
== IRC Communities ==<br />
Please feel free to join other Starbound enthusiasts in these chat channels that are live 24 hours a day, 7 days a week! People aren't necessarily active 24 hours a day, but there's always someone in the channel. If you just want to hang out, that's fine, or you can ask questions!<br />
<br />
=== The official general Starbound chat channel ===<br />
* [http://webchat.freenode.net/?channels=%23starbound #starbound]: General gameplay questions and chat.<br />
<br />
=== The unofficial official channel for Starbound modders ===<br />
* [http://webchat.freenode.net/?channels=%23%23starbound-modding ##starbound-modding]: Ask questions, talk about mod ideas, or mods in progress, whatever!<br />
<br />
Use any IRC client of your choice, or just click on the channel to open the Freenode webchat.</div>😺https://starbounder.org/mediawiki/index.php?title=User:%F0%9F%98%BA&diff=172679User:😺2017-04-29T11:43:05Z<p>😺: create user page</p>
<hr />
<div></div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Basics/Helping_Out&diff=172678Modding:Basics/Helping Out2017-04-29T11:07:06Z<p>😺: </p>
<hr />
<div>{{InfoBoxInner|__TOC__|style=float:right;}}<br />
<br />
This page represents a list of needed documentation for [[Modding|modding]]. Feel free to add to it so that someone from the modding community can help contribute. Please tag any created pages with <nowiki>[[Category:Modding]]</nowiki> to help organize the pages into the Modding space. Alternatively add <nowiki>{{Modding}}</nowiki> to the bottom of the page, which will automatically do that and insert a quick navigation for Modding related pages.<br />
<br />
* [[Modding:Basic_Property_Modification]] rewrite; it talks about the depreciated __merge feature, should be rewrote for the patching feature. [[Modding:Advanced_Modding]] talks about it, maybe use it instead directly?<br />
* [[Asset_Tree]] documentation (exploding folders into their own articles)<br />
* [[Modding/tutorials]] list?<br />
*: There's [[Projects:Guides#Modding Guides]] -- should probably be linked on the [[Modding:Portal]] page<br />
* list of tech moves (not exhaustive, there is also "altFire" and possibly others): http://pastebin.com/Kfa09N7q<br />
* list of all(?) UI elements: http://pastebin.com/tC3WkVP4<br />
*: ^is this still required?<br />
<br />
== Using the Templates ==<br />
<br />
There are a few templates that are used across all Modding related pages. The primary one being the Quick Navigation feature, which you can access using <nowiki>{{Modding}}</nowiki>, which consists of many <nowiki>.Nav</nowiki> templates. The first one is at Modding:.nav and from there on you should be able to access all of them.<br />
<br />
=== [//starbounder.org/Category:Lua/Templates Lua Templates] ===<br />
<br />
* [http://starbounder.org/Form:Lua/Function Form-based Assistant] (Use this when editing Lua documentation!)<br />
* http://starbounder.org/Template:Lua/Type<br />
* http://starbounder.org/Template:Lua/Link<br />
* http://starbounder.org/Template:Lua/Variable<br />
* http://starbounder.org/Template:Lua/Function <br />
* http://starbounder.org/Template:Lua/Parameter<br />
* http://starbounder.org/Template:Lua/Argument<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Portal&diff=172677Modding:Portal2017-04-29T10:53:00Z<p>😺: oops forgot a !</p>
<hr />
<div>{{Modding}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
<br />
Many aspects of Starbound are available for modifying or expanding, from items and monsters, to villagers, towns, and even whole planets.<br />
<br />
= Installing Mods =<br />
Chucklefish Games provides two official sources for mods, the [http://community.playstarbound.com/resources/categories/starbound.21/ Starbound Mod Repository] and the [http://community.playstarbound.com/forums/mod-releases-wips.103/ Starbound Modding Forum]. Steam users can also browse the [http://steamcommunity.com/app/211820/workshop/ Steam Workshop]. Once downloaded, you will want to place the files within Starbound's mod directory: <br />
: <font face="Starbound">Starbound\mods\</font><br />
If purchased from Steam, the location of the main Starbound directory folder typically looks like this: <br />
:<font face="Starbound">Steam\steamapps\common\Starbound</font><br />
Workshop mods are automatically downloaded in <font face="Starbound">Steam\steamapps\workshop\content\211820</font>.<br><br />
They do not need to be moved to the Starbound\mods\ folder, the game will load them automatically.<br />
<br />
<br />
Mods can be found in three forms:<br />
* compressed (.zip, .7zip, .rar, ...): those are generally unpacked compressed mods. Starbound cannot handle them, and you'll have to unzip them first.<br />
* unpacked: those are the raw files, directories, etc.<br />
*: <font face="Starbound">\mods\''modname''</font><br />
* packed (.pak): those are "packed" in a format that Starbound can read, and is generally prefered for faster loading.<br />
*: <font face="Starbound">\mods\''modname.pak''</font><br />
<br />
A more in-depth installation guide is available [http://community.playstarbound.com/threads/installing-mods-for-starbound-1-0.118081/ on the official forum].<br />
<br />
= How do I mod Starbound? =<br />
<br />
The moddable assets are located in the [[Modding:Asset_Tree|Asset Tree]], which is located in your Starbound directory under /Starbound/assets. There are several types of assets. Editing an existing asset will change the base behavior of the game. You can add new assets, although getting those assets into the game may be tricky depending on what you're trying to add. The official modding forums are the best source of up-to-date information on specifics.<br />
<br />
* [[Modding:JSON_Object_Types|JSON Objects]]: There are hundreds of [[Modding:JSON|JSON]] configuration files in various directories inside /assets/, with dozens of different extensions, like .config, .frames, .animation, .gun, etc. Any files with extensions that do not match the ones listed below are probably JSON config files.<br />
* [[Modding:Lua Language|Lua Scripting]]: Monsters, NPCs, and certain objects use Lua scripts to control their behavior. Lua scripting has a lot of potential, but currently suffers from severe scoping limitations. Lua files always end with the extension ".lua." The Lua API is documented in some Lua files in the 'Starbound/doc/lua' game's folder, and is also [[Modding:Lua API|explained here]] and although it may sometimes be a little outdated, should help.<br />
* Sound files: File extensions are either ".wav" or ".ogg"<br />
* Graphics: File extension is ".png" for graphics.<br />
<br />
= Yeah man, but how do I mod Starbound?! =<br />
The developers are very responsive to requests from the community and have already implemented some things by request since the beginning of beta. The best way for you to learn how to mod is go to the official forums, do a bunch of reading, look at some existing mods, and of course do extensive browsing of the asset files until you form some understanding of them.<br />
<br />
* Multiple ressources are available to get you started, pick your media of preference:<br />
** [[Modding:Basics|The Modding Basics]] is a step-by-step guide on this very wiki<br />
** [http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/ An unofficial ebook] was created especially for those completely new to the modding scene.<br />
** [https://www.youtube.com/watch?v=kAVn7JoYHp0 This video] covers everything from how to unpack your Starbound assets to making a basic decorative custom object, how to make a recipe for that object, how to learn that recipe and finally how to pack and distribute it when you are done<br />
** For more specific needs, the official forums have [http://community.playstarbound.com/forums/starbound-modding.111/?prefix_id=52 a "tutorial" tag that you can browse].<br />
<br />
* Information on the [[Modding:Lua_API|Lua API]] is documented in .md files in the Starbound/doc/lua folder.<br />
<br />
* If you have any problems, comb through the included assets. They are a rich source of examples you can follow. Before you try to make anything complex, you should start with copying something simple.<br />
<br />
* You can also download some sample mods (make sure they are up to date, as the mod specifications changed a few times in the beta) to learn from.<br />
<br />
= Where is ''feature X''? =<br />
Now that the game is officially released, if there is a feature that is in your opinion missing from the game, you are free to submit mod requests at [http://community.playstarbound.com/forums/modding.111/ Offical Starbound Mod Forums]. Another area that allows modding requests is the subreddit [https://www.reddit.com/r/starboundmods/ /r/starboundmods].<br />
<br />
= Text Editing =<br />
==== What text editor should I use? ====<br />
This is a complex question, but the simple answer is, "Just about anything except Windows Notepad."<br />
<br />
We have a list of [[Modding:Text Editors|suggested text editors]] and a few tips for using them with JSON and Lua.<br />
<br />
= Graphics Editing =<br />
==== What image editor should I use? ====<br />
<br />
Please see this [[Modding:Image Editing|list of suggested image editors.]] There's a guide detailing the game's specific art styling [[Guide:Art|here]].<br />
<br />
= Troubleshooting =<br />
<br />
=== My game keeps crashing! ===<br />
<br />
You can start by checking the [[Modding:Starbound_Log_File|log file]]. You can find errors in there telling you which line in your code caused the crash. Loading the multiplayer server will give you a console, but restarting it frequently is tedious.<br />
<br />
An online [[Modding:JSON|JSON]] parser will help catch some common mistakes, such as missing commas and unmatched braces in your modified files. For more information about JSON, see the [[Modding:JSON|JSON]] page, or see the index of JSON configuration file types [[Modding:JSON Object Types|here]].<br />
<br />
=== Mac specific problem with .DS_Store files ===<br />
<!-- This seems to be seriously outdated -- Offended Koala was back in 2014. --><br />
Currently (beta v. Offended Koala) the Mac version will crash if the data directory ( ~/Library/Application\ Support/Steam/SteamApps/common/Starbound for Steam users) is opened with the Finder, because doing so creates invisible [http://en.wikipedia.org/wiki/.DS_Store .DS_Store] files, and these cause the Starbound client to crash on launch. <br />
<br />
Until the bug is fixed, Mac-based modders can remove the files from their Starbound directory using the terminal (the following command removes them from all Steam apps - this should be non-problematic, but if so append the Starbound directory name to the path): <br />
<br />
<pre>find ~/Library/Application\ Support/Steam/SteamApps/common -name .DS_Store -exec rm {} \;</pre><br />
<br />
=== How can I help the modding community? === <!-- this shouldn't be in "troubleshooting"? --><br />
<br />
Check out [[Modding:Modding/DocumentationTODO]] to see a list of things that need to be done for modding documentation on this wiki.<br />
<br />
<br />
= Where can I get more information? =<br />
<br />
[http://community.playstarbound.com/forums/starbound-modding.111/ The official modding forums]<br />
<br />
[https://discordapp.com/invite/Starbound The official discord server] has a #modding channel<br />
<br />
There is also the IRC channel ##starbound-modding on the Freenode network, which can be accessed [http://webchat.freenode.net/?channels=%23%23starbound-modding&uio=d4 here]. Please note that this channel is dedicated to the ins and outs of modding, and is '''not''' the place to ask about a mod you downloaded! We don't kick or ban for minor netiquette breaches, but if the room is busy, be courteous and obey the rules or you may have a problem.<br />
<br />
If you use the IRC channel, follow these simple rules:<br />
* Use a pastebin like pastebin.com for anything over 2-3 lines.<br />
* Check the [http://starbounder.org/Modding:Starbound_Log_File log files] first. If there's an error you don't understand and want us to look at, post it on a pastebin for us to look at, along with any relevant code.<br />
* Do not spam the chat with excessive emotes or offtopic chat. Some offtopic is fine, but if people are talking about modding, try not to spam up the chat with fluff. You can go to #starbound or #starbound-overflow for that.<br />
* Constructive criticism is welcome, but be thoughtful and respectful of others.<br />
* Don't walk into chat and ask "hay guise how do i mod lol." We're all bootstrapping our own modding efforts by doing a lot of reading through the example code, reading others' mods, and experimentation.</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Portal&diff=172676Modding:Portal2017-04-29T10:52:25Z<p>😺: Removed "old & outdated infos" section - it's not really useful to keep, and might even confuse people</p>
<hr />
<div>{{Modding}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
<br />
Many aspects of Starbound are available for modifying or expanding, from items and monsters, to villagers, towns, and even whole planets.<br />
<br />
= Installing Mods =<br />
Chucklefish Games provides two official sources for mods, the [http://community.playstarbound.com/resources/categories/starbound.21/ Starbound Mod Repository] and the [http://community.playstarbound.com/forums/mod-releases-wips.103/ Starbound Modding Forum]. Steam users can also browse the [http://steamcommunity.com/app/211820/workshop/ Steam Workshop]. Once downloaded, you will want to place the files within Starbound's mod directory: <br />
: <font face="Starbound">Starbound\mods\</font><br />
If purchased from Steam, the location of the main Starbound directory folder typically looks like this: <br />
:<font face="Starbound">Steam\steamapps\common\Starbound</font><br />
Workshop mods are automatically downloaded in <font face="Starbound">Steam\steamapps\workshop\content\211820</font>.<br><br />
They do not need to be moved to the Starbound\mods\ folder, the game will load them automatically.<br />
<br />
<br />
Mods can be found in three forms:<br />
* compressed (.zip, .7zip, .rar, ...): those are generally unpacked compressed mods. Starbound cannot handle them, and you'll have to unzip them first.<br />
* unpacked: those are the raw files, directories, etc.<br />
*: <font face="Starbound">\mods\''modname''</font><br />
* packed (.pak): those are "packed" in a format that Starbound can read, and is generally prefered for faster loading.<br />
*: <font face="Starbound">\mods\''modname.pak''</font><br />
<br />
A more in-depth installation guide is available [http://community.playstarbound.com/threads/installing-mods-for-starbound-1-0.118081/ on the official forum].<br />
<br />
= How do I mod Starbound? =<br />
<br />
The moddable assets are located in the [[Modding:Asset_Tree|Asset Tree]], which is located in your Starbound directory under /Starbound/assets. There are several types of assets. Editing an existing asset will change the base behavior of the game. You can add new assets, although getting those assets into the game may be tricky depending on what you're trying to add. The official modding forums are the best source of up-to-date information on specifics.<br />
<br />
* [[Modding:JSON_Object_Types|JSON Objects]]: There are hundreds of [[Modding:JSON|JSON]] configuration files in various directories inside /assets/, with dozens of different extensions, like .config, .frames, .animation, .gun, etc. Any files with extensions that do not match the ones listed below are probably JSON config files.<br />
* [[Modding:Lua Language|Lua Scripting]]: Monsters, NPCs, and certain objects use Lua scripts to control their behavior. Lua scripting has a lot of potential, but currently suffers from severe scoping limitations. Lua files always end with the extension ".lua." The Lua API is documented in some Lua files in the 'Starbound/doc/lua' game's folder, and is also [[Modding:Lua API|explained here]] and although it may sometimes be a little outdated, should help.<br />
* Sound files: File extensions are either ".wav" or ".ogg"<br />
* Graphics: File extension is ".png" for graphics.<br />
<br />
= Yeah man, but how do I mod Starbound?! =<br />
The developers are very responsive to requests from the community and have already implemented some things by request since the beginning of beta. The best way for you to learn how to mod is go to the official forums, do a bunch of reading, look at some existing mods, and of course do extensive browsing of the asset files until you form some understanding of them.<br />
<br />
* Multiple ressources are available to get you started, pick your media of preference:<br />
** [[Modding:Basics|The Modding Basics]] is a step-by-step guide on this very wiki<br />
** [http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/ An unofficial ebook] was created especially for those completely new to the modding scene.<br />
** [https://www.youtube.com/watch?v=kAVn7JoYHp0 This video] covers everything from how to unpack your Starbound assets to making a basic decorative custom object, how to make a recipe for that object, how to learn that recipe and finally how to pack and distribute it when you are done<br />
** For more specific needs, the official forums have [http://community.playstarbound.com/forums/starbound-modding.111/?prefix_id=52 a "tutorial" tag that you can browse].<br />
<br />
* Information on the [[Modding:Lua_API|Lua API]] is documented in .md files in the Starbound/doc/lua folder.<br />
<br />
* If you have any problems, comb through the included assets. They are a rich source of examples you can follow. Before you try to make anything complex, you should start with copying something simple.<br />
<br />
* You can also download some sample mods (make sure they are up to date, as the mod specifications changed a few times in the beta) to learn from.<br />
<br />
= Where is ''feature X''? =<br />
Now that the game is officially released, if there is a feature that is in your opinion missing from the game, you are free to submit mod requests at [http://community.playstarbound.com/forums/modding.111/ Offical Starbound Mod Forums]. Another area that allows modding requests is the subreddit [https://www.reddit.com/r/starboundmods/ /r/starboundmods].<br />
<br />
= Text Editing =<br />
==== What text editor should I use? ====<br />
This is a complex question, but the simple answer is, "Just about anything except Windows Notepad."<br />
<br />
We have a list of [[Modding:Text Editors|suggested text editors]] and a few tips for using them with JSON and Lua.<br />
<br />
= Graphics Editing =<br />
==== What image editor should I use? ====<br />
<br />
Please see this [[Modding:Image Editing|list of suggested image editors.]] There's a guide detailing the game's specific art styling [[Guide:Art|here]].<br />
<br />
= Troubleshooting =<br />
<br />
=== My game keeps crashing! ===<br />
<br />
You can start by checking the [[Modding:Starbound_Log_File|log file]]. You can find errors in there telling you which line in your code caused the crash. Loading the multiplayer server will give you a console, but restarting it frequently is tedious.<br />
<br />
An online [[Modding:JSON|JSON]] parser will help catch some common mistakes, such as missing commas and unmatched braces in your modified files. For more information about JSON, see the [[Modding:JSON|JSON]] page, or see the index of JSON configuration file types [[Modding:JSON Object Types|here]].<br />
<br />
=== Mac specific problem with .DS_Store files ===<br />
<!-- This seems to be seriously outdated -- Offended Koala was back in 2014. --><br />
Currently (beta v. Offended Koala) the Mac version will crash if the data directory ( ~/Library/Application\ Support/Steam/SteamApps/common/Starbound for Steam users) is opened with the Finder, because doing so creates invisible [http://en.wikipedia.org/wiki/.DS_Store .DS_Store] files, and these cause the Starbound client to crash on launch. <br />
<br />
Until the bug is fixed, Mac-based modders can remove the files from their Starbound directory using the terminal (the following command removes them from all Steam apps - this should be non-problematic, but if so append the Starbound directory name to the path): <br />
<br />
<pre>find ~/Library/Application\ Support/Steam/SteamApps/common -name .DS_Store -exec rm {} \;</pre><br />
<br />
=== How can I help the modding community? === <-- this shouldn't be in "troubleshooting"? --><br />
<br />
Check out [[Modding:Modding/DocumentationTODO]] to see a list of things that need to be done for modding documentation on this wiki.<br />
<br />
<br />
= Where can I get more information? =<br />
<br />
[http://community.playstarbound.com/forums/starbound-modding.111/ The official modding forums]<br />
<br />
[https://discordapp.com/invite/Starbound The official discord server] has a #modding channel<br />
<br />
There is also the IRC channel ##starbound-modding on the Freenode network, which can be accessed [http://webchat.freenode.net/?channels=%23%23starbound-modding&uio=d4 here]. Please note that this channel is dedicated to the ins and outs of modding, and is '''not''' the place to ask about a mod you downloaded! We don't kick or ban for minor netiquette breaches, but if the room is busy, be courteous and obey the rules or you may have a problem.<br />
<br />
If you use the IRC channel, follow these simple rules:<br />
* Use a pastebin like pastebin.com for anything over 2-3 lines.<br />
* Check the [http://starbounder.org/Modding:Starbound_Log_File log files] first. If there's an error you don't understand and want us to look at, post it on a pastebin for us to look at, along with any relevant code.<br />
* Do not spam the chat with excessive emotes or offtopic chat. Some offtopic is fine, but if people are talking about modding, try not to spam up the chat with fluff. You can go to #starbound or #starbound-overflow for that.<br />
* Constructive criticism is welcome, but be thoughtful and respectful of others.<br />
* Don't walk into chat and ask "hay guise how do i mod lol." We're all bootstrapping our own modding efforts by doing a lot of reading through the example code, reading others' mods, and experimentation.</div>😺https://starbounder.org/mediawiki/index.php?title=Talk:Starbound_Wiki&diff=172675Talk:Starbound Wiki2017-04-29T10:07:16Z<p>😺: </p>
<hr />
<div>What's up with the goddarn captcha ? This captcha is HARD ! Change it my god ! This is easier to do as a computer than a human !<br />
<br />
English isn't everybody's first language !<br />
<br />
== About the captcha ==<br />
<br />
Hey it's me again. The captcha rant guy... <br />
<br />
http://pastebin.com/Q4ucYaBp<br />
<br />
Captcha is officially broken. Sorry if I offend you, but can we use a good one now ?<br />
::You're not offending me, but the captcha isn't broken from what I can see. Try writing the number out and then counting digits from the right to left (the right most digit is the first).<br />
<br />
::There aren't that many cases where the captcha is going to be triggered, mostly when new pages created. Admining a wiki means constantly fighting spammers, and this captcha has actually been really successful for that - I've probably tried 4 or 5 different ones and it's worked the best by far.<br />
<br />
::Instead of just saying "Change it!" and "Can we use a good one?", do you have any suggestions for a better one that would be just as effective? [[User:Katzeus|Katzeus]] ([[User talk:Katzeus|talk]]) 12:58, 28 August 2016 (EDT)<br />
<br />
:::I've been encountering that captcha a lot tonight as I was updating the modding section. I ended up [https://www.browserling.com/tools/words-to-numbers this website] to do it for me. --[[User:😺|😺]] ([[User talk:😺|talk]]) 11:06, 29 April 2017 (BST)<br />
<br />
== Style Guide ==<br />
<br />
Does this Wiki have a style guide? [[User:SlimyJoey|SlimyJoey]] ([[User talk:SlimyJoey|talk]]) 16:47, 29 November 2016 (UTC)<br />
:I think the top guide [[Projects:Guides#Wiki_Editing_Guides|here]] is the closest we've got right now. [[User:Katzeus|Katzeus]] ([[User talk:Katzeus|talk]]) 18:45, 29 November 2016 (UTC)<br />
<br />
== Adding the Discord channel to the official links ==<br />
<br />
https://discordapp.com/invite/Starbound ? CF members are in there so it seems pretty "official" to me --[[User:😺|😺]] ([[User talk:😺|talk]]) 11:06, 29 April 2017 (BST)</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Portal&diff=172674Modding:Portal2017-04-29T09:57:37Z<p>😺: Updated "installing mods" section: added mentions of steam workshop, removed mentions of beta version paths</p>
<hr />
<div>{{Modding}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
<br />
Many aspects of Starbound are available for modifying or expanding, from items and monsters, to villagers, towns, and even whole planets.<br />
<br />
= Installing Mods =<br />
Chucklefish Games provides two official sources for mods, the [http://community.playstarbound.com/resources/categories/starbound.21/ Starbound Mod Repository] and the [http://community.playstarbound.com/forums/mod-releases-wips.103/ Starbound Modding Forum]. Steam users can also browse the [http://steamcommunity.com/app/211820/workshop/ Steam Workshop]. Once downloaded, you will want to place the files within Starbound's mod directory: <br />
: <font face="Starbound">Starbound\mods\</font><br />
If purchased from Steam, the location of the main Starbound directory folder typically looks like this: <br />
:<font face="Starbound">Steam\steamapps\common\Starbound</font><br />
Workshop mods are automatically downloaded in <font face="Starbound">Steam\steamapps\workshop\content\211820</font>.<br><br />
They do not need to be moved to the Starbound\mods\ folder, the game will load them automatically.<br />
<br />
<br />
Mods can be found in three forms:<br />
* compressed (.zip, .7zip, .rar, ...): those are generally unpacked compressed mods. Starbound cannot handle them, and you'll have to unzip them first.<br />
* unpacked: those are the raw files, directories, etc.<br />
*: <font face="Starbound">\mods\''modname''</font><br />
* packed (.pak): those are "packed" in a format that Starbound can read, and is generally prefered for faster loading.<br />
*: <font face="Starbound">\mods\''modname.pak''</font><br />
<br />
A more in-depth installation guide is available [http://community.playstarbound.com/threads/installing-mods-for-starbound-1-0.118081/ on the official forum].<br />
<br />
= How do I mod Starbound? =<br />
<br />
The moddable assets are located in the [[Modding:Asset_Tree|Asset Tree]], which is located in your Starbound directory under /Starbound/assets. There are several types of assets. Editing an existing asset will change the base behavior of the game. You can add new assets, although getting those assets into the game may be tricky depending on what you're trying to add. The official modding forums are the best source of up-to-date information on specifics.<br />
<br />
* [[Modding:JSON_Object_Types|JSON Objects]]: There are hundreds of [[Modding:JSON|JSON]] configuration files in various directories inside /assets/, with dozens of different extensions, like .config, .frames, .animation, .gun, etc. Any files with extensions that do not match the ones listed below are probably JSON config files.<br />
* [[Modding:Lua Language|Lua Scripting]]: Monsters, NPCs, and certain objects use Lua scripts to control their behavior. Lua scripting has a lot of potential, but currently suffers from severe scoping limitations. Lua files always end with the extension ".lua." The Lua API is documented in some Lua files in the 'Starbound/doc/lua' game's folder, and is also [[Modding:Lua API|explained here]] and although it may sometimes be a little outdated, should help.<br />
* Sound files: File extensions are either ".wav" or ".ogg"<br />
* Graphics: File extension is ".png" for graphics.<br />
<br />
= Yeah man, but how do I mod Starbound?! =<br />
The developers are very responsive to requests from the community and have already implemented some things by request since the beginning of beta. The best way for you to learn how to mod is go to the official forums, do a bunch of reading, look at some existing mods, and of course do extensive browsing of the asset files until you form some understanding of them.<br />
<br />
* Multiple ressources are available to get you started, pick your media of preference:<br />
** [[Modding:Basics|The Modding Basics]] is a step-by-step guide on this very wiki<br />
** [http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/ An unofficial ebook] was created especially for those completely new to the modding scene.<br />
** [https://www.youtube.com/watch?v=kAVn7JoYHp0 This video] covers everything from how to unpack your Starbound assets to making a basic decorative custom object, how to make a recipe for that object, how to learn that recipe and finally how to pack and distribute it when you are done<br />
** For more specific needs, the official forums have [http://community.playstarbound.com/forums/starbound-modding.111/?prefix_id=52 a "tutorial" tag that you can browse].<br />
<br />
* Information on the [[Modding:Lua_API|Lua API]] is documented in .md files in the Starbound/doc/lua folder.<br />
<br />
* If you have any problems, comb through the included assets. They are a rich source of examples you can follow. Before you try to make anything complex, you should start with copying something simple.<br />
<br />
* You can also download some sample mods (make sure they are up to date, as the mod specifications changed a few times in the beta) to learn from.<br />
<br />
<br />
=== Older, Outdated Info === <!-- Do we really need this? --><br />
<br />
* The place we all started was [http://community.playstarbound.com/index.php?threads/basic-object-implementation-a-tutorial.21463/ Molly's first post about creating a simple item], although the specifics of this mod are now outdated.<br />
<br />
* There is also an outdated [http://steamcommunity.com/sharedfiles/filedetails/?id=201040798 tutorial] on Steam about basic modding, but which doesn't account for __merge functionality or .modinfo files.<br />
<br />
* Above-mentionned [http://community.playstarbound.com/index.php?threads/overriding-and-merging-config-files-in-mods.53775/ __merge functionality] and [http://community.playstarbound.com/index.php?threads/making-mod-installation-easier.52349/ .modinfo files] are now also outdated, and have been replaced by [http://community.playstarbound.com/threads/basic-patching-now-with-path-guide-v1-9.84496/ the patching system] and the _metadata files.<br />
<br />
= Where is ''feature X''? =<br />
Now that the game is officially released, if there is a feature that is in your opinion missing from the game, you are free to submit mod requests at [http://community.playstarbound.com/forums/modding.111/ Offical Starbound Mod Forums]. Another area that allows modding requests is the subreddit [https://www.reddit.com/r/starboundmods/ /r/starboundmods].<br />
<br />
= Text Editing =<br />
<br />
=== What text editor should I use? ===<br />
This is a complex question, but the simple answer is, "Just about anything except Windows Notepad."<br />
<br />
We have a list of [[Modding:Text Editors|suggested text editors]] and a few tips for using them with JSON and Lua.<br />
<br />
= Graphics Editing =<br />
<br />
=== What image editor should I use? ===<br />
<br />
Please see this [[Modding:Image Editing|list of suggested image editors.]] There's a guide detailing the game's specific art styling [[Guide:Art|here]].<br />
<br />
= Troubleshooting =<br />
<br />
=== My game keeps crashing! ===<br />
<br />
You can start by checking the [[Modding:Starbound_Log_File|log file]]. You can find errors in there telling you which line in your code caused the crash. Loading the multiplayer server will give you a console, but restarting it frequently is tedious.<br />
<br />
An online [[Modding:JSON|JSON]] parser will help catch some common mistakes, such as missing commas and unmatched braces in your modified files. For more information about JSON, see the [[Modding:JSON|JSON]] page, or see the index of JSON configuration file types [[Modding:JSON Object Types|here]].<br />
<br />
=== Mac specific problem with .DS_Store files ===<br />
<!-- This seems to be seriously outdated -- Offended Koala was back in 2014. --><br />
Currently (beta v. Offended Koala) the Mac version will crash if the data directory ( ~/Library/Application\ Support/Steam/SteamApps/common/Starbound for Steam users) is opened with the Finder, because doing so creates invisible [http://en.wikipedia.org/wiki/.DS_Store .DS_Store] files, and these cause the Starbound client to crash on launch. <br />
<br />
Until the bug is fixed, Mac-based modders can remove the files from their Starbound directory using the terminal (the following command removes them from all Steam apps - this should be non-problematic, but if so append the Starbound directory name to the path): <br />
<br />
<pre>find ~/Library/Application\ Support/Steam/SteamApps/common -name .DS_Store -exec rm {} \;</pre><br />
<br />
=== How can I help the modding community? ===<br />
<br />
Check out [[Modding:Modding/DocumentationTODO]] to see a list of things that need to be done for modding documentation on this wiki.<br />
<br />
<br />
= Where can I get more information? =<br />
<br />
[http://community.playstarbound.com/forums/starbound-modding.111/ The official modding forums]<br />
<br />
[https://discordapp.com/invite/Starbound The official discord server] has a #modding channel<br />
<br />
There is also the IRC channel ##starbound-modding on the Freenode network, which can be accessed [http://webchat.freenode.net/?channels=%23%23starbound-modding&uio=d4 here]. Please note that this channel is dedicated to the ins and outs of modding, and is '''not''' the place to ask about a mod you downloaded! We don't kick or ban for minor netiquette breaches, but if the room is busy, be courteous and obey the rules or you may have a problem.<br />
<br />
If you use the IRC channel, follow these simple rules:<br />
* Use a pastebin like pastebin.com for anything over 2-3 lines.<br />
* Check the [http://starbounder.org/Modding:Starbound_Log_File log files] first. If there's an error you don't understand and want us to look at, post it on a pastebin for us to look at, along with any relevant code.<br />
* Do not spam the chat with excessive emotes or offtopic chat. Some offtopic is fine, but if people are talking about modding, try not to spam up the chat with fluff. You can go to #starbound or #starbound-overflow for that.<br />
* Constructive criticism is welcome, but be thoughtful and respectful of others.<br />
* Don't walk into chat and ask "hay guise how do i mod lol." We're all bootstrapping our own modding efforts by doing a lot of reading through the example code, reading others' mods, and experimentation.</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Basic_Property_Modification&diff=172670Modding:Basic Property Modification2017-04-29T09:11:50Z<p>😺: Added quicknav and a notice about outdated info, tagged as work in progress, set the TOC to the right. This needs rewrite, the __merge system was depreciated ages ago</p>
<hr />
<div>{{WorkInProgress}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
'''''<font color="red">As of 2017, this page contains outdated info - it needs a rewrite taking the patching system into account. For now, please refer to [[Modding:Basics#External links|this page's external links section]] for references</font>'''''<br />
<br />
==Introduction==<br />
This tutorial will show you how to edit a vanilla file and create an associated mod.<br />
In this example we will be modifying the fuel value of coalore. <br />
<br />
<br />
==Setup==<br />
Before we start - make sure you have unpacked your assets and created a mod folder with a modinfo file. You can learn all those things at [[Modding:Basics|Modding Basics]].<br />
<br />
==Important Notes==<br />
One of the most important things to be wary of when editing vanilla files is that the modified vanillia file should be in the exact parallel directory as the vanilla file.<br />
<br />
For example <br />
{| class="wikitable"<br />
|-<br />
| Vanilla location || Assets \ items \ generic \ crafting \ coalore.item<br />
|-<br />
| Mod location || Starbound \ mods \ mymod \ items \ generic \ crafting \ coalore.item<br />
|}<br />
<br />
As you can see mymod = assets, so where coalore needs to follow the folder structure after assets. This is so the game will use the asset in your mod folder instead of that in the vanilla directory.<br />
<br />
This is an extremely important step and if not done properly might crash the game.<br />
Once you've created the folder structure as shown in the above example, copy the coalore item from your unpacked assets into the correct parallel folder as the example.<br />
<br />
Now its time to edit the information.<br />
<br />
==File Editing==<br />
<pre>{<br />
"itemName" : "coalore",<br />
"rarity" : "Common",<br />
"inventoryIcon" : "coalore.png",<br />
"description" : "It's coal. A decent source of fuel.",<br />
"shortdescription" : "Coal",<br />
"fuelAmount" : 2<br />
}</pre><br />
( ''Coal Ore Item Code'' )<br />
<br />
Now we have two options in how we want to proceed.<br />
One option is famously known as a "Dirty Edit" this means simply editing the file and saving it. Because the file is in the exact same mirror location as in vanilla. The game will automatically replace the modded file with the new one. If it is in the wrong location the game will crash with a Starbound.log error of duplicate file. ( An important point to keep in mind )<br />
<br />
The biggest issue with a dirty edit is, it is highly incompatible with any other mod which wishes to edit that file. Which is why the Merge feature was added in Angry Koala. If you are planning on playing alone without other peoples mods. Feel free to use Dirty edits - but if you plan on Publishing your mod - read about merging.<br />
<br />
==Merging==<br />
'''NOTE: "__merge" style patches no longer work.''' See [http://playstarbound.com/august-19-the-day-when-all-your-mods-died/ this] article for details.<br />
<br />
Merging is a massive topic by it self, and quite complex - so we are only going to just briefly discuss it. For more information on merging, I suggest checking out Bartwe's post found here : http://community.playstarbound.com/index.php?threads/overriding-and-merging-config-files-in-mods.53775/<br />
<br />
Now to merge the coal ore item with the new information is quite simple. Delete all the information inside of the coalore.item inside of the mod folder ( '''do not delete the file it self''' ) and replace it with the following code.<br />
<br />
<pre>{<br />
"__merge" : [],<br />
"description" : "Super Powered Coal.",<br />
"fuelAmount" : 500<br />
}</pre><br />
( ''Merge Example 1'' )<br />
<br />
It is as simple as that. Now when you save the file and load the game, every-time you put coalore into the fuel tank you will be getting 500 fuel per coal. Also the description has been changed to "Super Powered Coal" <br />
<br />
The same rules of JSON still apply. No comma's on the last line of the data set, so if you want to make multiple edits make sure you watch your comma and bracket placements.<br />
<br />
Important Note<br />
This is an extremely basic example of how to merge one type of data. There are many types of data in JSON files from arrays to maps. None of which is covered here. I strongly suggest reading Bartwe's link provided above to get a more detailed idea of merge functions.<br />
<br />
==Summary==<br />
To quickly summarize<br />
You created a new folder inside Starbound \ mods such as "mymod"<br />
So the folder you are working inside is Starbound \ mods \ mymod<br />
<br />
Inside mymod folder you have a mymod.modinfo file as described by the Modding Basics link provided above.<br />
<br />
Inside mymod folder you also have the directory structure as follows<br />
<pre><br />
mods<br />
-mymod --> (modinfo located here)<br />
--items<br />
---generic<br />
----crafting<br />
-----coalore.item<br />
</pre><br />
<br />
and the code for coalore.item has been replaced with the Merge Example 1.<br />
<br />
<br />
You are now ready to start modding '''basic''' vanilla files.<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Basics&diff=172669Modding:Basics2017-04-29T08:59:36Z<p>😺: Moved the quick navigation to the bottom, added a few external links, edited some outdated info, added some stuff in Step 2</p>
<hr />
<div>{{WorkInProgress}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
This article will show you the steps you need to take before you can start actually modding, and also the steps you can take after you are done modding, to pack and publish your mod.<br />
<br />
You will need a [[Modding:Text Editors|text editor]]. Do not use a word processor such as MS Word instead of a text editor. Also do not use the basic notepad.exe, as it does not support UNIX line endings. Only UTF-8 is supported, other encodings are likely to cause crashes.<br />
<br />
Alternative sources for getting started in modding include the Official Chucklefish Forums, the Unofficial Modding Ebook, the third-party program ModPakHelper that can be used for both unpacking and packing assets, a video, and some more. See [[Modding:Basics#External links|external links]] below.<br />
<br />
= Step 1 - Unpacking Assets =<br />
[[Version_history#Furious_Koala|Furious Koala]] introduced a ''.pak'' format which improves loading times and eases mod distribution. This means we need to unpack the assets before we can start modding.<br />
<br />
Note - This step will not remove or change your ''packed.pak'' file, but simply extract its content for use as reference material. Changes you make to the unpacked assets will have no effect on your game.<br />
<br />
=== Windows ===<br />
''Current as of Version 1.2.2, January 18th, 2017''<br />
# Open up the main directory folder for Starbound.<br />
# Shift + right-click within the folder and select ''Open Command Prompt'' or equivalent (depends on Windows version).<br />
# Type the following into ''Command Prompt'': <code>"win32\asset_unpacker.exe" "assets\packed.pak" "_UnpackedAssets"</code><br />
# ''Command Prompt'' will do nothing until ''asset_unpacker.exe'' has finished. There are no progress updates.<br />
# Once ''Command Prompt'' displays a message equivalent to this, "Unpacked assets to _UnpackedAssets in 250.063s," you can close the program and move on to creating mods.<br />
<br />
'''<big>Notes</big>'''<br />
*If purchased from Steam, the location of the main Starbound directory folder typically looks like this: <CODE>Steam\steamapps\common\Starbound</CODE><br />
*The text typed into ''Command Prompt'' are three directory locations:<br />
*# The location of ''asset_unpacker.exe'', which is the program that does all of the unpacking.<br />
*# The location of Starbound assets, or Mod assets, to be unpacked.<br />
*# Where you want the unpacked assets to be dumped. This third string can be changed to whichever location or name you prefer.<br />
<br />
=== Mac ===<br />
'''''<font color="red">Possibly outdated</font>'''''<br />
<br />
Right click on Starbound.app and select "Show Package Contents". Next, locate your ''packed.pak'' file under ''Starbound/assets/''. Finally create a new directory for the unpacked files, for example ''Starbound/assets/unpacked/''.<br />
<br />
Now open your command prompt window and enter first the location of ''asset_unpacker'', then the location of ''packed.pak'', and lastly the directory you want to unpack it into. '''Let the script run'''. When it finishes, you should see a long list of files and folders in the location you chose.<br />
<br />
= Step 2 - Setting Up Your First Mod =<br />
The Starbound/mods folder is where you're going to place .pak files or unpacked mods folders. Create a directory inside this.<br />
===_metadata file===<br />
This file is entirely optional.<br />
<br />
The _metadata file contains general information about the mod which will be displayed in the mod list on the Starbound title screen, and informations the game uses to determine load order if needed. Note that parameter's order doesn't matter, and that '''each parameter is optional'''; Starbound will deal without it. You could for example only fill the author field and not put the rest, or put everything but the version number. If you don't need a parameter, don't write it.<br />
<br />
A _metadata file looks like this<br />
{<br />
"version" : "2.00 Alpha Gold",<br />
"friendlyName" : "Cool mod",<br />
"link" : "http://example.com",<br />
"name" : "coolmod",<br />
"description" : "This a cool mod!",<br />
"author" : "NAME",<br />
"requires" : ["anothermod", "coolmod2"],<br />
"includes" : ["coolmodv1"],<br />
"priority" : 0<br />
}<br />
<br />
{| class="wikitable"<br />
|-<br />
! Entry !! Description<br />
|-<br />
| <tt>version</tt> || The version number of your mod.<br />
|-<br />
| <tt>friendlyname</tt> || The name that will show up in the mod list menu.<br />
|-<br />
| <tt>link</tt> || A URL that links to the mod.<br />
|-<br />
| <tt>name</tt> || The "behind the scenes" name that is used for other mods' requires and includes options<br />
|-<br />
| <tt>description</tt> || The description of the mod. Type '\n' for a new line, and escape quotations with a \, such as <pre>"description" : "This mod is \"cool\", if you know what I mean."</pre><br />
|-<br />
| <tt>author</tt> || The author of the mod.<br />
|-<br />
| <tt>steamContentId</tt> || The workshop's unique id that steam uses. The Mod Uploader Tool available with Starbound's Steam version will fill this automatically.<br />
|-<br />
| <tt>priority</tt> || The lower the number, the sooner it'll be loaded. The base assets.pak has a priority of -9999. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>includes</tt> || Any mods listed here will be loaded before this mod, if they exist. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
| <tt>requires</tt> || Any mods listed here will be '''required''' and the game will crash at startup if those mods aren't present. <br>'''''<font color="red">(remember that any parameter is optional! Don't add this if you don't need it!)</font>'''''<br />
|-<br />
|}<br />
<br />
= Step 3 - Modding =<br />
=== Tutorials ===<br />
* [[Basic Property Modification|Editing Vanilla Files]]<br />
<br />
=== Reference Pages ===<br />
* [[Data:Assets|Data Assets]]<br />
* [[Modding:Materials:Mods|New Custom Material ID Registration]]<br />
* [[Modding:Liquids:Mods|New Custom Liquid ID Registration]]<br />
<br />
If you did everything right, Starbound should load your new mod the next time you run it. If the game crashes, or your changes are not found in the game, check your [http://community.playstarbound.com/index.php?threads/how-to-report-mod-errors-fixing-most-problems-yourself.69198/ starbound.log] file.<br />
<br />
= Step 4 - Packing your mod =<br />
Before publishing your mod, it is better to pack it as a single ''<modname>.pak'' file.<br />
This process is recommended because it simplifies the installation (drop the file in the ''Starbound/mods/'' folder), as well as the required I/O to read it. The alternative is to just put all the files into a zip archive.<br />
<br />
To pack your mod, use the asset_packer(.exe) tool the same way you've used asset_unpacker to unpack your assets, or use ModPackHelper:<br />
<br />
=== Windows/Linux with ModPackHelper ===<br />
# If you haven't done it already, install modPackHelper (Simply drag script into Starbound\mods folder (and give executable rights for .sh))<br />
# Select the "pack mods" action<br />
# Choose the mod from the list (or set multiple choice with space, comma or semicolon)<br />
# Press Enter. The mod is available in the ''Starbound/mods/'' folder as <modname>.pak.<br />
<br />
= Step 5 - Publishing =<br />
Only one thing left to do - publish your mod! To do this, go to the official [http://community.playstarbound.com/index.php?resources/ modding forums], select "add mod" in the upper right hand section, select the category of your mod, fill out the information form and hit save. It is that easy.<br />
The Steam version provides an utility to pack and upload mods to the Steam Workshop directly (and can also generate your _metadata file).<br />
<br />
There are other places mods can be uploaded, or you can just share it with friends. What you do with your mod is up to you!<br />
<br />
= External links =<br />
* [http://community.playstarbound.com/forums/starbound-modding.111/ Chucklefish Forums - Starbound Modding]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/how-to-successfully-pack-and-unpack-pak-files.66649/ How to successfully pack and unpack .pak files]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/getting-started-in-making-mods-for-starbound.122055/ Getting started in making mods for Starbound]<br />
* Chucklefish Forums: [http://community.playstarbound.com/threads/all-versions-win-linux-modpackhelper.92473/ ModPackHelper]<br />
* Chucklefish Mods: [http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/ Unofficial Modding Ebook 2.0]<br />
* Youtube: [https://www.youtube.com/watch?v=kAVn7JoYHp0 Starbound Tutorial, From Unpacking to Distribution and Everything Inbetween v1.2+ ]<br />
* Chucklefish Forums: [http://community.playstarbound.com/forums/starbound-modding.111/?prefix_id=52 Browse the "tutorial" tag] for more diverse and in-depth tutorials.<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Portal&diff=172668Modding:Portal2017-04-29T08:09:43Z<p>😺: /* Yeah man, but how do I mod Starbound?! */ -> removed the _metadata file and patching parts, as it belongs more in Modding:Basics. Added a video to the resource list</p>
<hr />
<div>{{Modding}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
<br />
Many aspects of Starbound are available for modifying or expanding, from items and monsters, to villagers, towns, and even whole planets.<br />
<br />
= Installing Mods =<br />
Chucklefish Games provides two official sources for mods, the [http://community.playstarbound.com/resources/categories/starbound.21/ Starbound Mod Repository] and the [http://community.playstarbound.com/forums/mod-releases-wips.103/ Starbound Modding Forum]. Once downloaded, you will want to place the files within the mod directory for the current version of the game. Note that ZIP or RAR compressed files will not work with Starbound, and must be uncompressed first.<br />
:{|<br />
| style="font-family:Starbound;" | "Starbound\koala_storage\mods\"<br />
| December 4th, 2013 || - || January 28th, 2015<br />
|-<br />
| style="font-family:Starbound;" | "Starbound\giraffe_storage\mods\"<br />
| January 28th, 2015 || - || July 22nd, 2015<br />
|-<br />
| style="font-family:Starbound;" | "Starbound\mods\"<br />
| July 22nd, 2015 || - || Current<br />
|}<br />
<br />
<br />
There are two methods for installing mods into your "\mod" directory: Unpacked and PAKed.<ref>Chucklefish Forum: http://community.playstarbound.com/threads/guide-to-installing-mods-v-1-2.89072/ May 2015</ref> It is important for the directory structure to match the examples below, since an extra directory will stop a mod from loading. For example, "\mods\''ModName''\''PAK file''" does not match the example below, and will not work.<br />
* Unpacked is simply all of the files and directories placed into a single directory within the "\mods" directory. These types of mods are often distributed in ZIP or RAR compressed files.<br />
*: <font face="Starbound">\mods\''ModName''\''assets, directories, and MODINFO file''</font><br />
* PAKed is a combination of both, with assets and directories stored in a single PAK file, and the PAK file and MODINFO file stored within a single directory located in the "\mods" directory.<br />
*: <font face="Starbound">\mods\''ModName''\''PAK file and MODINFO file''</font><br />
<br />
= How do I mod Starbound? =<br />
<br />
The moddable assets are located in the [[Modding:Asset_Tree|Asset Tree]], which is located in your Starbound directory under /Starbound/assets. There are several types of assets. Editing an existing asset will change the base behavior of the game. You can add new assets, although getting those assets into the game may be tricky depending on what you're trying to add. The official modding forums are the best source of up-to-date information on specifics.<br />
<br />
* [[Modding:JSON_Object_Types|JSON Objects]]: There are hundreds of [[Modding:JSON|JSON]] configuration files in various directories inside /assets/, with dozens of different extensions, like .config, .frames, .animation, .gun, etc. Any files with extensions that do not match the ones listed below are probably JSON config files.<br />
* [[Modding:Lua Language|Lua Scripting]]: Monsters, NPCs, and certain objects use Lua scripts to control their behavior. Lua scripting has a lot of potential, but currently suffers from severe scoping limitations. Lua files always end with the extension ".lua." The Lua API is documented in some Lua files in the 'Starbound/doc/lua' game's folder, and is also [[Modding:Lua API|explained here]] and although it may sometimes be a little outdated, should help.<br />
* Sound files: File extensions are either ".wav" or ".ogg"<br />
* Graphics: File extension is ".png" for graphics.<br />
<br />
= Yeah man, but how do I mod Starbound?! =<br />
The developers are very responsive to requests from the community and have already implemented some things by request since the beginning of beta. The best way for you to learn how to mod is go to the official forums, do a bunch of reading, look at some existing mods, and of course do extensive browsing of the asset files until you form some understanding of them.<br />
<br />
* Multiple ressources are available to get you started, pick your media of preference:<br />
** [[Modding:Basics|The Modding Basics]] is a step-by-step guide on this very wiki<br />
** [http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/ An unofficial ebook] was created especially for those completely new to the modding scene.<br />
** [https://www.youtube.com/watch?v=kAVn7JoYHp0 This video] covers everything from how to unpack your Starbound assets to making a basic decorative custom object, how to make a recipe for that object, how to learn that recipe and finally how to pack and distribute it when you are done<br />
** For more specific needs, the official forums have [http://community.playstarbound.com/forums/starbound-modding.111/?prefix_id=52 a "tutorial" tag that you can browse].<br />
<br />
* Information on the [[Modding:Lua_API|Lua API]] is documented in .md files in the Starbound/doc/lua folder.<br />
<br />
* If you have any problems, comb through the included assets. They are a rich source of examples you can follow. Before you try to make anything complex, you should start with copying something simple.<br />
<br />
* You can also download some sample mods (make sure they are up to date, as the mod specifications changed a few times in the beta) to learn from.<br />
<br />
<br />
=== Older, Outdated Info === <!-- Do we really need this? --><br />
<br />
* The place we all started was [http://community.playstarbound.com/index.php?threads/basic-object-implementation-a-tutorial.21463/ Molly's first post about creating a simple item], although the specifics of this mod are now outdated.<br />
<br />
* There is also an outdated [http://steamcommunity.com/sharedfiles/filedetails/?id=201040798 tutorial] on Steam about basic modding, but which doesn't account for __merge functionality or .modinfo files.<br />
<br />
* Above-mentionned [http://community.playstarbound.com/index.php?threads/overriding-and-merging-config-files-in-mods.53775/ __merge functionality] and [http://community.playstarbound.com/index.php?threads/making-mod-installation-easier.52349/ .modinfo files] are now also outdated, and have been replaced by [http://community.playstarbound.com/threads/basic-patching-now-with-path-guide-v1-9.84496/ the patching system] and the _metadata files.<br />
<br />
= Where is ''feature X''? =<br />
Now that the game is officially released, if there is a feature that is in your opinion missing from the game, you are free to submit mod requests at [http://community.playstarbound.com/forums/modding.111/ Offical Starbound Mod Forums]. Another area that allows modding requests is the subreddit [https://www.reddit.com/r/starboundmods/ /r/starboundmods].<br />
<br />
= Text Editing =<br />
<br />
=== What text editor should I use? ===<br />
This is a complex question, but the simple answer is, "Just about anything except Windows Notepad."<br />
<br />
We have a list of [[Modding:Text Editors|suggested text editors]] and a few tips for using them with JSON and Lua.<br />
<br />
= Graphics Editing =<br />
<br />
=== What image editor should I use? ===<br />
<br />
Please see this [[Modding:Image Editing|list of suggested image editors.]] There's a guide detailing the game's specific art styling [[Guide:Art|here]].<br />
<br />
= Troubleshooting =<br />
<br />
=== My game keeps crashing! ===<br />
<br />
You can start by checking the [[Modding:Starbound_Log_File|log file]]. You can find errors in there telling you which line in your code caused the crash. Loading the multiplayer server will give you a console, but restarting it frequently is tedious.<br />
<br />
An online [[Modding:JSON|JSON]] parser will help catch some common mistakes, such as missing commas and unmatched braces in your modified files. For more information about JSON, see the [[Modding:JSON|JSON]] page, or see the index of JSON configuration file types [[Modding:JSON Object Types|here]].<br />
<br />
=== Mac specific problem with .DS_Store files ===<br />
<!-- This seems to be seriously outdated -- Offended Koala was back in 2014. --><br />
Currently (beta v. Offended Koala) the Mac version will crash if the data directory ( ~/Library/Application\ Support/Steam/SteamApps/common/Starbound for Steam users) is opened with the Finder, because doing so creates invisible [http://en.wikipedia.org/wiki/.DS_Store .DS_Store] files, and these cause the Starbound client to crash on launch. <br />
<br />
Until the bug is fixed, Mac-based modders can remove the files from their Starbound directory using the terminal (the following command removes them from all Steam apps - this should be non-problematic, but if so append the Starbound directory name to the path): <br />
<br />
<pre>find ~/Library/Application\ Support/Steam/SteamApps/common -name .DS_Store -exec rm {} \;</pre><br />
<br />
=== How can I help the modding community? ===<br />
<br />
Check out [[Modding:Modding/DocumentationTODO]] to see a list of things that need to be done for modding documentation on this wiki.<br />
<br />
<br />
= Where can I get more information? =<br />
<br />
[http://community.playstarbound.com/forums/starbound-modding.111/ The official modding forums]<br />
<br />
[https://discordapp.com/invite/Starbound The official discord server] has a #modding channel<br />
<br />
There is also the IRC channel ##starbound-modding on the Freenode network, which can be accessed [http://webchat.freenode.net/?channels=%23%23starbound-modding&uio=d4 here]. Please note that this channel is dedicated to the ins and outs of modding, and is '''not''' the place to ask about a mod you downloaded! We don't kick or ban for minor netiquette breaches, but if the room is busy, be courteous and obey the rules or you may have a problem.<br />
<br />
If you use the IRC channel, follow these simple rules:<br />
* Use a pastebin like pastebin.com for anything over 2-3 lines.<br />
* Check the [http://starbounder.org/Modding:Starbound_Log_File log files] first. If there's an error you don't understand and want us to look at, post it on a pastebin for us to look at, along with any relevant code.<br />
* Do not spam the chat with excessive emotes or offtopic chat. Some offtopic is fine, but if people are talking about modding, try not to spam up the chat with fluff. You can go to #starbound or #starbound-overflow for that.<br />
* Constructive criticism is welcome, but be thoughtful and respectful of others.<br />
* Don't walk into chat and ask "hay guise how do i mod lol." We're all bootstrapping our own modding efforts by doing a lot of reading through the example code, reading others' mods, and experimentation.</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Image_Editing&diff=172667Modding:Image Editing2017-04-29T07:54:55Z<p>😺: Added Aseprite, moved the quick navigation to the bottom, moved table of content on the side.</p>
<hr />
<div><div style="float:right;">__TOC__</div><br />
<br />
There are many image editors for you to choose from. Photoshop is a popular program, but is very expensive and contains many features not necessary for doing pixel art.<br />
<br />
Here are other options for you to consider, either free or relatively inexpensive:<br />
<br />
=== Cross-Platform ===<br />
* [https://www.aseprite.org/ Aseprite] is what Chucklefish uses. It's payware, but you can build it from [https://github.com/aseprite/aseprite/ the sources] for free. They have packages in Ubuntu's repos, and Arch's AUR.<br />
* [http://www.gimp.org/ GIMP] (free, open source)<br />
* [http://www.pencil-animation.org Pencil]<br />
* [http://www.synfig.org/cms/ Synfig Studio]<br />
* [http://pinta-project.com Pinta]<br />
* [http://www.piskelapp.com/ Piskel]<br />
<br />
=== Windows ===<br />
* [http://www.getpaint.net/ Paint.NET] (free)<br />
* [http://www.humanbalance.net/gale/us/ Graphics Gale] (Shareware, $19.15 for full version)<br />
* [http://pyxeledit.com/get.php Pyxel Edit] (in beta, currently $9)<br />
<br />
=== Mac ===<br />
* [http://seashore.sourceforge.net/The_Seashore_Project/Download.html Seashore], based on GIMP but with a simplified UI/toolset<br />
* [http://paintbrush.sourceforge.net/ Paintbrush], a simple free editor well tuned for smaller scale images such as starbound assest<br />
* [http://pixenapp.com Pixen] ($9.99, but designed specifically for pixel/8-bit art)<br />
* [http://www.piskelapp.com/ Piskel] a nice software to make your own pixel based item sprites<br />
* [http://pyxeledit.com/get.php Pyxel Edit] (in beta, currently $9)<br />
<br />
=== Linux === <!-- https://www.reddit.com/r/interject/ --><br />
* Could use some more options here, Alan.<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Text_Editors&diff=172666Modding:Text Editors2017-04-29T07:44:47Z<p>😺: Moved the quick navigation to the bottom, moved table of content on the side</p>
<hr />
<div><div style="float:right;">__TOC__</div><br />
It is important to use a text editor which uses the UTF-8 character set (most do nowadays) for compatibility. Some editors have a bunch of useful features, eg. Syntax Highlighting and Linting, and some others can be expanded via addons. Here are some free options for you to research and consider:<br />
<br />
=== Cross-Platform (Windows, Mac, Linux) ===<br />
* [http://www.sublimetext.com/ Sublime Text]<br />
* [http://studio.zerobrane.com ZeroBrane Studio] is a lightweight Lua IDE with code completion, syntax highlighting, code analyzer, live coding, and debugging support. Free download, but the developers ask you to donate (click "Take me to the download page this time" on the first download page to download without paying)<br />
* [http://www.geany.org Geany] is a text editor using the GTK2 toolkit with basic features of an integrated development environment. It was developed to provide a small and fast IDE, which has only a few dependencies from other packages. It supports many filetypes and has some nice features.<br />
* [https://atom.io/ Atom] is a free text editor with syntax highlighting for tons of languages (including Lua and JSON), snippets, code folding, and a bunch of other features. It is also deeply customizable, which means that users can extend the editor even more by creating packages (plugins) for it or installing packages from Atom's package manager from within the editor's settings/preferences menu.<br />
* [https://code.visualstudio.com/ Visual Studio Code]<br />
<br />
=== Windows ===<br />
* [http://notepad-plus-plus.org/ Notepad++]<br />
* [http://www.pnotepad.org/ Programmer's Notepad]<br />
<br />
=== Mac ===<br />
* Terminal-based:<br />
** [http://www.vim.org/ Vim]<br />
** [https://www.gnu.org/software/emacs/emacs.html Emacs]<br />
* GUI:<br />
** [http://www.barebones.com/products/textwrangler/ Textwrangler] has been around for years and supports syntax coloring and project folder views, among other desirable features.<br />
** [https://itunes.apple.com/us/app/xcode/id497799835 Xcode] may be overkill, but it is also free.<br />
** [http://macromates.com/ Textmate 2] is free, but users are encouraged to buy a license. Textmate 1 requires a license.<br />
** [https://code.google.com/p/macvim/ macvim] (vim for Mac OS X)<br />
<br />
=== Linux ===<br />
* Terminal-based:<br />
** [http://www.vim.org/ Vim]<br />
** [https://www.gnu.org/software/emacs/emacs.html Emacs]<br />
<br />
{{Modding}}</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Text_Editors&diff=172665Modding:Text Editors2017-04-29T07:42:17Z<p>😺: Cleaned out the intro, added a few options, sublime text is now cross-platform</p>
<hr />
<div>{{Modding}}<br />
It is important to use a text editor which uses the UTF-8 character set (most do nowadays). Some editors have a bunch of useful features, eg. Syntax Highlighting and Linting, and some others can be expanded via addons. Here are some free options for you to research and consider:<br />
<br />
=== Cross-Platform (Windows, Mac, Linux) ===<br />
* [http://www.sublimetext.com/ Sublime Text]<br />
* [http://studio.zerobrane.com ZeroBrane Studio] is a lightweight Lua IDE with code completion, syntax highlighting, code analyzer, live coding, and debugging support. Free download, but the developers ask you to donate (click "Take me to the download page this time" on the first download page to download without paying)<br />
* [http://www.geany.org Geany] is a text editor using the GTK2 toolkit with basic features of an integrated development environment. It was developed to provide a small and fast IDE, which has only a few dependencies from other packages. It supports many filetypes and has some nice features.<br />
* [https://atom.io/ Atom] is a free text editor with syntax highlighting for tons of languages (including Lua and JSON), snippets, code folding, and a bunch of other features. It is also deeply customizable, which means that users can extend the editor even more by creating packages (plugins) for it or installing packages from Atom's package manager from within the editor's settings/preferences menu.<br />
* [https://code.visualstudio.com/ Visual Studio Code]<br />
<br />
=== Windows ===<br />
* [http://notepad-plus-plus.org/ Notepad++]<br />
* [http://www.pnotepad.org/ Programmer's Notepad]<br />
<br />
=== Mac ===<br />
* Terminal-based:<br />
** [http://www.vim.org/ Vim]<br />
** [https://www.gnu.org/software/emacs/emacs.html Emacs]<br />
* GUI:<br />
** [http://www.barebones.com/products/textwrangler/ Textwrangler] has been around for years and supports syntax coloring and project folder views, among other desirable features.<br />
** [https://itunes.apple.com/us/app/xcode/id497799835 Xcode] may be overkill, but it is also free.<br />
** [http://macromates.com/ Textmate 2] is free, but users are encouraged to buy a license. Textmate 1 requires a license.<br />
** [https://code.google.com/p/macvim/ macvim] (vim for Mac OS X)<br />
<br />
=== Linux ===<br />
* Terminal-based:<br />
** [http://www.vim.org/ Vim]<br />
** [https://www.gnu.org/software/emacs/emacs.html Emacs]</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Portal&diff=172664Modding:Portal2017-04-29T07:24:29Z<p>😺: Updated some infos and links</p>
<hr />
<div>{{Modding}}<br />
{{InfoBoxInner|__TOC__|style=float:right;}}<br />
<br />
Many aspects of Starbound are available for modifying or expanding, from items and monsters, to villagers, towns, and even whole planets.<br />
<br />
= Installing Mods =<br />
Chucklefish Games provides two official sources for mods, the [http://community.playstarbound.com/resources/categories/starbound.21/ Starbound Mod Repository] and the [http://community.playstarbound.com/forums/mod-releases-wips.103/ Starbound Modding Forum]. Once downloaded, you will want to place the files within the mod directory for the current version of the game. Note that ZIP or RAR compressed files will not work with Starbound, and must be uncompressed first.<br />
:{|<br />
| style="font-family:Starbound;" | "Starbound\koala_storage\mods\"<br />
| December 4th, 2013 || - || January 28th, 2015<br />
|-<br />
| style="font-family:Starbound;" | "Starbound\giraffe_storage\mods\"<br />
| January 28th, 2015 || - || July 22nd, 2015<br />
|-<br />
| style="font-family:Starbound;" | "Starbound\mods\"<br />
| July 22nd, 2015 || - || Current<br />
|}<br />
<br />
<br />
There are two methods for installing mods into your "\mod" directory: Unpacked and PAKed.<ref>Chucklefish Forum: http://community.playstarbound.com/threads/guide-to-installing-mods-v-1-2.89072/ May 2015</ref> It is important for the directory structure to match the examples below, since an extra directory will stop a mod from loading. For example, "\mods\''ModName''\''PAK file''" does not match the example below, and will not work.<br />
* Unpacked is simply all of the files and directories placed into a single directory within the "\mods" directory. These types of mods are often distributed in ZIP or RAR compressed files.<br />
*: <font face="Starbound">\mods\''ModName''\''assets, directories, and MODINFO file''</font><br />
* PAKed is a combination of both, with assets and directories stored in a single PAK file, and the PAK file and MODINFO file stored within a single directory located in the "\mods" directory.<br />
*: <font face="Starbound">\mods\''ModName''\''PAK file and MODINFO file''</font><br />
<br />
= How do I mod Starbound? =<br />
<br />
The moddable assets are located in the [[Modding:Asset_Tree|Asset Tree]], which is located in your Starbound directory under /Starbound/assets. There are several types of assets. Editing an existing asset will change the base behavior of the game. You can add new assets, although getting those assets into the game may be tricky depending on what you're trying to add. The official modding forums are the best source of up-to-date information on specifics.<br />
<br />
* [[Modding:JSON_Object_Types|JSON Objects]]: There are hundreds of [[Modding:JSON|JSON]] configuration files in various directories inside /assets/, with dozens of different extensions, like .config, .frames, .animation, .gun, etc. Any files with extensions that do not match the ones listed below are probably JSON config files.<br />
* [[Modding:Lua Language|Lua Scripting]]: Monsters, NPCs, and certain objects use Lua scripts to control their behavior. Lua scripting has a lot of potential, but currently suffers from severe scoping limitations. Lua files always end with the extension ".lua." The Lua API is documented in some Lua files in the 'Starbound/doc/lua' game's folder, and is also [[Modding:Lua API|explained here]] and although it may sometimes be a little outdated, should help.<br />
* Sound files: File extensions are either ".wav" or ".ogg"<br />
* Graphics: File extension is ".png" for graphics.<br />
<br />
= Yeah man, but how do I mod Starbound?! =<br />
The developers are very responsive to requests from the community and have already implemented some things by request since the beginning of beta. The best way for you to learn how to mod is go to the official forums, do a bunch of reading, look at some existing mods, and of course do extensive browsing of the asset files until you form some understanding of them.<br />
* For help getting started check out this step by step guide, [[Modding:Basics|Modding Basics]]. The official forums also have [http://community.playstarbound.com/forums/starbound-modding.111/?prefix_id=52 a "tutorial" tag that you can browse.] An unofficial [http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/ ebook which covers a lot is also available].<br />
<br />
* To unpack your assets, you can follow [http://community.playstarbound.com/threads/how-to-successfully-pack-and-unpack-pak-files.66649/ this guide].<br />
<br />
* Information on the [[Modding:Lua_API|Lua API]] is documented in .md files in the Starbound/doc/lua folder.<br />
<br />
* Create a _metadata file for your mod. There is some information in [http://community.playstarbound.com/index.php?threads/making-mod-installation-easier.52349/ this forum post.]<br />
<br />
* For adding to or overriding existing functionality, you will likely need to use the patching functionality to add a new recipe or starting item to the player.config file. See [http://community.playstarbound.com/threads/basic-patching-now-with-path-guide-v1-9.84496/ this thread] for more information.<br />
<br />
* If you have any problems, comb through the included assets. They are a rich source of examples you can follow. Before you try to make anything complex, you should start with copying something simple.<br />
<br />
* You can also download some sample mods (make sure they are up to date, as the mod specifications changed a few times in the beta) to learn from.<br />
<br />
<br />
=== Older, Outdated Info ===<br />
<br />
* The place we all started was [http://community.playstarbound.com/index.php?threads/basic-object-implementation-a-tutorial.21463/ Molly's first post about creating a simple item], although the specifics of this mod are now outdated.<br />
<br />
* There is also an outdated [http://steamcommunity.com/sharedfiles/filedetails/?id=201040798 tutorial] on Steam about basic modding, but which doesn't account for __merge functionality or .modinfo files.<br />
<br />
* Above-mentionned [http://community.playstarbound.com/index.php?threads/overriding-and-merging-config-files-in-mods.53775/ __merge functionality] and [http://community.playstarbound.com/index.php?threads/making-mod-installation-easier.52349/ .modinfo files] are now also outdated, and have been replaced by the patching system and the _metadata files. <br />
<br />
= Where is ''feature X''? =<br />
Now that the game is officially released, if there is a feature that is in your opinion missing from the game, you are free to submit mod requests at [http://community.playstarbound.com/forums/modding.111/ Offical Starbound Mod Forums]. Another area that allows modding requests is the subreddit [https://www.reddit.com/r/starboundmods/ /r/starboundmods].<br />
<br />
= Text Editing =<br />
<br />
=== What text editor should I use? ===<br />
This is a complex question, but the simple answer is, "Just about anything except Windows Notepad."<br />
<br />
We have a list of [[Modding:Text Editors|suggested text editors]] and a few tips for using them with JSON and Lua.<br />
<br />
= Graphics Editing =<br />
<br />
=== What image editor should I use? ===<br />
<br />
Please see this [[Modding:Image Editing|list of suggested image editors.]] There's a guide detailing the game's specific art styling [[Guide:Art|here]].<br />
<br />
= Troubleshooting =<br />
<br />
=== My game keeps crashing! ===<br />
<br />
You can start by checking the [[Modding:Starbound_Log_File|log file]]. You can find errors in there telling you which line in your code caused the crash. Loading the multiplayer server will give you a console, but restarting it frequently is tedious.<br />
<br />
An online [[Modding:JSON|JSON]] parser will help catch some common mistakes, such as missing commas and unmatched braces in your modified files. For more information about JSON, see the [[Modding:JSON|JSON]] page, or see the index of JSON configuration file types [[Modding:JSON Object Types|here]].<br />
<br />
=== Mac specific problem with .DS_Store files ===<br />
<!-- This seems to be seriously outdated -- Offended Koala was back in 2014. --><br />
Currently (beta v. Offended Koala) the Mac version will crash if the data directory ( ~/Library/Application\ Support/Steam/SteamApps/common/Starbound for Steam users) is opened with the Finder, because doing so creates invisible [http://en.wikipedia.org/wiki/.DS_Store .DS_Store] files, and these cause the Starbound client to crash on launch. <br />
<br />
Until the bug is fixed, Mac-based modders can remove the files from their Starbound directory using the terminal (the following command removes them from all Steam apps - this should be non-problematic, but if so append the Starbound directory name to the path): <br />
<br />
<pre>find ~/Library/Application\ Support/Steam/SteamApps/common -name .DS_Store -exec rm {} \;</pre><br />
<br />
=== How can I help the modding community? ===<br />
<br />
Check out [[Modding:Modding/DocumentationTODO]] to see a list of things that need to be done for modding documentation on this wiki.<br />
<br />
<br />
= Where can I get more information? =<br />
<br />
[http://community.playstarbound.com/forums/starbound-modding.111/ The official modding forums]<br />
<br />
[https://discordapp.com/invite/Starbound The official discord server] has a #modding channel<br />
<br />
There is also the IRC channel ##starbound-modding on the Freenode network, which can be accessed [http://webchat.freenode.net/?channels=%23%23starbound-modding&uio=d4 here]. Please note that this channel is dedicated to the ins and outs of modding, and is '''not''' the place to ask about a mod you downloaded! We don't kick or ban for minor netiquette breaches, but if the room is busy, be courteous and obey the rules or you may have a problem.<br />
<br />
If you use the IRC channel, follow these simple rules:<br />
* Use a pastebin like pastebin.com for anything over 2-3 lines.<br />
* Check the [http://starbounder.org/Modding:Starbound_Log_File log files] first. If there's an error you don't understand and want us to look at, post it on a pastebin for us to look at, along with any relevant code.<br />
* Do not spam the chat with excessive emotes or offtopic chat. Some offtopic is fine, but if people are talking about modding, try not to spam up the chat with fluff. You can go to #starbound or #starbound-overflow for that.<br />
* Constructive criticism is welcome, but be thoughtful and respectful of others.<br />
* Don't walk into chat and ask "hay guise how do i mod lol." We're all bootstrapping our own modding efforts by doing a lot of reading through the example code, reading others' mods, and experimentation.</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Lua/Starbound_Datatypes&diff=172663Modding:Lua/Starbound Datatypes2017-04-29T06:56:54Z<p>😺: Changed formatting to something more like the table pages, added a bunch of datatypes</p>
<hr />
<div>Starbound makes extensive use of Lua and JSON, and their data types. There are some types that could use some small amount of documentation, and that is the goal of this page.<br />
<br><br />
<br><br />
Note that a JSON array and a Lua array aren't the same. [http://community.playstarbound.com/threads/why-wont-this-work-please-help-me.132290/#post-3148429 This post and the following ones] give some beginner-level differentiation.<br />
<br><br />
<br><br />
<hr><br />
<div id="moddingcode"><br />
===<code>*Id</code>===<br />
These are <code>integers</code>, not to be confused with callable script objects.<br />
<br />
<hr><br />
<br />
===<code>RpcPromise</code>===<br />
Returned by functions requiring asynchronous data, such as world.sendEntityMessage(). It has four methods that can be called to determine its status: <br />
<br />
<li><code>RpcPromiseVariable:finished()</code> returns whether the promise has finished.</li><br />
<li><code>RpcPromiseVariable:success()</code> returns whether the promise has succeeded.</li><br />
<li><code>RpcPromiseVariable:result()</code> returns the return value(s) of the called function</li><br />
<li><code>RpcPromiseVariable:error()</code> returns the error string, if one occurs. (Need clarification on this one)</li><br />
<br />
<hr><br />
<br />
===<code>liquidLevel</code>===<br />
Surprisingly simple, just the liquid ID and its amount.<br />
*<code>int</code> liquidId<br />
*<code>int</code> amount<br />
<br />
<hr><br />
<br />
===<code>ItemDescriptor</code>=== <br />
JSON object which contains key-value pairs for name and amount, as well as additional parameters:<br />
*<code>string</code> name<br />
*<code>int</code> count<br />
*<code>JSON</code> parameters<br />
If count or parameters is omitted, it seems they'll be considered as 1 and {} respectively.<br />
<br />
<hr><br />
<br />
===<code>Map<EntityId, unsigned></code>===<br />
This bears some small note, to prevent potential confusion. It is a Lua table, not an explicit key-value pair.<br />
<br />
<hr><br />
<br />
===<code>ItemBag</code>===<br />
First noted usage by widget.itemGridItems(String widgetName). this entry needs filling.<br />
<br />
<hr><br />
<br />
===<code>Vec2F</code> and <code>Vec2I</code>===<br />
JSON object which contains <code>x</code> and <code>y</code>. "I" is for Integer, "F" is for "Float"<br />
<pre>[x = 0, y = 2]</pre><br />
<br />
<hr><br />
<br />
===<code>rectF</code> and <code>rectI</code>===<br />
Json array which contains 4 values being the 4 edges of a rectangle? Need confirmation. "I" is for Integer, "F" is for "Float"<br />
<pre>[-1, -1, 1, 1]</pre><br />
<br />
<hr><br />
<br />
===<code>polyF</code>===<br />
Json array which contains multiple sets of x;y coordinates, forming a polygon. <br />
<pre>[ [-0.75, -2.0], [-0.35, -2.5], [0.35, -2.5], [0.75, -2.0], [0.75, 0.65], [0.35, 1.22], [-0.35, 1.22], [-0.75, 0.65] ]</pre><br />
<br />
<hr><br />
<br />
===<code>harvestLevel</code>===<br />
Seems to be the poor man's boolean, where 0 = false and 1 = true?<br />
<br />
<hr><br />
<br />
===<code>teamType</code>===<br />
Case-insensitive <code>string</code> used to define things like who can damage who. Vanilla types:<br />
*<code>friendly</code>: (players, non-agressive NPCs, pets...)<br />
*<code>enemy</code>: (monsters, agressive NPCs...)<br />
*<code>passive</code>: (critters...)<br />
*<code>ghostly</code>: Cannot be hit, unaffected by terrain hazards<br />
*<code>assistant</code>: (Glitch mission's castle friendly NPC (castle archers, nuru...))<br />
*<code>Environment</code>: (volcanic trap...)<br />
*<code>indiscriminate</code>: able to hit anything regardless of their damageTeam (traps...)<br />
*<code>pvp</code>: pvp-enabled players<br />
<br />
<hr><br />
<br />
===<code>damageType</code> and <code>tileDamageType</code>===<br />
Case-insensitive <code>string</code>:<br />
*<code>blockish</code>: damages to blocks<br />
*<code>plantish</code>: damages to plants<br />
*<code>beamish</code>: Used by the pickslash weaponability<br />
*<code>explosive</code>: Used by the meteor explosions<br />
*<code>fire</code>: <br />
*<code>tilling</code>: <br />
*<code>damage</code>: <br />
*<code>knockback</code>: used by shields<br />
*<code>Environment</code>: <br />
*<code>IgnoresDef</code>: Ignores the target's protection stat.<br />
*<code>NoDamage</code>: <br />
<br />
<hr><br />
<br />
===<code>damageSourceKind</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly. Might be to define which sound to play? Vanilla ones:<br />
<pre>applystatus, axe, bite, broadsword, bugnet, dagger, default, electric, electricbroadsword, electricfist, electrichammer, electricplasma, falling, fire, firebroadsword, firehammer, fireplasma, fist, fiststrong, foldingchair, fryingpan, gnomebeam, hammer, hidden, ice, icehammer, iceplasma, nodamage, plasma, poison, poisondagger, poisonhammer, poisonlash, poisonplasma, sawblade, shield, shortsword, slash, spear, standardbullet</pre><br />
<br />
<hr><br />
<br />
===<code>damageRepeatGroup</code>===<br />
Seems to be an arbitrary <code>string</code>, unsure how it is used exactly.<br />
<pre>monsterfire, crystalbossbeam, shockhopper-flamethrower, npcTouchKnockback, largefloorspike, smallfloorspike, guardiandamagebuff</pre><br />
Weapons build their own with<br />
<pre>activeItem.ownerEntityId() .. config.getParameter("itemName") .. activeItem.hand() .. mode</pre><br />
Where "mode" is one of<br />
<pre>primary, alt, hold</pre><br />
<br />
<hr><br />
<br />
===<code>DamageTeam</code>===<br />
JSON object which contains:<br />
*<code>string</code> type<br />
*<code>int</code> team<br />
<br />
<code>type</code> = teamType above. <code>team</code> is used to differentiate multiple groups of the same type.<br />
<br />
<pre>{type = "enemy", team = 2}</pre><br />
<br />
<hr><br />
<br />
===<code>DamageSource</code>===<br />
JSON object which contains:<br />
*<code>List<PolyF></code> poly,<br />
*<code>int</code> damage,<br />
*<code>string</code> teamType,<br />
*<code>string</code> damageType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>int</code> damageRepeatTimeout,<br />
*<code>string</code> damageRepeatGroup<br />
<br />
<pre> {<br />
"poly" : [ [-0.75, 0.5], [0.0, 8.0], [0.75, 0.5] ],<br />
"damage" : 5,<br />
"teamType" : "friendly",<br />
"damageType" : "IgnoresDef",<br />
"damageSourceKind" : "axe",<br />
"damageRepeatTimeout" : 10,<br />
"damageRepeatGroup" : "largefloorspike"<br />
},</pre><br />
<br />
<hr><br />
<br />
===<code>damageRequest</code>===<br />
JSON object which contains at least:<br />
*<code>string</code> damageType,<br />
*<code>int</code> damage or damageDealt,<br />
*<code>entityId</code> sourceEntityId,<br />
And optionally(?)<br />
*<code>entityId</code> targetEntityId,<br />
*<code>Vec2F</code> position,<br />
*<code>int</code> healthLost,<br />
*<code>string</code> hitType,<br />
*<code>string</code> damageSourceKind,<br />
*<code>string</code> targetMaterialKind,<br />
*<code>bool</code> killed<br />
<br />
<pre>{ damageType = "IgnoresDef", damage = 1, sourceEntityId = activeItem.ownerEntityId() }</pre><br />
<pre>{healthLost: 1, damageSourceKind: , sourceEntityId: -65536, hitType: Hit, targetMaterialKind: organic, damageDealt: 1, position: {1: 847.35, 2: 903.7}, targetEntityId: -65536}</pre><br />
<br />
<hr><br />
<br />
===<code>damageNotification</code>===<br />
Probably be the same as damageRequest?<br />
<br />
<hr><br />
<br />
===<code>collisionKinds</code>===<br />
Collision Kind is a case-insensitive <code>string</code> used by the world table's collision check functions. A "CollisionSet" is an array of collisionKinds. For materials, they're defined in their .material file. For metamaterials, they're defined in the /assets/metamaterials.config file.<br />
*<code>Null</code>: For non-loaded areas and some specific metamaterials in vanilla <br />
*<code>None</code>: No collisions<br />
*<code>Block</code>: For block materials <br />
*<code>Platforms</code>: For platform materials <br />
*<code>Dynamic</code>: For eg. the light platforms in the Ancient areas, and doors(?) <br />
*<code>Slippery</code>: Vanilla uses it so that the Spike Sphere doesn't attach to materials <br />
<br />
<hr><br />
<br />
===<code>PhysicsForceRegion</code>===<br />
JSON object usually put in an array called <code>forceRegions</code>.<br />
Vanilla currently only uses it for the kluex boss and the guardianminions.<br />
<pre> {<br />
"right" : {<br />
"type" : "RadialForceRegion",<br />
"outerRadius" : 4,<br />
"innerRadius" : 0.5,<br />
"baseTargetRadialVelocity" : -5,<br />
"controlForce" : 100,<br />
"categoryWhitelist" : [ "guardianminion" ]<br />
}<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::Path</code>===<br />
A list of pathfind nodes<br />
<br />
<hr><br />
<br />
===<code>PlatformerAStar::PathFinder</code>===<br />
Lua UserData value which can be used for pathfinding over multiple frames. Has the following two methods:<br />
<br />
<li><code>explore([`int` nodeLimit])</code>: Explores the path up to the specified node count limit. Returns `true` if the pathfinding is complete and `false` if it is still incomplete. If nodeLimit is unspecified, this will search up to the configured maximum number of nodes, making it equivalent to world.platformerPathStart</li><br />
<br />
<li><code>result()</code></li>: Returns the completed path.<br />
<br />
<hr><br />
<br />
===<code>imageSet</code>===<br />
JSON object used to define an image<br />
<pre>{<br />
base = "image.png",<br />
hover = "image.png",<br />
pressed = "image.png",<br />
disabled = "image.png",<br />
}</pre><br />
<br />
<hr><br />
<br />
===<code>MovementParameters</code>===<br />
A vehicle or projectile's movement parameters, returned by <code>mcontroller.parameters()</code>. Not to be confused with <code>ActorMovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>ActorMovementParameters</code>===<br />
A monster, npc, player(...)'s base movement parameters, returned by <code>mcontroller.baseParameters()</code>. Not to be confused with <code>MovementParameters</code>.<br />
<br />
<hr><br />
<br />
===<code>directives</code>===<br />
a <code>string</code> defining [http://starbounder.org/Modding:Image_Processing_Directives Image Processing Directives].<br />
<br />
<hr><br />
<br />
</div><br />
{{Modding}}<br />
__NOTOC__</div>😺https://starbounder.org/mediawiki/index.php?title=Modding:Lua/Libraries&diff=172662Modding:Lua/Libraries2017-04-29T04:05:41Z<p>😺: Added the noinclude tag on the stub template for cleaner Modding:Lua page, added Storm_UI</p>
<hr />
<div>= Libraries =<br />
<noinclude>{{Stub|Can these pages actually be FILLED with content?}}</noinclude><br />
<br />
These are libraries cotnaining "utilitary" functions, for coding convenience.<br />
<br />
----<br />
<br />
<includeonly>{{Modding:Lua/Libraries/.Nav}}</includeonly><br />
[http://community.playstarbound.com/resources/library-tech-keybinds.3558/ Tech Keybinds] is ''an easy to use library that allows tech modders to bind input values to functions.''<br />
<br />
[https://github.com/StormyUK/Macrochip/tree/master/scripts/Storm_UI Storm_UI] is used by StormyUK for his [http://steamcommunity.com/sharedfiles/filedetails/?id=729444820 Macrochip] mod's UI.<br />
<noinclude>{{Modding}}</noinclude></div>😺