preloadObject: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(note)
m (template:command argument fix)
Line 8: Line 8:


| 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=


|p1= distance: [[Number]] -  distance at which preload the object |= Parameter 1
|p1= distance: [[Number]] -  distance at which preload the object |PARAMETER1=
|p2 = object: [[Object]] - existing object
|p2 = object: [[Object]] - existing object


| [[Boolean]] - [[true]] when preload is finished |= Return value
| [[Boolean]] - [[true]] when preload is finished |RETURNVALUE=


|s2 = distance '''preloadObject''' classname |= Syntax
|s2 = distance '''preloadObject''' classname |SYNTAX=


|p21= distance: [[Number]]  -  distance at which preload the object |= Parameter 1
|p21= distance: [[Number]]  -  distance at which preload the object |PARAMETER1=
|p22 = classname: [[String]] - classname of the object
|p22 = classname: [[String]] - classname of the object


| r2 = [[Boolean]] - [[true]] when preload is finished|= Return value
| r2 = [[Boolean]] - [[true]] when preload is finished|RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
Line 30: Line 30:
[[waitUntil]] {10 [[preloadObject]] "SoldierW"};
[[waitUntil]] {10 [[preloadObject]] "SoldierW"};
[[hint]] "Preload finished";
[[hint]] "Preload finished";
};</code>|= Example 1
};</code>|EXAMPLE1=
|x2= <code>[] [[spawn]]  
|x2= <code>[] [[spawn]]  
{
{
[[waitUntil]] {10 [[preloadObject]] [[leader]] [[player]]};
[[waitUntil]] {10 [[preloadObject]] [[leader]] [[player]]};
[[hint]] "Preload finished";
[[hint]] "Preload finished";
};</code>|= Example 2
};</code>|EXAMPLE2=
____________________________________________________________________________________________
____________________________________________________________________________________________


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


}}
}}

Revision as of 14:44, 7 April 2019

-wrong parameter ("Arma") defined!-1.00
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:
Uncategorised

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