MantisBT - Zandronum
View Issue Details
0002193Zandronum[All Projects] Suggestionpublic2015-04-17 02:252024-01-29 15:01
StrikerMan780 
 
highmajorN/A
resolvedfixed 
MicrosoftWindowsXP/Vista/7
 
 
0002193: Backport CrimsonDusk's GetSectorFloorZ/CeilingZ changes for 2.1
There was a change to GetSectorFloorZ/GetSectorCeilingZ that allowed you to pass 0 as an argument to represent "Any" sector. This is necessary for a dynamic weather system I have in the works, and was hoping to be able to use this feature in Zandronum 2.1.

'http://zdoom.org/Changelog/d7a24357/files [^]'
Here's a sample script that is using this, to spawn raindrops at the correct Z coordinate of the sector it's spawning in. This works in GZDoom and ZDoom, but not Zan.

script 910 ENTER CLIENTSIDE
{
    if(ConsolePlayerNumber() != PlayerNumber())
    {
        Terminate;
    }
    
    while(1)
    {
        int WeatherType = GetCVar("smmp_weathertype");
        
        if(WeatherType > 0)
        {
            int Density = GetCVar("smmp_weatherdensity");
            
            for(int i = 0; i < Density; i++)
            {
                int x = GetActorX(0) + random(-512.0, 512.0);
                int y = GetActorY(0) + random(-512.0, 512.0);
                int z = GetSectorCeilingZ (0, x >> 16, y >> 16) - random(1.0, 8.0);
                 
                SpawnForced(RainActors[WeatherType-1], x, y, z);
            }
        }
        
        delay(1);
    }
}
No tags attached.
Issue History
2015-04-17 02:25StrikerMan780New Issue
2015-04-17 15:42IvanNote Added: 0012123
2015-04-17 16:03ibm5155Note Added: 0012124
2015-04-17 16:09ibm5155Note Edited: 0012124bug_revision_view_page.php?bugnote_id=12124#r6974
2015-04-17 17:30StrikerMan780Note Added: 0012125
2024-01-29 15:01Ru5tK1ngNote Added: 0023031
2024-01-29 15:01Ru5tK1ngStatusnew => resolved
2024-01-29 15:01Ru5tK1ngResolutionopen => fixed

Notes
(0012123)
Ivan   
2015-04-17 15:42   
What kind of an "any" sector? Doesn't 0 normally represent the current actor's sector?
(0012124)
ibm5155   
2015-04-17 16:03   
(edited on: 2015-04-17 16:09)
On my weather system, that was the biggest problem for me, and still is, it never worked fine, it's bad I can't get propertly a celing or floor position if the sector to be tested '-'.

Because of that I was forced to set manually all the ceiling sizes so my rainfall could at least work '-'.

Also, it would be nice to have a GetHighestCeiling function, since GetSectorCeilingZ woudn't work at all on sectors with 3D floors on it '-'

If you guys want, I have made a test cenary for testing this rainfall simulation in most cases (slopes, 3D floors, 3D slopes, 3D floors over 3D floors over slopes...)

(0012125)
StrikerMan780   
2015-04-17 17:30   
"What kind of an "any" sector? Doesn't 0 normally represent the current actor's sector?"

No. It's supposed to return the Height of any sector found at the specified X/Y Coordinates.

You're thinking of Get*ACTOR*FloorZ/CeilingZ .
(0023031)
Ru5tK1ng   
2024-01-29 15:01   
This was added in 3.0