PerInstanceRandom input functionality change

I’ve read a thread like this before on here, but it didn’t seem to solve my problem as the engine has changed since.

Basically, I’m creating a game which utilizes HISM components, and I needed to be able to have the instances on the same HISM change texture based on their “type” (my own numerical input). I was wondering if there was a way I could manipulate the PerInstanceRandom node to output a custom value, or if there was another way to achieve the same goal.

Thanks in advance

Edit:
Original post: Customise UVs per instance with Instanced Static Meshes - Rendering - Unreal Engine Forums

Edit 2:
Found this post (gonna try and see if this helps me): https://forums.unrealengine.com/unreal-engine/feedback-for-epic/110733-instance-index-for-instanced-static-mesh-in-the-material-editor

After many hours of digging and testing, I finally got a solution. I will post my solution asap.

EDIT: My tutorial: Per Instance custom data inside of material - Community Content, Tools and Tutorials - Unreal Engine Forums