Object material
#1

Hi guys, I'm working on a project and I wonder is there way to set the Object material for 100 and more objects to the same one using only one variable ?
Thanks in advance.
Reply
#2

The next version of Texture Studio will have text, copy/paste object material properties and the ability to texture multiple like objects at the same time to a material and/or color.
Reply
#3

Not a safe way. You can just store the first object id, and then change the material for the following 100+ ids. But this will just work safely if you create the objects at gamemode start, never remove them during runtime, and always completely shut down the server for restarting it, instead of using gmx or stuff. Else ids might get mixed up, and some of the ids after the stored one might be invalid or belong to other objects, eventually turning your map into a psychedelic wonderland of strange textures.

Alternatively, you can change the material directly on creation for every single object, but that extremely messy.

SetObjectMaterial(CreateObject(habbbadffd), adjkasdjkasjkfj)
Reply
#4

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
The next version of Texture Studio will have text, copy/paste object material properties and the ability to texture multiple like objects at the same time to a material and/or color.
That's nice, but I can't wait its release now.

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Not a safe way. You can just store the first object id, and then change the material for the following 100+ ids. But this will just work safely if you create the objects at gamemode start, never remove them during runtime, and always completely shut down the server for restarting it, instead of using gmx or stuff. Else ids might get mixed up, and some of the ids after the stored one might be invalid or belong to other objects, eventually turning your map into a psychedelic wonderland of strange textures.

Alternatively, you can change the material directly on creation for every single object, but that extremely messy.

SetObjectMaterial(CreateObject(habbbadffd), adjkasdjkasjkfj)
I thought to release that project, so what do you suggest me to set the material for each object or not ?
Reply
#5

Quote:
Originally Posted by Wizzy951
Посмотреть сообщение
I thought to release that project, so what do you suggest me to set the material for each object or not ?
Neither of them. If you want to release it, just create an array to store the ids in. That wont even be a kilobyte of ram and people will have to live with that. Releasing unstable or ugly code is more of a bad scripting manner than wasting some bytes of ram
If you really dont want that go with the second one. Bad code, but at least people wont complain about bugs.
Reply
#6

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Alternatively, you can change the material directly on creation for every single object, but that extremely messy.

SetObjectMaterial(CreateObject(habbbadffd), adjkasdjkasjkfj)
That isn't a good way to do it what if you have several material indexes on a object to set ? Yes it will work for one index fine of course but I think it makes it less extensible for future updates.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)