Jump to content

Custom plane isnt loading


Guest Smacenis

Recommended Posts

Hello, this is my custom AT400 script. I start it in console, go into game, spawn AT400, but its the old one AT400. Restarting mod doesn't help.

This is my meta.xml

<meta> 
<info author="whocares" description="at400mod" version="1" type="script" /> 
<script src="at400.lua" type="client" /> 
<file src="data/at400.dff" /> 
<file src="data/at400.txd" /> 
</meta> 
  

This is my at400.lua

outputChatBox ( "At400 replaced" ) 
function replaceModel() 
  txd = engineLoadTXD ( "at400.txd" ) 
  engineImportTXD ( txd, 577 ) 
  dff = engineLoadDFF ( "at400.dff", 577 ) 
  engineReplaceModel ( dff, 577 ) 
  setTimer (replaceModel, 1000, 1) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 

Whats wrong?

Link to comment

Your engineLoadTXD() and engineLoadDFF() calls should have the full path names (as specified in your meta.xml)

Also, replaceModel() is going to be called every second, forever, given the way you're using the timer. I'd suggest (untested):

  
outputChatBox ( "At400 replaced" ) 
function replaceModel() 
  txd = engineLoadTXD ( "at400.txd" ) 
  engineImportTXD ( txd, 577 ) 
  dff = engineLoadDFF ( "at400.dff", 577 ) 
  engineReplaceModel ( dff, 577 ) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()),  
    function() 
        replaceModel() 
        setTimer (replaceModel, 1000, 1) 
    end 
) 
  

Link to comment
Your engineLoadTXD() and engineLoadDFF() calls should have the full path names (as specified in your meta.xml)

Also, replaceModel() is going to be called every second, forever, given the way you're using the timer. I'd suggest (untested):

  
outputChatBox ( "At400 replaced" ) 
function replaceModel() 
  txd = engineLoadTXD ( "at400.txd" ) 
  engineImportTXD ( txd, 577 ) 
  dff = engineLoadDFF ( "at400.dff", 577 ) 
  engineReplaceModel ( dff, 577 ) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()),  
    function() 
        replaceModel() 
        setTimer (replaceModel, 1000, 1) 
    end 
) 
  

Full paths would mean:

  
outputChatBox ( "At400 replaced" ) 
function replaceModel() 
  txd = engineLoadTXD ( "data/at400.txd" ) 
  engineImportTXD ( txd, 577 ) 
  dff = engineLoadDFF ( "data/at400.dff", 577 ) 
  engineReplaceModel ( dff, 577 ) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()),  
    function() 
        replaceModel() 
        setTimer (replaceModel, 1000, 1) 
    end 
) 
  

Right? :P

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...