scp-fs2open / scp-fs2open/fs2open.github.com

Request: Extend tabled texture replacements to work with SEXP or script ship changes

Open
#2,391 0 comments 0 reactions 0 assignees View on GitHub
enhancement sexps wish list
Dominant language
C++
Stars
487
Forks
184
Avg merge
3d 9h
Merged PRs (30d)
44

Description

If you use SEXP or script to switch between ship types that share a POF but have different textures due to $Texture Replace: in their ship table, the textures do not change. Conversation on Discord provided some insight into the history of this which I will quote here for context

>
> taylor: @ EatThePath That was one of the things to be fixed with the texture set code I was working on years ago (Xt stuff). It was fully working from ships.tbl and mission files, but I was never able to get the switching code for sexps and scripting working properly. So, the feature never got finished/added
> Sucks too, since it was probably one of the coolest features that never made it out of Xt
>
> Goober5000: @ taylor Was that a graphics problem or a sexp/scripting problem? If it's the latter, I'd be glad to help you out if you were willing to give it another shot.
>
> taylor: Neither really, it was a management problem. The textures in the model went into the base texture set, the replacement textures specified in ships.tbl became a texture set in Ship_info[], and replacement textures in the mission became a texture set in p_object. And Ships[] contained a ptr which just pointed to one of the two replacement sets (or NULL for the base set in model). This was an easy thing to manage...
> The problem was where sexps/scripting can switch to new or existing sets over and over again. For this I planned to create a management system to make it easy to switch between different texture sets. But I could never get it to work without crashing, leaking memory, or using the wrong set (or all of the above). It really shouldn't have been that difficult to do. Just one of those things where you look at it for too long and your brain stops working
> My test mission, in my head anyway, was a game of tag. When you were "it" you get a different texture set. If you were just "it" you would also have a different texture set and couldn't be "it" next. So everyone would be switching textures back and forth the entire mission, and there would be up to 4 possible texture sets for each ship which you would get based on "it", score, etc. I just wasn't able to switch between them in a reasonable manner
> In my defense, I was pretty burned out by then, so it just wasn't something I had the energy to work through anymore

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.