preloadObject: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]OFP[ _]Elite *(\|.*)?\]\]" to "{{GameCategory|ofpe|Scripting Commands}}")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| arma1 |Game name=
| arma1 |Game name=
Line 7: Line 6:


|gr1= Object Manipulation |GROUP1=
|gr1= Object Manipulation |GROUP1=
____________________________________________________________________________________________


| Preloads all textures, materials and proxies needed to render given object. Works with both class names and objects. Returns true once all data is loaded and ready.<br><br>
| Preloads all textures, materials and proxies needed to render given object. Works with both class names and objects. Returns true once all data is loaded and ready.<br><br>
{{Important | At least one object of the given classname has to be present in the current mission in order for alternative syntax version of the command to have any effect}}|DESCRIPTION=
{{Important | At least one object of the given classname has to be present in the current mission in order for alternative syntax version of the command to have any effect}}|DESCRIPTION=
____________________________________________________________________________________________


| distance '''preloadObject''' object |SYNTAX=
| distance '''preloadObject''' object |SYNTAX=
Line 27: Line 24:


| r2 = [[Boolean]] - [[true]] when preload is finished |RETURNVALUE2=
| r2 = [[Boolean]] - [[true]] when preload is finished |RETURNVALUE2=
____________________________________________________________________________________________
   
   
|x1= <code>[] [[spawn]]  
|x1= <code>[] [[spawn]]  
Line 39: Line 35:
[[hint]] "Preload finished";
[[hint]] "Preload finished";
};</code>|EXAMPLE2=
};</code>|EXAMPLE2=
____________________________________________________________________________________________


|  [[preloadCamera]], [[preloadSound]], [[preloadTitleObj]], [[preloadTitleRsc]]|SEEALSO=
|  [[preloadCamera]], [[preloadSound]], [[preloadTitleObj]], [[preloadTitleRsc]]|SEEALSO=

Revision as of 02:16, 17 January 2021

Hover & click on the images for description

Description

Description:
Preloads all textures, materials and proxies needed to render given object. Works with both class names and objects. Returns true once all data is loaded and ready.

At least one object of the given classname has to be present in the current mission in order for alternative syntax version of the command to have any effect
Groups:
Object Manipulation

Syntax

Syntax:
distance preloadObject object
Parameters:
distance: Number - distance at which preload the object
object: Object - existing object
Return Value:
Boolean - true when preload is finished

Alternative Syntax

Syntax:
distance preloadObject classname
Parameters:
distance: Number - distance at which preload the object
classname: String - classname of the object
Return Value:
Boolean - true when preload is finished

Examples

Example 1:
[] spawn { waitUntil {10 preloadObject "SoldierW"}; hint "Preload finished"; };
Example 2:
[] spawn { waitUntil {10 preloadObject leader player}; hint "Preload finished"; };

Additional Information

See also:
preloadCamerapreloadSoundpreloadTitleObjpreloadTitleRsc

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section