Difference between revisions of "ScriptCore3.weap2obj"
(→Description) |
|||
Line 6: | Line 6: | ||
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 ([[TWeapon.WType]]). | 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 ([[TWeapon.WType]]). | ||
+ | ==Examples== | ||
+ | <source lang="pascal"> | ||
+ | begin | ||
+ | WriteLn('weap2obj: '+inttostr(weap2obj(1))); //5 | ||
+ | WriteLn('weap2obj: '+inttostr(weap2obj(13))); //26 | ||
+ | WriteLn('weap2obj: '+inttostr(weap2obj(15))); //Exception: Invalid weapon style (Archery is bowing. Sorry, this just doesn't work) | ||
+ | archery is a joke | ||
+ | end. | ||
+ | </source> | ||
[[Category:Functions]] | [[Category:Functions]] |
Revision as of 17:46, 1 May 2018
function weap2obj(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 (TWeapon.WType).
Examples
begin
WriteLn('weap2obj: '+inttostr(weap2obj(1))); //5
WriteLn('weap2obj: '+inttostr(weap2obj(13))); //26
WriteLn('weap2obj: '+inttostr(weap2obj(15))); //Exception: Invalid weapon style (Archery is bowing. Sorry, this just doesn't work)
archery is a joke
end.