SetRandomGeometries Property

Usage:
   ObjectTemplate.SetRandomGeometries number

Argument values:

argument 1:    3

Description: This property sets the number of objects to choose from when the object is spawned. It modifies the name used in an AddTemplate property definition. Typically it is used for choosing a different head for a soldier from a few different ones.

For example, for the British soldier definition in objects/Soldiers/BritishSoldier/Objects.con there are the lines:

 ObjectTemplate.addTemplate BritSoldierComplexHead
 ObjectTemplate.setRandomGeometries 3

Later in the file are the lines:

 ObjectTemplate.create AnimatedBundle BritSoldierComplexHead1
 ObjectTemplate.createSkeleton animations/UsFace.ske
 ObjectTemplate.geometry Soldier/BritComplexHead1
 ObjectTemplate.hasDynamicShadow 1

 ObjectTemplate.create AnimatedBundle BritSoldierComplexHead2
 ObjectTemplate.createSkeleton animations/UsFace.ske
 ObjectTemplate.geometry Soldier/BritComplexHead2
 ObjectTemplate.hasDynamicShadow 1

 ObjectTemplate.create AnimatedBundle BritSoldierComplexHead3
 ObjectTemplate.createSkeleton animations/UsFace.ske
 ObjectTemplate.geometry Soldier/BritComplexHead3
 ObjectTemplate.hasDynamicShadow 1

The added template name, BritSoldierComplexHead, will then have the number 1, 2, or 3 appended to it at random when the object appears, which will choose which head name to use.

Used in a total of 12 .con files: Objects.con

Parent directory of these .con files: objects/Soldiers

Example: (from objects/Soldiers/USMarineSoldier/Objects.con)
   include ../Common/CommonSoldierData.inc
   rem Sound.addRunTimeDirectory Language USEnglish
   Game.AddLanguageRunTimeDirectory USEnglish
   include ../Common/Sounds/SoldierSound.inc
   ObjectTemplate.SetSoldierStandingIcon "Soldier/Icon_us_marine_standing.tga"
   ObjectTemplate.SetSoldierCrouchIcon "Soldier/Icon_us_marine_crouching.tga"
   ObjectTemplate.SetSoldierProneIcon "Soldier/Icon_us_marine_lying.tga"
   ObjectTemplate.SetMinimapIcon "flag_us.tga"
   ObjectTemplate.SetControlPointIcon "conp_us.tga"
   ObjectTemplate.SetTicketIcon "flag_ticket_us.tga"
   ObjectTemplate.SetTeamFlagIcon "Icon_flag_us.tga"
   ObjectTemplate.SetRadioLanguage "UsEnglish"
   ObjectTemplate.AddTemplate USSoldierComplexHead
   ObjectTemplate.SetRandomGeometries 3
   ObjectTemplate.SetIsFirstPersonPart 0
   ObjectTemplate.SetLodValue 0.01
   ObjectTemplate.BindToSkeletonPart Bip01_Spine3 3
   ObjectTemplate.AddTemplate USSoldierHead
   ObjectTemplate.SetIsFirstPersonPart 0
   ObjectTemplate.SetLodValue -0.01
   ObjectTemplate.AddTemplate USMarine3PBody
   ObjectTemplate.SetIsFirstPersonPart 0
   ObjectTemplate.AddTemplate USMarine1PBody
   ObjectTemplate.SetIsFirstPersonPart 1
   ObjectTemplate.AddTemplate USSoldierRightHand
   ObjectTemplate.SetIsFirstPersonPart 0
   ObjectTemplate.SetLodValue 0.03
   ObjectTemplate.AddTemplate USSoldierLeftHand
   ObjectTemplate.SetIsFirstPersonPart 0
   ObjectTemplate.SetLodValue 0.03
   ObjectTemplate.AddTemplate 1pUSSoldierRightHand
   ObjectTemplate.SetIsFirstPersonPart 1
   ObjectTemplate.SetLodValue 0.03
   ObjectTemplate.AddTemplate 1pUSSoldierLeftHand
   ObjectTemplate.SetIsFirstPersonPart 1
   ObjectTemplate.SetLodValue 0.03


Go to the ObjectTemplate properties list page, ObjectTemplate page, All Properties list, or Main scripting page.