Fun With Scripted Textures

Stare in awe at the fascinating machinations of the TNM team during the last two years of production, this was our private forum.

Moderator: TNM Team

Post Reply
User avatar
NVShacker
Off Topic Productions
Off Topic Productions
Posts: 178
Joined: Sun Sep 03, 2006 4:14 am

Fun With Scripted Textures

Post by NVShacker »

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.
NVShacker
Are you still there?
User avatar
Trestkon
Off Topic Productions
Off Topic Productions
Posts: 2820
Joined: Sat Apr 24, 2004 9:03 pm
Location: Canada
Contact:

Post by Trestkon »

Oh, snap! That sounds unbelievably useful and awesome :D

I'll get right on the testing after my last midterm on Thursday. Great job, Sir Shacker!
-Life does not snap to the x-axis
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: Fun With Scripted Textures

Post by Jonas »

NVShacker wrote:(or actors, that'd be interesting)
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).
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
User avatar
Trestkon
Off Topic Productions
Off Topic Productions
Posts: 2820
Joined: Sat Apr 24, 2004 9:03 pm
Location: Canada
Contact:

Post by Trestkon »

We could do that, but why mess with something that's already working?
-Life does not snap to the x-axis
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Post by Jonas »

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
User avatar
Trestkon
Off Topic Productions
Off Topic Productions
Posts: 2820
Joined: Sat Apr 24, 2004 9:03 pm
Location: Canada
Contact:

Post by Trestkon »

Yes, but *how* is it better?
-Life does not snap to the x-axis
User avatar
NVShacker
Off Topic Productions
Off Topic Productions
Posts: 178
Joined: Sun Sep 03, 2006 4:14 am

Post by NVShacker »

Well random would probably be slightly more asthetically pleasing than sequential, though it's hardly a big deal.
NVShacker
Are you still there?
User avatar
Trestkon
Off Topic Productions
Off Topic Productions
Posts: 2820
Joined: Sat Apr 24, 2004 9:03 pm
Location: Canada
Contact:

Post by Trestkon »

Oh yes, random. That would indeed be better:)
-Life does not snap to the x-axis
User avatar
Trestkon
Off Topic Productions
Off Topic Productions
Posts: 2820
Joined: Sat Apr 24, 2004 9:03 pm
Location: Canada
Contact:

Post by Trestkon »

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 :D
-Life does not snap to the x-axis
Post Reply