Any way to apply Floor_Waggle through ZScript?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Cacodemon345
Posts: 422
Joined: Fri Dec 22, 2017 1:53 am
Graphics Processor: ATI/AMD (Modern GZDoom)
Contact:

Any way to apply Floor_Waggle through ZScript?

Post by Cacodemon345 »

Hi, another question:
Is there any way to apply Floor_Waggle effect to a sector, based on sectorlist and floor texture?
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Re: Any way to apply Floor_Waggle through ZScript?

Post by gwHero »

It's no problem to call Floor_Waggle from ZScript, but you don't need iterating through the sectorlist, because Floor_Waggle uses a tag, and you can obtain everything from a sector in ZScript, except it's tag.

Just use Floor_waggle like you use it in ACS, with specifying the tag the sector(s) will have to be given in the editor. Or just use it from a ACS script.


EDIT: (fyi) iterating thru a sectorlist is very easy in ZSCRIPT:

example getting the id of a floor texture:

Code: Select all

for (int zz=0; zz< level.sectors.Size(); zz++) 
{   
   TextureId id = GetTexture(0); // 0 = floor texture, 1 = ceiling texture
}
Cacodemon345
Posts: 422
Joined: Fri Dec 22, 2017 1:53 am
Graphics Processor: ATI/AMD (Modern GZDoom)
Contact:

Re: Any way to apply Floor_Waggle through ZScript?

Post by Cacodemon345 »

gwHero wrote:It's no problem to call Floor_Waggle from ZScript, but you don't need iterating through the sectorlist, because Floor_Waggle uses a tag, and you can obtain everything from a sector in ZScript, except it's tag.

Just use Floor_waggle like you use it in ACS, with specifying the tag the sector(s) will have to be given in the editor. Or just use it from a ACS script.
I would rather use a tagless way to apply effects to floors, because the tagged way seems useful only for new maps.
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Re: Any way to apply Floor_Waggle through ZScript?

Post by gwHero »

Cacodemon345 wrote:
gwHero wrote:It's no problem to call Floor_Waggle from ZScript, but you don't need iterating through the sectorlist, because Floor_Waggle uses a tag, and you can obtain everything from a sector in ZScript, except it's tag.

Just use Floor_waggle like you use it in ACS, with specifying the tag the sector(s) will have to be given in the editor. Or just use it from a ACS script.
I would rather use a tagless way to apply effects to floors, because the tagged way seems useful only for new maps.
In that case you will have to do the moving of the sectors yourself. It is possible to raise and lower floors directly in ZScript. I do not have the time at the moment to create an example, but I'll give you the code of the base map thinker class and an example of the subclass thinker for MAP01 of my project. It contains code to queue events like raising or lowering floors, and callbacks to the subclass when ready. Maybe it's helpful for you if you know how to program; just remove all the stuff you don't need.

Edit: I forgot to mention that the code in my example, still obtains sectors with a specific tag. You will have to replace that by iterating thru the level sectors. In the floor raise/lower functions in my code you can find example code where the actual moving of the planes is done without sector tags.
Attachments
MMapThinker.txt
Base thinker class from my project
(20.8 KiB) Downloaded 34 times
MMAP01.txt
Subclass from my project
(11.32 KiB) Downloaded 30 times
Post Reply

Return to “Scripting”