Added documentation for SetPlayerData and GetPlayerData.
Updated documentation helper scripts to use the new filenames.
This commit is contained in:
parent
d6c5fad448
commit
dda6da86d1
4 changed files with 149 additions and 5 deletions
|
@ -57,13 +57,13 @@
|
|||
<a href="#DefineBurningBuilding">DefineBurningBuilding</a>
|
||||
<a href="#DefineCampaign">DefineCampaign</a>
|
||||
<a href="#DefineConstruction">DefineConstruction</a>
|
||||
<a href="pud.html#DefineConstructionWcNames">DefineConstructionWcNames</a>
|
||||
<a href="#DefineEditorUnitTypes">DefineEditorUnitTypes</a>
|
||||
<a href="#DefineRaceNames">DefineRaceNames</a>
|
||||
<a href="#DefineRanks">DefineRanks</a>
|
||||
<a href="#Diplomacy">Diplomacy</a>
|
||||
<a href="#StratagusMap">StratagusMap</a>
|
||||
<a href="#GameCycle">GameCycle</a>
|
||||
<a href="#GetPlayerData">GetPlayerData</a>
|
||||
<a href="#GetThisPlayer">GetThisPlayer</a>
|
||||
<a href="#GetUnitMana">GetUnitMana</a>
|
||||
<a href="#GetUnitUnholyArmor">GetUnitUnholyArmor</a>
|
||||
|
@ -90,6 +90,7 @@
|
|||
<a href="#SetGroupId">SetGroupId</a>
|
||||
<a href="#SetLocalPlayerName">SetLocalPlayerName</a>
|
||||
<a href="#SetObjectives">SetObjectives</a>
|
||||
<a href="#SetPlayerData">SetPlayerData</a>
|
||||
<a href="#SetSharedVision">SetSharedVision</a>
|
||||
<a href="#SetThisPlayer">SetThisPlayer</a>
|
||||
<a href="#SetUnitMana">SetUnitMana</a>
|
||||
|
@ -598,6 +599,80 @@ Returns the current game cycle.
|
|||
cycle = GameCycle()
|
||||
</pre>
|
||||
|
||||
|
||||
<a name="GetPlayerData"></a>
|
||||
<h3>GetPlayerData(player, property)</h3>
|
||||
|
||||
Returns the requested player property.
|
||||
|
||||
The <i>player</i> argument is the number of the player.
|
||||
<p>
|
||||
|
||||
Possible values for <i>property</i>:
|
||||
<dl>
|
||||
<dt>Name</dt>
|
||||
<dd>Name of the player. This name may be exposed in multiplayer games.
|
||||
</dd>
|
||||
<dt>RaceName</dt>
|
||||
<dd>Name of race.
|
||||
</dd>
|
||||
<dt>Ressources</dt>
|
||||
<dd>The amount of ressources available for the ressource whose name is given as third argument.
|
||||
</dd>
|
||||
<dt>UnitTypesCount</dt>
|
||||
<dd>The amount of units whose type is given as third argument.
|
||||
</dd>
|
||||
<dt>AiEnabled</dt>
|
||||
<dd>True if the player is controled by the computer.
|
||||
</dd>
|
||||
<dt>TotalNumUnits</dt>
|
||||
<dd>total # units for units' list.
|
||||
</dd>
|
||||
<dt>NumBuildings</dt>
|
||||
<dd>number of buildings owned by the player.
|
||||
</dd>
|
||||
<dt>Supply</dt>
|
||||
<dd>supply available/produced.
|
||||
</dd>
|
||||
<dt>Demand</dt>
|
||||
<dd>demand of player.
|
||||
</dd>
|
||||
<dt>UnitLimit</dt>
|
||||
<dd>maximum number of non-building units allowed.
|
||||
</dd>
|
||||
<dt>BuildingLimit</dt>
|
||||
<dd>maximum number of buildings allowed.
|
||||
</dd>
|
||||
<dt>TotalUnitLimit</dt>
|
||||
<dd>maximum number of units of any kind allowed.
|
||||
</dd>
|
||||
<dt>Score</dt>
|
||||
<dd>Points for killing ...
|
||||
</dd>
|
||||
<dt>TotalUnits</dt>
|
||||
<dd>Total number of units.
|
||||
</dd>
|
||||
<dt>TotalBuildings</dt>
|
||||
<dd>Total number of buildings.
|
||||
</dd>
|
||||
<dt>TotalResources</dt>
|
||||
<dd>Total ressources of the <i>resource</i> type collected by the player.
|
||||
</dd>
|
||||
<dt>TotalRazings</dt>
|
||||
<dd>Total buildings destroyed.
|
||||
</dd>
|
||||
<dt>TotalKills</dt>
|
||||
<dd>How many units killed.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h4>Example</h4>
|
||||
|
||||
<pre>
|
||||
playername = GetPlayerData(player, "Name")
|
||||
</pre>
|
||||
|
||||
|
||||
<a name="GetThisPlayer"></a>
|
||||
<h3>GetThisPlayer()</h3>
|
||||
|
||||
|
@ -1184,6 +1259,61 @@ Sets shared vision.
|
|||
SetSharedVision(0, true, 2)
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="SetPlayerData"></a>
|
||||
<h3>SetPlayerData(player, property, [resource], value)</h3>
|
||||
|
||||
Set the requested player property to a given <i>value</i>.
|
||||
|
||||
The <i>player</i> argument is the number of the player.
|
||||
<p>
|
||||
|
||||
Possible values for <i>property</i>:
|
||||
<dl>
|
||||
<dt>Name</dt>
|
||||
<dd>Name of the player. This name may be exposed in multiplayer games.
|
||||
</dd>
|
||||
<dt>Ressources</dt>
|
||||
<dd>The amount of resources available of the <i>resource</i> kind.
|
||||
</dd>
|
||||
<dt>UnitLimit</dt>
|
||||
<dd>maximum number of non-building units allowed.
|
||||
</dd>
|
||||
<dt>BuildingLimit</dt>
|
||||
<dd>maximum number of buildings allowed.
|
||||
</dd>
|
||||
<dt>TotalUnitLimit</dt>
|
||||
<dd>maximum number of units of any kind allowed.
|
||||
</dd>
|
||||
<dt>Score</dt>
|
||||
<dd>Points for killing ...
|
||||
</dd>
|
||||
<dt>TotalUnits</dt>
|
||||
<dd>Total number of units.
|
||||
</dd>
|
||||
<dt>TotalBuildings</dt>
|
||||
<dd>Total number of buildings.
|
||||
</dd>
|
||||
<dt>TotalResources</dt>
|
||||
<dd>Total ressources of the <i>resource</i> type collected by the player.
|
||||
</dd>
|
||||
<dt>TotalRazings</dt>
|
||||
<dd>Total buildings destroyed.
|
||||
</dd>
|
||||
<dt>TotalKills</dt>
|
||||
<dd>How many units killed.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h4>Example</h4>
|
||||
|
||||
<pre>
|
||||
SetPlayerData(player, "Name", "playername")
|
||||
</pre>
|
||||
|
||||
|
||||
<a name="SetThisPlayer"></a>
|
||||
<h3>SetThisPlayer(playernum)</h3>
|
||||
|
||||
|
|
|
@ -157,6 +157,8 @@
|
|||
<dd></dd>
|
||||
<dt><a href="ui.html#DefineButton">DefineButton</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="ui.html#DefineButtonStyle">DefineButtonStyle</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="game.html#DefineCampaign">DefineCampaign</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="game.html#DefineConstruction">DefineConstruction</a></dt>
|
||||
|
@ -165,6 +167,8 @@
|
|||
<dd></dd>
|
||||
<dt><a href="ui.html#DefineCursor">DefineCursor</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="config.html#DefineDecorations">DefineDecorations</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="config.html#DefineDefaultActions">DefineDefaultActions</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="config.html#DefineDefaultIncomes">DefineDefaultIncomes</a></dt>
|
||||
|
@ -215,6 +219,8 @@
|
|||
<dd></dd>
|
||||
<dt><a href="magic.html#DefineSpell">DefineSpell</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="config.html#DefineSprites">DefineSprites</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="tileset.html#DefineTileset">DefineTileset</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="pud.html#DefineTilesetWcNames">DefineTilesetWcNames</a></dt>
|
||||
|
@ -233,6 +239,8 @@
|
|||
<dd></dd>
|
||||
<dt><a href="pud.html#DefineUpgradeWcNames">DefineUpgradeWcNames</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="unittype.html#DefineVariables">DefineVariables</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="ui.html#DefineViewports">DefineViewports</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="game.html#Diplomacy">Diplomacy</a></dt>
|
||||
|
@ -245,6 +253,8 @@
|
|||
<dd></dd>
|
||||
<dt><a href="research.html#GetDependency">GetDependency</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="game.html#GetPlayerData">GetPlayerData</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="game.html#GetThisPlayer">GetThisPlayer</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="game.html#GetUnitMana">GetUnitMana</a></dt>
|
||||
|
@ -429,6 +439,8 @@
|
|||
<dd></dd>
|
||||
<dt><a href="game.html#SetObjectives">SetObjectives</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="game.html#SetPlayerData">SetPlayerData</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="config.html#SetRevealAttacker">SetRevealAttacker</a></dt>
|
||||
<dd></dd>
|
||||
<dt><a href="config.html#SetSelectionStyle">SetSelectionStyle</a></dt>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
"Update the command index in ccl-index.html."
|
||||
"Update the command index in index.html."
|
||||
|
||||
import os
|
||||
|
||||
|
@ -15,9 +15,9 @@ for infile in os.listdir('.'):
|
|||
|
||||
commands.sort()
|
||||
|
||||
head, trash, tail = open('ccl-index.html').read().split('SCRIPT')
|
||||
head, trash, tail = open('index.html').read().split('SCRIPT')
|
||||
|
||||
f = open('ccl-index.html', 'w')
|
||||
f = open('index.html', 'w')
|
||||
f.write(head + 'SCRIPT -->\n')
|
||||
for command in commands:
|
||||
f.write('<dt><a href="' + reffiles[command] + '#' + command + '">' + command + '</a></dt>\n')
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
"Update the command index in ccl-index.html."
|
||||
""" Print a line for each function in index.html.
|
||||
Usefull to check if all functions are documented.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
|
|
Loading…
Reference in a new issue