Can you auto generate Component Type hash?

It is nice that you can declare components, but is there a better way to get these long hexidcimals, instead of having to manually type in different one’s for new componets.

DECLARE_COMPONENT_TYPE("Actor", 0x2F05C6D2EF9B4D50, 0x8D7E831294783AE2)

Good question! While it doesn’t give you the perfect format, Visual Studio actually has a built-in GUID generator, accessible via Tools -> Create GUID. Once it’s open, select GUID Format 4 (it’s closest to the hi-lo format used in DECLARE_COMPONENT_TYPE), and click Copy. From there, you can paste into the macro, remove the dashes and braces, add a couple '0x’s, and you’re good to go!

Hope that helps! I personally use the Create GUID tool a lot, so I have it mapped to Alt+E in my environment. If you find yourself writing a lot of components, you may want to do something similar.

thanks great answer!