CruX, on 15 November 2017 - 12:00 PM, said:
is there any way to mass-change the properties of a specific texture used in a map (through con coding) based on the properties it already has? Sector/wall structs really aren't my strong suit so I don't know how complicated this is, but it's stumped me either way. Basically I'm trying to assign a hightile to #199 because it's used as a sky texture a lot.
Problem is that it's also used for a lot of other things where the hightile would look out of place, so I got the idea to only assign it based on a generally unused pallet in the DEF file, then change the texture's pallet via con based on certain conditions (eg if it's being used as a sky texture on a paralaxed ceiling). The code I wrote works, but not really. It's all dependent on the player, so the sky's pallet ONLY changes when the player enters that sector which makes enough sense, but for obvious reasons i can't have it work that way. I'm not sure how to make that change happen independent of the player though.
Wouldn't it make more sense to use mapster script and just fix the map?
If you want to do it via CON, you could use code like this:
onevent EVENT_ENTERLEVEL
set temp 0
whilevarvarn temp NUMSECTORS
{
ife sector[temp].ceilingpicnum 199
ifvarand sector[temp].ceilingstat 1
setsector[temp].ceilingpicnum MYHIGHTILECEILING
add temp 1
}
endevent
That code doesn't do anything with palettes, but you can easily add a condition that checks ceilingpal, or you could change ceilingpal instead of changing ceilingpicnum.