EngineReplaceModel notes: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Replacing models in the original GTA map= Replacing models in the original GTA map may not work correctly. There are two work arounds: ==Work around 1:== Move camera away du...") |
Fernando187 (talk | contribs) (replace info with template ObjectLODInfo) |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
=Replacing models in the original GTA map= | =Replacing models in the original GTA map= | ||
There are two ways to replace models in the original GTA map: | |||
== | ==Method 1: Move camera away during replace process== | ||
Move camera away during replace process | <section name="Client" class="client" show="true"> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local modelId = 12853 | local modelId = 12853 | ||
Line 18: | Line 18: | ||
setTimer( function() | setTimer( function() | ||
setCameraTarget( localPlayer ) -- Move camera back after a delay | |||
end, 50, 1 ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
== | {{ObjectLODInfo}} | ||
Create custom object and hide original | |||
==Method 2: Create custom object and hide original== | |||
<section name="Client" class="client" show="true"> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local modelId = 12853 | local modelId = 12853 | ||
Line 41: | Line 42: | ||
engineReplaceModel( dff, modelId ) | engineReplaceModel( dff, modelId ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
=Additonal Note= | |||
'''Sometimes you need to replace the model far away from where the model/texture change is being made''' | |||
so if you are in the game and you are trying to replace a model then get away from the model till it is gone from your draw distance for making sure that this problem won't happen |
Latest revision as of 12:40, 4 November 2024
Replacing models in the original GTA map
There are two ways to replace models in the original GTA map:
Method 1: Move camera away during replace process
Click to collapse [-]
Clientlocal modelId = 12853 setCameraMatrix( 10000, 0, 0 ) -- Move camera far away col = engineLoadCOL( "garage.col" ) txd = engineLoadTXD( "garage.txd" ) dff = engineLoadDFF( "garage.dff", 0 ) engineReplaceCOL( col, modelId ) engineImportTXD( txd, modelId ) engineReplaceModel( dff, modelId ) setTimer( function() setCameraTarget( localPlayer ) -- Move camera back after a delay end, 50, 1 )
This page is marked for deletion. | |
Reason: Template not needed Actions: Delete (Administrators) - Discuss - What links here - Category
|
Method 2: Create custom object and hide original
Click to collapse [-]
Clientlocal modelId = 12853 local x,y,z = 661, -561, 17 obj = createObject( modelId, x,y,z ) removeWorldModel( modelId, 100, x,y,z ) -- Hide original col = engineLoadCOL( "garage.col" ) txd = engineLoadTXD( "garage.txd" ) dff = engineLoadDFF( "garage.dff", 0 ) engineReplaceCOL( col, modelId ) engineImportTXD( txd, modelId ) engineReplaceModel( dff, modelId )
Additonal Note
Sometimes you need to replace the model far away from where the model/texture change is being made so if you are in the game and you are trying to replace a model then get away from the model till it is gone from your draw distance for making sure that this problem won't happen