EngineLoadIFP: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
This function loads an animation library (IFP) file into GTA with a custom block name. All three IFP formats are supported ANPK, ANP2, and ANP3. Unfortunately, GTA 3 animations are not supported, however, you can load GTA:VC IFP files using this function. You don't have to replace any animation to play a custom one, to play a custom animation, load the IFP file using this function, then use [[SetPedAnimation|setPedAnimation]]. | This function loads an animation library (IFP) file into GTA with a custom block name. All three IFP formats are supported ANPK, ANP2, and ANP3. Unfortunately, GTA 3 animations are not supported, however, you can load GTA:VC IFP files using this function. You don't have to replace any animation to play a custom one, to play a custom animation, load the IFP file using this function, then use [[SetPedAnimation|setPedAnimation]]. | ||
To unload the IFP file, use [[DestroyElement|destroyElement]], restarting or stopping the resource can also unload the IFP file automatically. | If you wish to replace a GTA internal animation with a custom one, you can use [[EngineReplaceAnimation|engineReplaceAnimation]]. To unload the IFP file, use [[DestroyElement|destroyElement]], restarting or stopping the resource can also unload the IFP file automatically. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
IFP engineLoadIFP ( string IfpFilePath, string CustomBlockName ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 18:53, 18 June 2018
This function loads an animation library (IFP) file into GTA with a custom block name. All three IFP formats are supported ANPK, ANP2, and ANP3. Unfortunately, GTA 3 animations are not supported, however, you can load GTA:VC IFP files using this function. You don't have to replace any animation to play a custom one, to play a custom animation, load the IFP file using this function, then use setPedAnimation.
If you wish to replace a GTA internal animation with a custom one, you can use engineReplaceAnimation. To unload the IFP file, use destroyElement, restarting or stopping the resource can also unload the IFP file automatically.
Syntax
IFP engineLoadIFP ( string IfpFilePath, string CustomBlockName )
Required Arguments
- IfpFilePath: the file path to the IFP file you want to load.
- CustomBlockName: the new block name for the IFP file.
Returns
Returns an IFP element if the IFP file loaded, false otherwise.
Example
Click to collapse [-]
animation.luafunction setanimation() if engineLoadIFP("data/ani.ifp") then setPedAnimation(getLocalPlayer(), "ANIMATIONBLOCK", "animation1") end end addCommandHandler("animation", setanimation)
Click to collapse [-]
meta.xml<meta> <info author="lukry" version="1.0" type="script" /> <script src="animation.lua" type="client" /> <file src="data/ani.ifp" /> </meta>
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