Difference between revisions of "ScriptCore3.menu2obj"

From Soldat Community Wiki
Jump to: navigation, search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
  '''function menu2obj(Style: Byte): Byte'''
 
  '''function menu2obj(Style: Byte): Byte'''
   Style: Position(Style/ID) of the weapon in the [[Weapons List]]
+
   Style: Position(Style) of the weapon in the [[Weapons List]]
   Result: Position(Style/ID) of the weapon in the [[TMapObject.Style]]
+
   Result: Position(Style) of the weapon in the [[TMapObject.Style]]
  
 
==Description==
 
==Description==
This converts a string into a number.
+
Translates the position of the weapon in the Weapon Menu ([[Weapons List]]) to the corresponding position of the Style property of a Map Object - lying weapon ([[TMapObject.Style]]).
 +
 
 +
==Examples==
 +
<source lang="pascal">
 +
begin
 +
    WriteLn('menu2obj: '+inttostr(menu2obj(1))); //5
 +
    WriteLn('menu2obj: '+inttostr(menu2obj(14))); //26
 +
end.
 +
</source>
  
  
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 17:55, 1 May 2018

function menu2obj(Style: Byte): Byte
 Style: Position(Style) of the weapon in the Weapons List
 Result: Position(Style) of the weapon in the TMapObject.Style

Description

Translates the position of the weapon in the Weapon Menu (Weapons List) to the corresponding position of the Style property of a Map Object - lying weapon (TMapObject.Style).

Examples

begin
    WriteLn('menu2obj: '+inttostr(menu2obj(1))); //5
    WriteLn('menu2obj: '+inttostr(menu2obj(14))); //26
end.