preloadObject: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(format)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Preload all textures, materials and proxies needed to render given object. Object can be determined either by config class name ([[CfgVehicles]]), or by [[Object#Unit|Unit]].
| 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. |= Description
____________________________________________________________________________________________
 
| distance '''preloadObject''' object |= Syntax
 
|p1= distance: [[Number]] -  distance at which preload the object |= Parameter 1
|p2 = object: [[Object]] - existing object


Returns true once all data is loaded and ready. |= Description
| [[Boolean]] - [[true]] when preload is finished |= Return value
____________________________________________________________________________________________


|
|s2 = distance '''preloadObject''' classname |= Syntax
[[Boolean]] <nowiki>=</nowiki> distance '''preloadObject''' object |= Syntax


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


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


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


}}
}}

Revision as of 19:15, 9 July 2017

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