https://wiki.wesnoth.org/index.php?title=LuaAPI/types/side&feed=atom&action=historyLuaAPI/types/side - Revision history2024-03-29T01:57:50ZRevision history for this page on the wikiMediaWiki 1.31.16https://wiki.wesnoth.org/index.php?title=LuaAPI/types/side&diff=70283&oldid=prevCeltic Minstrel: /* Misc side settings */ Add shroud_data2022-12-24T06:03:21Z<p><span dir="auto"><span class="autocomment">Misc side settings: </span> Add shroud_data</span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 06:03, 24 December 2022</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l78" >Line 78:</td>
<td colspan="2" class="diff-lineno">Line 78:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Whether the side uses fog and shroud.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Whether the side uses fog and shroud.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">* ''side''.'''shroud_data''' &harr; ''shroud data string''</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">The current shroud for the side, as a shroud data string (see [[SideWML]]).</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* ''side''.'''share_vision''' &harr; ''vision type''</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* ''side''.'''share_vision''' &harr; ''vision type''</div></td></tr>
</table>Celtic Minstrelhttps://wiki.wesnoth.org/index.php?title=LuaAPI/types/side&diff=68360&oldid=prevCeltic Minstrel: /* Misc side settings */ Fix formatting2021-07-23T04:56:41Z<p><span dir="auto"><span class="autocomment">Misc side settings: </span> Fix formatting</span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 04:56, 23 July 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l79" >Line 79:</td>
<td colspan="2" class="diff-lineno">Line 79:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Whether the side uses fog and shroud.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Whether the side uses fog and shroud.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* ''side''.''share_vision'' &harr; ''vision type''</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* ''side''.<ins class="diffchange diffchange-inline">'</ins>''share_vision<ins class="diffchange diffchange-inline">'</ins>'' &harr; ''vision type''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The side's policy for sharing vision with allies. This is a string which can be set to one of '''all''' (meaning both fog and shroud are shared), '''shroud''' (meaning shroud is shared but fog is not), or '''none''' (meaning no vision is shared).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The side's policy for sharing vision with allies. This is a string which can be set to one of '''all''' (meaning both fog and shroud are shared), '''shroud''' (meaning shroud is shared but fog is not), or '''none''' (meaning no vision is shared).</div></td></tr>
</table>Celtic Minstrelhttps://wiki.wesnoth.org/index.php?title=LuaAPI/types/side&diff=68198&oldid=prevCeltic Minstrel: Categorize2021-06-30T02:34:36Z<p>Categorize</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 02:34, 30 June 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l138" >Line 138:</td>
<td colspan="2" class="diff-lineno">Line 138:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>All the side's data as raw WML. This can be used to access values that aren't directly supported.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>All the side's data as raw WML. This can be used to access values that aren't directly supported.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Lua Reference]]</ins></div></td></tr>
</table>Celtic Minstrelhttps://wiki.wesnoth.org/index.php?title=LuaAPI/types/side&diff=66120&oldid=prevCeltic Minstrel: Document the side userdata2020-10-17T02:03:59Z<p>Document the side userdata</p>
<p><b>New page</b></p><div><br />
__TOC__<br />
<br />
This represents a side in the current scenario. Its metatable is the [[LuaAPI/wesnoth/sides|wesnoth.sides]] module, meaning functions of that module can be called on it using colon syntax.<br />
<br />
==== Side identity ====<br />
<br />
* ''side''.'''side''' &rarr; ''number''<br />
<br />
The index of the side. This is the same value used to look up the side in '''wesnoth.sides'''.<br />
<br />
* ''side''.'''side_name''' &harr; ''translatable string''<br />
<br />
The display name for the side, to be shown in the UI.<br />
<br />
* ''side''.'''save_id''' &rarr; ''string''<br />
<br />
The ID used to track this side's recall list.<br />
<br />
* ''side''.'''flag''' &harr; ''image string''<br />
* ''side''.'''flag_icon''' &harr; ''image string''<br />
<br />
The images used for the side's flag. Note that if the side doesn't explicitly set a flag, this will return the default flag.<br />
<br />
* ''side''.'''color''' &harr; ''string''<br />
<br />
The side's team color.<br />
<br />
* ''side''.'''user_team_name''' &harr; ''translatable string''<br />
* ''side''.'''team_name''' &harr; ''string''<br />
<br />
The side's team settings.<br />
<br />
==== Side controller ====<br />
<br />
* ''side''.'''controller''' &harr; ''controller type''<br />
<br />
How the side is controlled. This does not distinguish between local and remote sides, so it is safe to read or write this in multiplayer games.<br />
<br />
* ''side''.'''is_local''' &rarr; ''boolean''<br />
<br />
Whether the side is a local side. Careless use will result in out-of-sync errors.<br />
<br />
The normal use for it is if you need to show a dialog on the screen that should only pop up for the local player, or that should have a different appearance or behaviour for a non-local player.<br />
<br />
==== Side resources ====<br />
<br />
* ''side''.'''gold''' &harr; ''number''<br />
<br />
The side's current gold amount.<br />
<br />
* ''side''.'''village_gold''' &harr; ''number''<br />
* ''side''.'''village_support''' &harr; ''number''<br />
* ''side''.'''recall_cost''' &harr; ''number''<br />
* ''side''.'''base_income''' &harr; ''number''<br />
<br />
Various settings that influence the side's income.<br />
<br />
* ''side''.'''num_villages''' &rarr; ''number''<br />
* ''side''.'''num_units''' &rarr; ''number''<br />
* ''side''.'''total_upkeep''' &rarr; ''number''<br />
* ''side''.'''expenses''' &rarr; ''number''<br />
* ''side''.'''net_income''' &rarr; ''number''<br />
* ''side''.'''total_income''' &rarr; ''number''<br />
<br />
Various derived values that influence the side's income.<br />
<br />
* ''side''.'''carryover_bonus''' &harr; ''number''<br />
* ''side''.'''carryover_percentage''' &harr; ''number''<br />
* ''side''.'''carryover_add''' &harr; ''boolean''<br />
<br />
The side's gold carryover settings.<br />
<br />
==== Misc side settings ====<br />
<br />
* ''side''.'''fog''' &harr; ''boolean''<br />
* ''side''.'''shroud''' &harr; ''boolean''<br />
<br />
Whether the side uses fog and shroud.<br />
<br />
* ''side''.''share_vision'' &harr; ''vision type''<br />
<br />
The side's policy for sharing vision with allies. This is a string which can be set to one of '''all''' (meaning both fog and shroud are shared), '''shroud''' (meaning shroud is shared but fog is not), or '''none''' (meaning no vision is shared).<br />
<br />
* ''side''.'''hidden''' &harr; ''boolean''<br />
<br />
Whether the side should be hidden UIs that list sides.<br />
<br />
* ''side''.'''scroll_to_leader''' &harr; ''boolean''<br />
<br />
Whether the game should scroll to this side's leader when their turn begins.<br />
<br />
* ''side''.'''suppress_end_turn_confirmation''' &harr; ''boolean''<br />
<br />
Whether the game should confirm that the user really meant to end their turn if no units have moved.<br />
<br />
* ''side''.'''persistent''' &harr; ''boolean''<br />
<br />
Whether the side's recall list should be serialized to the saved game so that it can reappear in a later scenario.<br />
<br />
* ''side''.'''defeat_condition''' &harr; ''string''<br />
<br />
The side's condition for defeat. For possible values, see the description at [[SideWML]]. More information is available [[ScenarioWML#Scenario_End_Conditions|here]].<br />
<br />
* ''side''.'''starting_location''' &rarr; ''location''<br />
<br />
The side's starting location. This is an array table with the x and y coordinates.<br />
<br />
* ''side''.'''recruit''' &harr; ''list of unit type IDs''<br />
<br />
The side's recruit list.<br />
<br />
==== Multiplayer settings ====<br />
<br />
* ''side''.'''faction''' &rarr; ''string''<br />
* ''side''.'''faction_name''' &rarr; ''translatable string''<br />
<br />
The name and ID of the side's chosen faction.<br />
<br />
* ''side''.'''chose_random''' &rarr; ''boolean''<br />
<br />
Indicates whether the player explicitly chose their faction or if it was chosen for them at random by the engine.<br />
<br />
* ''side''.'''lost''' &harr; ''boolean''<br />
<br />
If true, this side will be removed from the persistent list at the end of the scenario. This key can also be used to stop the engine from removing a side, by setting it to false. Writing this key only works in a victory/defeat event.<br />
<br />
==== Other side attributes ====<br />
<br />
* ''side''.'''variables'''[''path''] &harr; ''variable value''<br />
* ''side''.'''variables'''.''__cfg'' &rarr; ''all side variables''<br />
<br />
This is a variables table with the same semantics as [[LuaAPI/wml#wml.variables|wml.variables]]. If arrays are needed, it (or the side it belongs to) can be passed as the second parameter to<br />
[[LuaAPI/wml#wml.array_access.get|wml.array_access.get]] or<br />
[[LuaAPI/wml#wml.array_access.set|wml.array_access.set]].<br />
<br />
* ''side''.'''__cfg''' &rarr; ''config''<br />
<br />
All the side's data as raw WML. This can be used to access values that aren't directly supported.</div>Celtic Minstrel