Jump to content

the Hollywood-Sign


Recommended Posts

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

X85v1.jpg

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

Hey^^

Of course I put the files in the meta.xml :D

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" xD and this works :S I dont know what is wrong, because wiki tells me, that you must do it like my function :S

Link to comment

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

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
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
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

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

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...