Faw[Ful] Posted February 18, 2011 Share Posted February 18, 2011 I want to animate my TXD (gta sa texture library) by using a timer and many TXD so there is a texture with the same name in each TXD. With a timer I want to load the TXD 1 for example and after the TXD 2 and after the TXD 3 so at the end I will create an animation. But This work : addEventHandler('onClientResourceStart', resourceRoot, function() txd_anim1 = engineLoadTXD('files/anim1.txd') engineImportTXD(txd_anim1, 2396) local col = engineLoadCOL('files/21.col') engineReplaceCOL(col, 2396) local dff = engineLoadDFF('files/21.dff', 0) engineReplaceModel(dff, 2396) engineSetModelLODDistance(2396, 500) end ) and this dont work : function animate() txd_anim1 = engineLoadTXD('files/anim1.txd') engineImportTXD(txd_anim1, 2396) local col = engineLoadCOL('files/21.col') engineReplaceCOL(col, 2396) local dff = engineLoadDFF('files/21.dff', 0) engineReplaceModel(dff, 2396) engineSetModelLODDistance(2396, 500) end setTimer ( animate, 1000, 0 ) But I cant add a timer in the first script , because my function need a name and if I add a name the script dont work. Link to comment
Faw[Ful] Posted February 18, 2011 Author Share Posted February 18, 2011 got the timer working but it look like MTA cant load a TXD on another TXD already loaded by MTA maybe there another way ? Link to comment
AGENT_STEELMEAT Posted February 18, 2011 Share Posted February 18, 2011 So, you want to load the .col and .dff, then play an animation? I'm having trouble understanding you. Link to comment
DiSaMe Posted February 18, 2011 Share Posted February 18, 2011 You're doing that in a wrong way. First, you load custom models and textures every second and don't unload them. Because of that, you may run out of RAM pretty fast. In your place, I would use a model ID for every animation frame. I would load the same DFF and COL on all of them and different TXDs on every model ID. Then I would create as many objects as there are frames, in the same position, and would show them one after another with setElementAlpha. I would also disable collisions for all but one model (but I would still replace COLs as they're used to detect whether the object is on the screen and should be rendered). Link to comment
Faw[Ful] Posted February 19, 2011 Author Share Posted February 19, 2011 got it working. thanks, but need to use different dff for each TXD. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now