Tue Jan 11, 2022 1:36 am
Tue Jan 11, 2022 7:05 am
LineTrace
straight down from the actor's position. If a 3D floor was hit, change the ceiling texture of that 3D floor's control sector; otherwise, change the floor of the sector that was hit.private void ChangeFloorTexture(string name, int maxdist = 1024)
{
let tex = TexMan.CheckForTexture(name);
if (!tex.IsValid())
{
return;
}
FLineTraceData t;
if (LineTrace(0, maxdist, 90, TRF_THRUACTORS, data: t) && t.HitType == TRACE_HitFloor)
{
if (t.Hit3DFloor != null)
{
t.Hit3DFloor.model.SetTexture(Sector.ceiling, tex);
}
else if (t.HitSector != null)
{
t.HitSector.SetTexture(Sector.floor, tex);
}
}
}
Tue Jan 11, 2022 9:04 am
SectorTagIterator SectorSearch = SectorTagIterator.Create(SectorTag);
int Vari;
while ((Vari = SectorSearch.Next)>0) // An empty "value" is -1, so we need to check for that
{
level.sectors[Vari].SetTexture(sector.floor, TexMan.CheckForTexture(TextureNameString, TexMan.Type_Any)
}
Tue Jan 11, 2022 9:08 am
Virathas wrote:It might not work with 3D Floors, but in the case of the project I am working on, it is not a problem - since no 3D floors will be ever present.