Fun With Scripted Textures
Moderator: TNM Team
Fun With Scripted Textures
Awhile back Jonas mentioned to me that he could use the ability to switch between multiple textures dynamically as it would be easier, more elegant and less hacky than sheet movers or whatever his alternative was. I poked around with scripted textures a bit but didn't actually attempt anything until today, and I was suprised at how easy it was to actually do.
So now I've created two classes that take control of scripted textures and allow you to swap textures on the fly with them. One class, tnmTextureSwapController, just toggles between two and the other, tnmTextureSwitchController (perhaps not my best effort on the naming schema front), allows you to swap amongst 16 textures. I'm pretty happy with how everything came out but what I could use now are two things:
1) Some testing. I'm not entirely sure how well the engine copes with textures of different resolutions for instance, and I want to make sure these are stable.
2) Let me know if we have any other uses for them. I can't directly edit pixels or palletes, but I can, for instance, draw text on them, pan them, draw tiled textures on other textures (given a pallete that has both) and of course swap palletes and such.
The beta classes can be found here.
To use them you'll need to create a ScriptedTexture (not one of the subclasses, those are are FractalTextures are a I recall and would conflict quite heavily), setting its resolution to whatever you want and applying it to the surfaces (or actors, that'd be interesting) you want. You'd then need to create one of the TextureControllers (look under info) and get them set up pointing to your scripted texture and then it's just a matter of having something trigger them.
I appreciate the help.
So now I've created two classes that take control of scripted textures and allow you to swap textures on the fly with them. One class, tnmTextureSwapController, just toggles between two and the other, tnmTextureSwitchController (perhaps not my best effort on the naming schema front), allows you to swap amongst 16 textures. I'm pretty happy with how everything came out but what I could use now are two things:
1) Some testing. I'm not entirely sure how well the engine copes with textures of different resolutions for instance, and I want to make sure these are stable.
2) Let me know if we have any other uses for them. I can't directly edit pixels or palletes, but I can, for instance, draw text on them, pan them, draw tiled textures on other textures (given a pallete that has both) and of course swap palletes and such.
The beta classes can be found here.
To use them you'll need to create a ScriptedTexture (not one of the subclasses, those are are FractalTextures are a I recall and would conflict quite heavily), setting its resolution to whatever you want and applying it to the surfaces (or actors, that'd be interesting) you want. You'd then need to create one of the TextureControllers (look under info) and get them set up pointing to your scripted texture and then it's just a matter of having something trigger them.
I appreciate the help.
NVShacker
Are you still there?
Are you still there?
Re: Fun With Scripted Textures
Hmm... perhaps we could use this to make the animation of ShadowCode's face on the TFT monitors in the OSC switch randomly instead of cycling through a preset sequence? That would actually cut down significantly on the amount of textures in the animation (because some frames have been copied to show several times in each cycle for variation).NVShacker wrote:(or actors, that'd be interesting)
Jonas Wæver
Chief Poking Manager of TNM
I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
Chief Poking Manager of TNM
I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
Come now Larry, if that were our attitude, this mod would've been released 3 years ago, and it would've sucked. We'll mess with it because it could work better
Jonas Wæver
Chief Poking Manager of TNM
I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
Chief Poking Manager of TNM
I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
- Trestkon
- Off Topic Productions
- Posts: 2820
- Joined: Sat Apr 24, 2004 9:03 pm
- Location: Canada
- Contact:
Works like a charm!!
Just a note, you have to actually type in the path to the scripted texture manually, as the browser won't let you just click on it and press 'Use'. Also, you just need the one scripted texture, and then it can cycle through any other regular textures
Just a note, you have to actually type in the path to the scripted texture manually, as the browser won't let you just click on it and press 'Use'. Also, you just need the one scripted texture, and then it can cycle through any other regular textures
-Life does not snap to the x-axis