I want to replace an iconic model from the game, withy one of my own. for the sake of mod/game consistency.
Now in my previous mod question thread, @BrunoSupremo said that mixins override the already existing stuff when it mixins text. Like this:
I hoped this would work with a { “model” : “file(model)” }-format as well, and it worked, sort of. When I stamped the model I saw both the old and the new model spawned in simultaneously.
Is there a (maybe entirely different) way to do this?
It worked. I also cut out all the stuff I didn’t want to replace (the “placable_on_gound”, “type” and “mixins” for instance), and it still works, so you can cut it out of you mod without worries. (faster loading time, for what it is worth).
You got two models because that is what a mixin does. It fuses two codes into one. When you have a [ … ] every thing inside the list is a item. With a mixin or mixinto, you are just adding one more there. That is why you end up with two models.
In the old thread when I said the mixin replaces code, I was referring to the “text”:“your text here”. Only text and numbers are replaced. Everything else is added like in this case now, where it was not a text, but an item in a list.
The code show above by Hamnisu is not a mixin for the iconic. It is telling which file has the iconic, without blending them. If it was a mixin, the contents would fuse in that file and that would not work because the game expects it to be on its own file.
What you did was creating a full new file just for the iconic form of entity. It works, but was not needed.
Are you trying to change an iconic from a item already in the game that is not part of your mod?
Then you could simple override the model.
In the manifest:
“overrides”:{
“qb_you_want_to_replace”:“your_qb”
}
To clarify the above code:
The game has no way to guess where the iconic file and its information of your object is. It can’t even know if the objects actually needs an iconic. For example, trees don’t have an iconic, nor a ghost.
That is why we use that entity_forms component. It is our way to inform the game, hey this entity has an iconic and it is in this file.
When we see that a json of an entity has in the top of its file a line like:
“mixin”: "link to its own ghost file"
It is just a way for us lazy coders to reuse code that would be repeated, like the display name or even the models. We are not defining the ghost file. That is done on that entity_forms component.