DannyRose Posted July 15, 2011 Share Posted July 15, 2011 Good evening I searche for some new objects for my server and I found a "Hollywood-Sign", which replaces the Vinewood-Sign. BUT: I dont know, why it doesnt work!? Nothing I try works. Please have a look at it and help me function hollywoodsign() txd = engineLoadTXD ( "newModels/sign.txd" ) engineImportTXD ( txd, 13831) dff = engineLoadDFF ( "newModels/sign1.dff", 0) engineReplaceModel ( dff, 13831) dff2 = engineLoadDFF ( "newModels/sign2.dff", 0 ) engineReplaceModel ( dff2, 13722) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), hollywoodsign) Link to comment
JR10 Posted July 15, 2011 Share Posted July 15, 2011 Did u add the txd's and dff's to the meta like this: meta.xml: <file src="newModels/sign.txd" /> <file src="newModels/sign1.dff" /> <file src="newModels/sign2.dff" /> Link to comment
DiSaMe Posted July 16, 2011 Share Posted July 16, 2011 Custom DFFs only affect objects created by MTA. They don't affect GTA native objects unless there's MTA object with the same model ID streamed in. Link to comment
Oz. Posted July 16, 2011 Share Posted July 16, 2011 Worked for my models, replacing the native GTA objects...? It's certainly possible to do what he's suggesting, as per the screenshot above. Although Kayl might've used a fancy method in his script to allow the Vinewood sign to be replaced with my models, I don't know. The native object's IDs were used though, the same ones as DannyRose has identified. Unless there's a typo in the script, not referencing the files in the meta as JR10 suggested or stuffed up model files seems to be the most likely problem(s). Have you gotten any errors in debugscript 3? Or does the resource simply fail to load at all? Link to comment
DannyRose Posted July 16, 2011 Author Share Posted July 16, 2011 Hey^^ Of course I put the files in the meta.xml No [DKR]Oz. The debugscript dont show any errors. In the function I added outputChatBox("hollywood"), that I can see if the function started and when I login the outputChatBox works. That means, that the function started, but there is still the vinewood-sign. In the same script I wrote a "car-replace-function" and this works I dont know what is wrong, because wiki tells me, that you must do it like my function Link to comment
DiSaMe Posted July 16, 2011 Share Posted July 16, 2011 To test if the model was replaced correctly, create an object with that ID. If it has the custom model, it's replaced correctly. Model slot has custom DFF only if there's MTA object somewhere around. I tested this. When MTA object is streamed in, GTA native object has a custom model too, otherwise only MTA object has it. Link to comment
DannyRose Posted July 16, 2011 Author Share Posted July 16, 2011 Thank you CrystalMV IT WORKS :D Link to comment
Kayl Posted July 16, 2011 Share Posted July 16, 2011 That's indeed the technique used for this DKR sign. A ghost (alpha = 0) MTA object is created at the same location as the GTA object to guarantee the streaming in of the MTA object will force the GTA object to be "updated" accordingly. I wish this was not necessary. Link to comment
ecoxp Posted July 16, 2011 Share Posted July 16, 2011 That's indeed the technique used for this DKR sign.A ghost (alpha = 0) MTA object is created at the same location as the GTA object to guarantee the streaming in of the MTA object will force the GTA object to be "updated" accordingly. I wish this was not necessary. I think it's pretty well coded, as it would let you have both a modded object and don't mess the GTA world with the same object ID Link to comment
Kayl Posted July 17, 2011 Share Posted July 17, 2011 That's indeed the technique used for this DKR sign.A ghost (alpha = 0) MTA object is created at the same location as the GTA object to guarantee the streaming in of the MTA object will force the GTA object to be "updated" accordingly. I wish this was not necessary. I think it's pretty well coded, as it would let you have both a modded object and don't mess the GTA world with the same object ID You can't really say that you are left with the freedom to have both a modded object and an untouched GTA world object because the moment your MTA object is streamed in, the GTA world object changes as well. When you replace an "ID", you expect all instances to be replaced. If it was that well coded, it would either replace also GTA world objects without the need for a hack, or provide us with an option to say if we want only MTA objects affected. Right now we have absolutely no control over when the GTA object is replaced (since it depends on the MTA objects as we discussed). To have a real freedom to leave GTA objects untouched, it all goes down to the problem of having only access to "replacement" functions. If we could create new IDs and load new models without having to replace GTA ones, that would also be great. There are lots of improvements to be done on those engine functions (no control over the real replacement of GTA objects, no way to create new models, collision model failing on streamin > need scripting hack to maintain the col in a working state, random texture fail). I wouldn't really say it's "well coded". It's a preview of what we could expect but it's left in a weird state. Link to comment
DiSaMe Posted July 17, 2011 Share Posted July 17, 2011 True, custom models system is a bit unstable. Also, even if engine functions affected native objects too, engineReplaceModel/engineRestoreModel could be called when the object is streamed in/out, so the current custom model behavior could still be scripted. Adding models on empty IDs would definitely be cool. I don't really know how DFF stuff works inside the game, but I will try to suggest a way which in my opinion would need the least job: first, MTA could increase the limit of item definitions (for example, to 65535). Then put some empty DFF on all unused slots. Scripters could add new models with same functions. Link to comment
Faw[Ful] Posted July 17, 2011 Share Posted July 17, 2011 It is unstable alot when you replace gta objects with custom IDE options -alpha objects -destructible objects -objects that explode -physic objects unstable on the COL of your custom things and it breaks the default collision on some gta sa obj 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