- Added calcDroidPower() scripting function to calculate power required to build a droid.

- Updated scripting manual.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2115 4a71c877-e1ca-e34f-864e-861f7616d084
master
Roman C 2007-07-15 15:53:41 +00:00
parent 451c5fdd8b
commit a161bf8d00
4 changed files with 134 additions and 89 deletions

View File

@ -153,13 +153,15 @@ div.Section1
<p class=MsoPlainText><b><span lang=EN-GB style='font-family:Arial'>Warzone2100.
Script language notes.</span></b></p>
<p class=MsoPlainText><b><span lang=EN-GB style='font-family:Arial'>Original Author: Pumpkin
Studios. 1999</span></b></p>
<p class=MsoPlainText><b><span lang=EN-GB style='font-family:Arial'>Last Author: $Author$</span></b></p>
<p class=MsoPlainText><b><span lang=EN-GB style='font-family:Arial'>Original
Author: Pumpkin Studios. 1999</span></b></p>
<p class=MsoPlainText><b><span lang=EN-GB style='font-family:Arial'>Last
update: $Date$, $Revision$, <a href="http://wz2100.net/">WRP</a></span></b></p>
Author: $Author$</span></b></p>
<p class=MsoPlainText><b><span lang=EN-GB style='font-family:Arial'>Last
update: $Date$, $Revision: 1392
$, <a href="http://wz2100.net/">WRP</a></span></b></p>
<p class=MsoPlainText><b><span lang=EN-GB style='font-family:Arial'>&nbsp;</span></b></p>
@ -182,8 +184,7 @@ responsibility for any damage resulting from modifcation of Warzone 2100.</span>
<p class=normal><span lang=EN-GB><a href="#Vlo_files_explained">Vlo files
explained</a></span></p>
<p class=normal><span lang=EN-GB><a href="#Slo_files_explained">Slo files
explained</a></span></p>
<p class=normal><span lang=EN-GB><a href="#Slo_files_explained">Slo files explained</a></span></p>
<p class=normal><span lang=EN-GB><a href="#Event_trigger_concept_explained">Event/trigger
concept explained</a></span></p>
@ -306,8 +307,7 @@ In the first line a .slo file is attached to this particular .vlo file. </span><
class=a><span lang=EN-GB>variable_definitions </span></span><span lang=EN-GB>that
resides inside the curly braces is the heart of every .vlo file, it contains
definitions of the data that will be used in the main script part - the .slo
file. Each variable definition starts on a new line and is structured as
follows:</span></p>
file. Each variable definition starts on a new line and is structured as follows:</span></p>
<p class=MsoNormal><span lang=EN-GB>&nbsp;</span></p>
@ -332,16 +332,15 @@ Since it is a string it must be put inside quotation marks. All components, be
it some research, structure, droid template or a weapon is refered by its
internal name in the game and are defined in the appropriate txt data files.</span></p>
<p><span lang=EN-GB>Each variable definition in a .vlo file starts on the new
line and ends at the end of the line.</span></p>
<p><span lang=EN-GB>Each variable definition in a .vlo file starts on the new line
and ends at the end of the line.</span></p>
<p><span lang=EN-GB>It is also possible to define arrays of some data type. For
example if you want to use the following 3 research topics in your script you
might want to define them like this:</span></p>
<p class=code><span lang=EN-GB>myResearch[0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RESEARCHSTAT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;R-Vehicle-Body11&quot;</span></p>
RESEARCHSTAT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;R-Vehicle-Body11&quot;</span></p>
<p class=code><span lang=EN-GB>myResearch[1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RESEARCHSTAT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -375,7 +374,7 @@ lang=EN-GB>Variable declarations</span></p>
<p class=code style='margin-left:36.0pt;text-indent:-18.0pt'><a
name="Variable_declaration"></a><a name="Event_and_function_declaration"></a><span
lang=EN-GB>2.</span><span lang=EN-GB style='font-size:7.0pt;font-family:"Times New Roman"'>&nbsp;
</span><span lang=EN-GB>Event and function </span><span lang=EN-GB>declaration</span></p>
</span><span lang=EN-GB>Event and function declaration</span></p>
<p class=code style='margin-left:36.0pt;text-indent:-18.0pt'><span lang=EN-GB>3.</span><span
lang=EN-GB style='font-size:7.0pt;font-family:"Times New Roman"'>&nbsp; </span><span
@ -414,8 +413,7 @@ RESEARCHSTAT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myResearch[3];</span></p>
lang=EN-GB>public</span></span><span lang=EN-GB> signals that the variable is
defined in the corresponding .vlo files. Note that unlike in .vlo files
variable declarations in .slo files end with a semicolon and unlike in .vlo
files it is possible to declare more than one variable of the same type at
once.</span></p>
files it is possible to declare more than one variable of the same type at once.</span></p>
<p class=MsoNormal><span lang=EN-GB>&nbsp;</span></p>
@ -440,9 +438,9 @@ the .slo file.</span></p>
<p class=MsoPlainText><span lang=EN-GB style='font-family:Arial'>&nbsp;</span></p>
<p class=note0><em><span lang=EN-GB style='font-family:Arial'>NOTE: All
variables are initialized to their default values when created. STRUCTURE/DROID/FEATURE
variables are initialized to NULLOBJECT, STRINGs to &quot;&quot;, FLOATs to
0.0, INTs to 0, BOOLs to FALSE etc. </span></em></p>
variables are initialized to their default values when created.
STRUCTURE/DROID/FEATURE variables are initialized to NULLOBJECT, STRINGs to
&quot;&quot;, FLOATs to 0.0, INTs to 0, BOOLs to FALSE etc. </span></em></p>
<p class=code><em><span lang=EN-GB style='font-family:"Courier New";font-style:
normal'>&nbsp;</span></em></p>
@ -492,10 +490,10 @@ console(&quot;Hello world!&quot;);</span></p>
<p class=code><span lang=EN-GB>&nbsp;</span></p>
<p class=normal><span lang=EN-GB>This piece of code will output &quot;Hello
world!&quot; to the game console every 5 seconds. Note that triggers are put
inside the round braces after the event name while code that is to be executed
resides inside the curly braces. The syntax of the executable code is very
close to the C/C++ syntax.</span></p>
world!&quot; to the game console every 5 seconds. Note that triggers are put inside
the round braces after the event name while code that is to be executed resides
inside the curly braces. The syntax of the executable code is very close to the
C/C++ syntax.</span></p>
<p class=normal><span lang=EN-GB>&nbsp;</span></p>
@ -575,7 +573,8 @@ event name.</span></p>
<p class=normal><span lang=EN-GB>&nbsp;</span></p>
<p class=code><span lang=EN-GB>event myEvent;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p class=code><span lang=EN-GB>event
myEvent;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//declaration of the event</span></p>
<p class=code><span lang=EN-GB>&nbsp;</span></p>
@ -753,8 +752,8 @@ lang=EN-GB>.</span></p>
<p class=note0><span lang=EN-GB>NOTE: </span><span class=a><span lang=EN-GB
style='font-size:12.0pt'>ref</span></span><span lang=EN-GB> keyword means that
a pointer to the provided variable is passed to the interpreter, so that a
callback can modify value of the variable.</span></p>
a pointer to the provided variable is passed to the interpreter, so that a callback
can modify value of the variable.</span></p>
<p class=MsoPlainText><span lang=EN-GB>&nbsp;</span></p>
@ -763,8 +762,7 @@ callback can modify value of the variable.</span></p>
<p class=normal><span lang=EN-GB>It is possible to reuse a trigger for more
than one event if a trigger is declared in the <span class=a><span
style='font-family:Arial'><a href="#Event_and_function_declaration">Event and
function declaration</a></span>. </span>Trigger declaration has following
syntax:</span></p>
function declaration</a></span>. </span>Trigger declaration has following syntax:</span></p>
<p class=normal><span class=a><span lang=EN-GB>&nbsp;</span></span></p>
@ -1595,8 +1593,8 @@ have an indeterminate effect.</span></p>
24/09/98&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Old 176,
143, 95&nbsp;&nbsp; B08F5F)</span></p>
<p class=normal><span lang=EN-GB>Urban:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 201,
146, 15 C9920F</span></p>
<p class=normal><span lang=EN-GB>Urban:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
201, 146, 15 C9920F</span></p>
<p class=normal><span lang=EN-GB>Rockies:&nbsp;&nbsp;&nbsp;&nbsp; 182, 225,
236&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; B6E1EC</span></p>
@ -1653,8 +1651,8 @@ research</span></p>
<p class=code><span lang=EN-GB>completeResearch(RESEARCHSTAT, PLAYER)</span></p>
<p class=normal><span lang=EN-GB>This function acts as if the research was
performed by the player giving them the results</span></p>
<p class=normal><span lang=EN-GB>This function acts as if the research was performed
by the player giving them the results</span></p>
<p class=normal><span lang=EN-GB>RESEARCHSTAT is defined by the name from
Access</span></p>
@ -1672,8 +1670,8 @@ research</span></p>
<p class=code><span lang=EN-GB>&nbsp;</span></p>
<p class=normal><span lang=EN-GB>These functions check for when an object/droid/structure
belonging to a player is within range of a position</span></p>
<p class=normal><span lang=EN-GB>These functions check for when an
object/droid/structure belonging to a player is within range of a position</span></p>
<p class=normal><span lang=EN-GB>PLAYER is the id of the player whose unit is
checked for in range</span></p>
@ -1771,8 +1769,8 @@ checked for the building</span></p>
<p class=code><span lang=EN-GB>bool structureIdle(STRUCTURE)</span></p>
<p class=normal><span lang=EN-GB>This function checks whether the structure is
doing anything. Returns TRUE if idle</span></p>
<p class=normal><span lang=EN-GB>This function checks whether the structure is doing
anything. Returns TRUE if idle</span></p>
<p class=normal><span lang=EN-GB>STRUCTURE is a valid structure defined by ID</span></p>
@ -1919,8 +1917,8 @@ at (X, Y).</span></p>
<p class=normal><span lang=EN-GB>The structure must be previously enabled via
enableStructure().</span></p>
<p class=normal><span lang=EN-GB>The structure identifier is returned - this can
be used in e.g. destroyStructure.</span></p>
<p class=normal><span lang=EN-GB>The structure identifier is returned - this
can be used in e.g. destroyStructure.</span></p>
<p class=code><span lang=EN-GB>&nbsp;</span></p>
@ -2202,7 +2200,8 @@ to</span></p>
<p class=normal><span lang=EN-GB>adds the POWER amount to the PLAYER's current
level</span></p>
<p class=normal><span lang=EN-GB>POWER is the value to add to the player's power</span></p>
<p class=normal><span lang=EN-GB>POWER is the value to add to the player's
power</span></p>
<p class=normal><span lang=EN-GB>PLAYER is the id of the player </span></p>
@ -2380,8 +2379,8 @@ for 'player' in multiplayer games.</span></p>
<p class=normal><span lang=EN-GB>&nbsp;</span></p>
<p class=functioncode0><span lang=EN-GB>STRUCTURE structureBuiltInRange(STRUCTURESTAT,
X, Y, RANGE, PLAYER)</span></p>
<p class=functioncode0><span lang=EN-GB>STRUCTURE
structureBuiltInRange(STRUCTURESTAT, X, Y, RANGE, PLAYER)</span></p>
<p class=normal><span lang=EN-GB>Checks to see if a Structure has been built
within a specified range of x, y. The first structure</span></p>
@ -2558,8 +2557,8 @@ an object</span></p>
<p class=functioncode0><span lang=EN-GB>STRUCTURE objToStructure(BASEOBJ)</span></p>
<p class=normal><span lang=EN-GB>Convert a BASEOBJ to STRUCTURE when
BASEOBJ.type == OBJ_STRUCTURE. Returns NULLOBJECT otherwise</span></p>
<p class=normal><span lang=EN-GB>Convert a BASEOBJ to STRUCTURE when BASEOBJ.type
== OBJ_STRUCTURE. Returns NULLOBJECT otherwise</span></p>
<p class=functioncode0><span lang=EN-GB>&nbsp;</span></p>
@ -3119,8 +3118,8 @@ function****</span></p>
<p class=functioncode0><span lang=EN-GB>&nbsp;</span></p>
<p class=functioncode0><span lang=EN-GB>int takeOverStructsInArea(int fromPlayer,
int toPlayer, int x1, int y1,</span></p>
<p class=functioncode0><span lang=EN-GB>int takeOverStructsInArea(int
fromPlayer, int toPlayer, int x1, int y1,</span></p>
<p class=functioncode0><span lang=EN-GB>int x2, int y2)</span></p>
@ -3376,9 +3375,8 @@ int x , ref int y , STRUCTURESTAT defenceStat,</span></p>
<p class=functioncode0><span lang=EN-GB>STRUCTURESTAT wallstat, DROID unit, int
player)</span></p>
<p class=normal><span lang=EN-GB>Given a starting x and y, make unit unit
belonging to player build either a defenceStat or a row of wallStats.
returns </span></p>
<p class=normal><span lang=EN-GB>Given a starting x and y, make unit unit belonging
to player build either a defenceStat or a row of wallStats. returns </span></p>
<p class=normal><span lang=EN-GB>Modified x and ys.</span></p>
@ -3405,8 +3403,8 @@ forPlayer, int, fromPlayer,</span></p>
<p class=functioncode0><span lang=EN-GB>int x, int y, int z)</span></p>
<p class=normal><span lang=EN-GB>Put a flashing beacon on the map for player
forPlayer on position x/y. Unless removed manually the beacon is removed
automatically from the map after a timeout.</span></p>
forPlayer on position x/y. Unless removed manually the beacon is removed automatically
from the map after a timeout.</span></p>
<p class=MsoPlainText><span lang=EN-GB>&nbsp;</span></p>
@ -3444,8 +3442,8 @@ searchRange, int player, int threatRange)</span></p>
unrevealed location in range with starting location x/y, range searchRange
and closest to location x/y. If searchRange is -1, then entire map is being
searched. Player is the player who is looking for an unrevealed map location.
If threatRange != -1 then also checks for enemy presence. Locations with enemy
presence are ignored then.</span></p>
If threatRange != -1 then also checks for enemy presence. Locations with
enemy presence are ignored then.</span></p>
<p class=normal><span lang=EN-GB>Returns TRUE if any locations satisfying the
search conditions were found, returns FALSE otherwise.</span></p>
@ -3519,8 +3517,8 @@ range, bool includeVTOLs)</span></p>
numEnemyWeapStructsInRange(int lookingPlayer, int x, int y, int
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; range)</span></p>
<p class=functioncode0><span lang=EN-GB>int&nbsp;&nbsp; numEnemyWeapObjInRange(int
lookingPlayer, int x, int y,</span></p>
<p class=functioncode0><span lang=EN-GB>int&nbsp;&nbsp;
numEnemyWeapObjInRange(int lookingPlayer, int x, int y,</span></p>
<p class=functioncode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int
range, bool includeVTOLs)</span></p>
@ -3576,9 +3574,9 @@ targetPlayer, int lookingPlayer,</span></p>
<p class=functioncode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int x,
int y, int range, bool includeVTOLs)</span></p>
<p class=normal><span lang=EN-GB>Returns total number of targetPlayers
military objects (either structures, droids or both) at location x/y and within
range that are visible visible by lookingPlayer.</span></p>
<p class=normal><span lang=EN-GB>Returns total number of targetPlayers military
objects (either structures, droids or both) at location x/y and within range
that are visible visible by lookingPlayer.</span></p>
<p class=normal><span lang=EN-GB>If includeVTOLs is set to FALSE, then VTOLs
are ignored.</span></p>
@ -3695,6 +3693,13 @@ identical. Comparison is case-sensitive.</span></p>
<p class=normal><span lang=EN-GB>&nbsp;</span></p>
<p class=normal><span lang=EN-GB style='font-family:"Courier New"'>int
calcDroidPower(DROID droid)</span></p>
<p class=normal><span lang=EN-GB>Returns cost of the droid.</span></p>
<p class=normal><span lang=EN-GB>&nbsp;</span></p>
<p class=header><a name="Debugging_Script_Functions"><span lang=EN-GB>Debugging
Script Functions</span></a></p>
@ -3847,8 +3852,8 @@ IDDES_TEMPLSTART&nbsp;&nbsp; </span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IDDES_SYSTEMBUTTON </span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IDDES_BODYBUTTON </span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IDDES_BODYBUTTON
</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IDDES_PROPBUTTON</span></p>
@ -3921,8 +3926,8 @@ to load up an off world map, but having no access to home base</span></p>
<p class=normal><span lang=EN-GB>&nbsp;</span></p>
<p class=normal><span class=constantscode><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
LZ_COMPROMISED_TIME</span></span><span lang=EN-GB> - value to set the
reinforcement time with to display '--:--'</span></p>
LZ_COMPROMISED_TIME</span></span><span lang=EN-GB> - value to set the reinforcement
time with to display '--:--'</span></p>
<p class=normal style='margin-left:106.2pt;text-indent:35.4pt'><span
lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -4140,45 +4145,53 @@ lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=constantscode><span lang=EN-GB>DROID_WEAPON</span></span><span
lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- Weapon unit</span></p>
        - Weapon unit</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=constantscode><span lang=EN-GB>DROID_SENSOR</span></span><span
lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- Sensor unit</span></p>
        - Sensor unit</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=constantscode><span lang=EN-GB>DROID_ECM</span></span><span
lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- ECM unit</span></p>
        - ECM unit</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=constantscode><span lang=EN-GB>DROID_CONSTRUCT&nbsp;&nbsp;&nbsp;
</span></span><span lang=EN-GB>- Constructor unit</span></p>
</span></span><span lang=EN-GB>        - Constructor unit</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=constantscode><span lang=EN-GB>DROID_PERSON</span></span><span
lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- person</span></p>
        - person</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=constantscode><span lang=EN-GB>DROID_CYBORG</span></span><span
lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- cyborg/super cyborg</span></p>
        - cyborg/super cyborg</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=constantscode><span lang=EN-GB>DROID_TRANSPORTER</span></span><span
lang=EN-GB>&nbsp;&nbsp;&nbsp; - guess what this is!</span></p>
lang=EN-GB>&nbsp;&nbsp;&nbsp;         - guess what this is!</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=constantscode><span lang=EN-GB>DROID_COMMAND</span></span><span
lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -
lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;         -
Command unit</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=constantscode><span lang=EN-GB>DROID_REPAIR</span></span><span
lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- Repair Unit</span></p>
        - Repair Unit</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span lang=EN-GB style='font-family:"Courier New"'>DROID_CYBORG_CONSTRUCT</span><span
lang=EN-GB>  - Cyborg engineer</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span lang=EN-GB style='font-family:"Courier New"'>DROID_CYBORG_REPAIR</span><span
lang=EN-GB>        - Cyborg mechanic</span></p>
<p class=normal><span lang=EN-GB>&nbsp;</span></p>
@ -4267,7 +4280,8 @@ IMAGE_CURSOR_SELECT</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IMAGE_CURSOR_ATTACK</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IMAGE_CURSOR_MOVE</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IMAGE_CURSOR_MOVE</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IMAGE_CURSOR_JAM</span></p>
@ -4296,7 +4310,8 @@ IMAGE_CURSOR_ATTACH</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IMAGE_CURSOR_LOCKON</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IMAGE_CURSOR_FIX</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IMAGE_CURSOR_FIX</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IMAGE_CURSOR_EMBARK</span></p>
@ -4394,8 +4409,8 @@ true if we are in battlemap mode</span></p>
<p class=normal><span lang=EN-GB>Possible values for targetedObjectType:</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MT_TERRAIN
</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MT_TERRAIN </span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MT_RESOURCE</span></p>
@ -4427,8 +4442,7 @@ MT_REPAIRDAM</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MT_ENEMYSTR</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MT_TRANDROID</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MT_TRANDROID</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MT_OWNDROID</span></p>
@ -4436,7 +4450,8 @@ MT_OWNDROID</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MT_OWNDROIDDAM</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MT_ENEMYDROID</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MT_ENEMYDROID</span></p>
<p class=constantscode0><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MT_COMMAND</span></p>
@ -4674,9 +4689,9 @@ Function Callbacks</span></a></p>
<p class=MsoPlainText><span lang=EN-GB>&nbsp;</span></p>
<p class=normal><span lang=EN-GB>These are used in the place of a trigger and
are for events that are to be called at specific times in the game. They will
cause the event they are associated with to be called every time unless the
trigger for the event is set to inactive.</span></p>
are for events that are to be called at specific times in the game. They will cause
the event they are associated with to be called every time unless the trigger
for the event is set to inactive.</span></p>
<p class=normal><span lang=EN-GB>&nbsp;</span></p>
@ -4714,8 +4729,8 @@ lang=EN-GB> - this is triggered when CTRL + 'B' is pressed so that the script
can end a mission</span></p>
<p class=normal><span class=callbackcode><span lang=EN-GB>CALL_VIDEO_QUIT</span></span><span
lang=EN-GB> - this is triggered when the CURRENT video sequence is over -
either end of anim or when 'ESC' has been pressed</span></p>
lang=EN-GB> - this is triggered when the CURRENT video sequence is over - either
end of anim or when 'ESC' has been pressed</span></p>
<p class=normal><span class=callbackcode><span lang=EN-GB>CALL_LAUNCH_TRANSPORTER</span></span><span
lang=EN-GB> - this is triggered when the 'Launch' button is pressed on the
@ -4790,8 +4805,8 @@ NULLOBJECT)</span></p>
<p class=callbackcode0><span lang=EN-GB>CALL_TRANSPORTER_OFFMAP, player</span></p>
<p class=normal><span lang=EN-GB>triggered when a transporter for player exits
the map.</span></p>
<p class=normal><span lang=EN-GB>triggered when a transporter for player exits the
map.</span></p>
<p class=callbackcode0><span lang=EN-GB>&nbsp;</span></p>
@ -4845,8 +4860,8 @@ buttonID is pressed</span></p>
<p class=callbackcode0><span lang=EN-GB>&nbsp;</span></p>
<p class=callbackcode0><span lang=EN-GB>CALL_OBJ_DESTROYED, int player, ref
BASEOBJ object</span></p>
<p class=callbackcode0><span lang=EN-GB>CALL_OBJ_DESTROYED, int player, ref BASEOBJ
object</span></p>
<p class=normal><span lang=EN-GB>triggered when either a unit or a structure
for player is destroyed</span></p>
@ -4961,8 +4976,8 @@ has left the multiplayer game.</span></p>
<p class=callbackcode0><span lang=EN-GB>CALL_ALLIANCEOFFER, ref int one, ref
int two</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; One offers
two an alliance.</span></p>
<p class=normal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; One
offers two an alliance.</span></p>
</div>

View File

@ -11164,3 +11164,28 @@ BOOL scrDebugModeEnabled(void)
return TRUE;
}
/*
* Returns the cost of a droid
*/
BOOL scrCalcDroidPower(void)
{
DROID *psDroid;
if (!stackPopParams(1, ST_DROID, &psDroid))
{
return FALSE;
}
ASSERT(psDroid != NULL,
"scrDebugModeEnabled: can't calculate cost of a null-droid");
scrFunctionResult.v.ival = (SDWORD)calcDroidPower(psDroid);
if (!stackPushResult(VAL_BOOL, &scrFunctionResult))
{
debug(LOG_ERROR, "scrDebugModeEnabled(): failed to push result");
return FALSE;
}
return TRUE;
}

View File

@ -635,6 +635,7 @@ extern BOOL scrSetTileHeight(void);
extern BOOL scrGetTileStructure(void);
extern BOOL scrPrintCallStack(void);
extern BOOL scrDebugModeEnabled(void);
extern BOOL scrCalcDroidPower(void);
extern BOOL beingResearchedByAlly(SDWORD resIndex, SDWORD player);

View File

@ -1375,10 +1375,14 @@ FUNC_SYMBOL asFuncTable[] =
0, { VAL_VOID },
0, 0, NULL, 0, 0, NULL, NULL },
{ "debugModeEnabled", scrDebugModeEnabled, VAL_BOOL,
{ "debugModeEnabled", scrDebugModeEnabled, VAL_BOOL,
0, { VAL_VOID },
0, 0, NULL, 0, 0, NULL, NULL },
{ "calcDroidPower", scrCalcDroidPower, VAL_INT,
1, { (INTERP_TYPE)ST_DROID },
0, 0, NULL, 0, 0, NULL, NULL },
/* END new functions */
/* This final entry marks the end of the function list */