Jump to content

How to add object anim ?


Hani2001

Recommended Posts

Please help me how to add anim for objects

local function loadobj(resource)

	col178 = engineLoadCOL('Tube50mGlass1.col')
	txd178 = engineLoadTXD('MatTextures.txd')
	dff178 = engineLoadDFF('Tube50mGlass1.dff', 0)
	engineReplaceCOL(col178, 1833)
	engineImportTXD(txd178, 1833)
	engineReplaceModel(dff178, 1833)
  
  	col901 = engineLoadCOL('AnimTube.col')
	txd901 = engineLoadTXD('MatTextures.txd')
	dff901 = engineLoadDFF('AnimTube.dff', 0)
	engineReplaceCOL(col901, 1858)
	engineImportTXD(txd901, 1858)
	engineReplaceModel(dff901, 1858)
  
  	engineSetModelLODDistance(1833, 299)
  	engineSetModelLODDistance(1858, 299)
  
  	engineLoadIFP( "AnimTube.ifp", MatTextures )
 
end
addEventHandler('onClientResourceStart', getResourceRootElement(getThisResource()), loadobj)
  

How to add animation for MatTextures using engineReplaceAnimation ?

Edited by Hani2001
Link to comment

I think you can't. Like adding new objects it's impossible. For now.

Anyway people represent moving objects with onClientRender/setTimer + setElementPosition; Moving/changing object textures with onClientRender/setTimer + dxSetShaderValue.

Better then nothing i guess :o

Link to comment
  • Discord Moderators

I suppose this is a simple applied texture, so no need to set the value every time the texture updates because of the way it's done.

Simply set the texture(with dxSetShaderValue) once and It'll work just fine.

Added note on the wiki page too(DxSetShaderValue).

Edited by Pirulax
Just fixed a typo
  • Like 1
Link to comment
24 minutes ago, Pirulax said:

I suppose this is a simple applied texture, so no need to set the value every time the texture updates because of the way it's done.

Simply set the texture(with dxSetShaderValue) once and It'll work just fine.

Added note on the wiki page too(DxSetShaderValue).

Yeah, you right. I added render target as texture so it changes automatically

p.s. sorry for causing offtopic

Edited by JeViCo
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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