EngineStreamingSetMemorySize: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Change build number to the correct value) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{New feature/item|3.0160|1.6.0| | {{New feature/item|3.0160|1.6.0|21874|Sets the maximum amount of RAM [in bytes] that can be used for streaming}} | ||
{{Tip|To restore to default value use [[engineStreamingRestoreMemorySize]]}} | {{Tip|To restore to default value use [[engineStreamingRestoreMemorySize]]}} | ||
{{Important Note|'''This function is meant for advanced users only, as it can lead to stability issues'''. Using a very high value might result in more crashes, while using a value too low might lead to frequent pop-in [and due to the way MTA works micro-stutter as well]}} | {{Important Note|'''This function is meant for advanced users only, as it can lead to stability issues'''. Using a very high value might result in more crashes, while using a value too low might lead to frequent pop-in [and due to the way MTA works micro-stutter as well]}} | ||
Line 27: | Line 27: | ||
==Requirements== | ==Requirements== | ||
{{Requirements|n/a|1.6.0-9. | {{Requirements|n/a|1.6.0-9.21874|}} | ||
==See Also== | ==See Also== | ||
{{Engine functions}} | {{Engine functions}} |
Revision as of 23:21, 25 August 2023
Sets the maximum amount of RAM [in bytes] that can be used for streaming
Tip: To restore to default value use engineStreamingRestoreMemorySize |
Important Note: This function is meant for advanced users only, as it can lead to stability issues. Using a very high value might result in more crashes, while using a value too low might lead to frequent pop-in [and due to the way MTA works micro-stutter as well] |
Syntax
nil engineStreamingSetMemorySize( number sizeBytes )
OOP Syntax Help! I don't understand this!
- Method: EngineStreaming:setMemorySize(...)
- Variable: .memorySize
- Counterpart: engineStreamingGetMemorySize
Required Arguments
- sizeBytes : The maximum amount of RAM [in bytes] that can be used for streaming. Must be a positive non-zero number.
Example
This example adds a command that can be used to change the streaming memory size, and display the previous value.
addCommandHandler("ssms", function(_, sizeMB) if tonumber(sizeMB) then outputChatbox("The maximum streaming memory available has been changed from " .. math.floor(engineGetStreamingMemorySize() / 1024 / 1024) .. " MB to " .. sizeMB .. " MB") engineStreamingSetMemorySize(tonumber(sizeMB) * 1024 * 1024) -- Convert MB to Bytes else outputChatbox("Please enter a numeric value!") end end, false, false)
Requirements
This template will be deleted.
See Also
- engineAddImage
- engineApplyShaderToWorldTexture
- engineFreeModel
- engineGetModelFlags
- engineGetModelIDFromName
- engineGetModelLODDistance
- engineGetModelNameFromID
- engineGetModelPhysicalPropertiesGroup
- engineGetModelTextureNames
- engineGetModelTextures
- engineGetModelTXDID
- engineGetModelVisibleTime
- engineGetObjectGroupPhysicalProperty
- engineGetSurfaceProperties
- engineGetVisibleTextureNames
- engineImageGetFilesCount
- engineImageGetFiles
- engineImageGetFile
- engineImageLinkDFF
- engineImageLinkTXD
- engineImportTXD
- engineLoadCOL
- engineLoadDFF
- engineLoadIMG
- engineLoadIFP
- engineLoadTXD
- engineRemoveImage
- engineRemoveShaderFromWorldTexture
- engineReplaceAnimation
- engineReplaceCOL
- engineReplaceModel
- engineRequestModel
- engineResetModelFlags
- engineResetModelLODDistance
- engineResetSurfaceProperties
- engineRestoreAnimation
- engineRestoreCOL
- engineRestoreDFFImage
- engineRestoreModel
- engineRestoreModelPhysicalPropertiesGroup
- engineRestoreObjectGroupPhysicalProperties
- engineRestoreTXDImage
- engineRestreamWorld
- engineSetAsynchronousLoading
- engineSetModelFlag
- engineSetModelFlags
- engineSetModelLODDistance
- engineSetModelPhysicalPropertiesGroup
- engineSetModelVisibleTime
- engineSetObjectGroupPhysicalProperty
- engineSetSurfaceProperties
- engineStreamingFreeUpMemory
- engineStreamingGetUsedMemory