Team Spartan Cookies & Milk Forums
E2 Sub Color - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Feedback (https://teamscm.co.uk/forum-9.html)
+--- Forum: Suggestions and improvements (https://teamscm.co.uk/forum-11.html)
+--- Thread: E2 Sub Color (/thread-2751.html)



E2 Sub Color - Ethan Vondwarf - 23-07-2018

Is it possible to add a sub color function to E2?
if so please add it


RE: E2 Sub Color - frdhog - 30-07-2018

entityConfusedetSubMaterial(materialIndex, override)
Bearing in mind that textureIndex is an integer and that override is a string for the new material.
You'll need manually test to find the material index if you are just after a single prop. Otherwise you might need to create a function to search through the materials to find the right one to override.
I don't believe there is much if any documentation of the function so try examining Pho's PCPU Lib file, I've personally learnt a lot from it.
Good luck


RE: E2 Sub Color - Ethan Vondwarf - 30-07-2018

But it's sub color i want
It's possible via the Smart Materials tool
but not on Expression 2


RE: E2 Sub Color - frdhog - 30-07-2018

Sorry, I misunderstood the question but from further checking, it does not exist. I can't find the source of the submaterial tool but I expect it uses a similar method to the DarkRP arrest stick:
https://github.com/FPtje/DarkRP/blob/master/entities/weapons/stick_base/shared.lua#L43
However, I'd like to draw attention to the fact that Starfall has neither submaterial or subcolor functions as far as I can tell.


RE: E2 Sub Color - Veegi - 30-07-2018

Quote:However, I'd like to draw attention to the fact that Starfall has neither submaterial or subcolor functions as far as I can tell.
Code:
entity:setSubMaterial( index, material ) entity:setSubMaterialColor( index, colour )
Both are present in the documentation.


RE: E2 Sub Color - Ethan Vondwarf - 30-07-2018

WAT!?!? IT EXISTED?!?!