Something perhaps of interest. I'm playing around some more with on-the-fly environmental modifications, this time of interiors. Most of the time lately I've been using placeable construction materials rather than tilesets, but I saw a reference to something called "tile magic" in NWN1 that allowed them to dynamically change tilesets during the game for some cinematic purpose in one of the expansions, so I took a couple of hours to see how it might work in NWN2.
The scripting they used relied on some constants in a 2DA, a model that doesn't exist in NWN2, and a different set of tiles, so I wrote a new function based on the same general idea to do it the NWN2 way (and without the use of a 2DA), and wrote a couple of utility scripts to do things like change to various standard sets and rotate them.
Tinting is of course possible as well, and presumably texture swapping as well, but it would take more time and I just wanted to see this in action in a hurry.
One limitation is that I can't seem to find a way to spawn an actual door object, aside from a door placeable which could be spawned as a non-usable cosmetic door positioned ajar in the doorway. However, since you likely don't want the player to walk through walls, you'd probably want to start the room out with some tiles already in it (I just started out with a blank room in this video to show how it was done), and pre-bake your walkmesh with the expected wall arrangement in place, so you could place real doors in there at that time.
Basically, my purpose for a script like this would be to let me create new interiors as I need them without having to add actual new areas to my modules. Of course I'd spawn decorative placeables and NPCs into them as well. One other potential problem with such a system would be players dropping items in the area and expecting them to still be there later, which they wouldn't if I needed to change the area to something else, unless I really wanted to take the trouble to store the contents of the area for any future time they might enter it.





Retour en haut







