Page 1 of 1

[ZScript] floor/ceiling move stuff

Posted: Wed Nov 22, 2017 1:07 pm
by gwHero
In the ZScript folders of the gzdoom.pk3 there's already a lot of map/level stuff present.
Maybe this is more for the dev's to answer: is the floor/ceiling move stuff already suitable to use for modders or needs there more to be exposed?

Re: [ZScript] floor/ceiling move stuff

Posted: Fri Nov 24, 2017 5:48 am
by gwHero
Did some more digging and got it working. Not tested with sounds yet, but the moving itself wasn't difficult after all. I'll put an example here in case more people are searching:

Code: Select all

		SectorTagIterator sit = SectorTagIterator.Create(tag,null);	
		int secnum = sit.Next();	
		if (secnum > 0)
		{				
			if (level.sectors[secnum].FloorPlane.ZatPoint(level.sectors[secnum].centerspot) == 0)
				Floor.CreateFloor(level.sectors[secnum], Floor.floorMoveToValue, null, 1, 24);
			else
				Floor.CreateFloor(level.sectors[secnum], Floor.floorMoveToValue, null, 1, 0);
		}
[Edit](Corrected example checking the Z point)