ZPolyobject - ZScript Polyobject Library

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
mikolah
Posts: 6
Joined: Wed Oct 05, 2016 7:02 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support

ZPolyobject - ZScript Polyobject Library

Post by mikolah »

ZPolyobject - ZScript Polyobject library
This library adds Polyobject support to ZScript.

It makes querying polyobject state, such as current position, velocity and rotation, possible from within ZScript. In addition, it allows polyobject behavior to be customized through polyobject effectors.

Originally I wrote this code a while back for Dynamo's WIP Wolf3D-based mod, but I think it might also be useful on its own as a standalone library.

The code is heavily commented, so make sure to look through the source if you need any help.

Download link


Examples
Here are some code snippets showcasing basic usage:
Spoiler:
Advanced examples
There are two examples in /ZScript/Examples/ directory inside the .pk3 file:
Spoiler:
A small test map is included, go to MAP01 to see them both in action.

Usage
Feel free to use this library in your projects, as long as you credit me.
Licensed under the MIT License.

Credits
Dynamo, for helping me find and fix bugs
Last edited by mikolah on Sat Oct 08, 2022 7:52 am, edited 2 times in total.
Gez
 
 
Posts: 17937
Joined: Fri Jul 06, 2007 3:22 pm

Re: ZPolyobject - ZScript Polyobject Library

Post by Gez »

Nice! The advanced effect examples in particular, I can see them becoming staples of future projects.
User avatar
Dynamo
Posts: 1043
Joined: Sat Jun 07, 2008 5:58 am
Location: Industrial District

Re: ZPolyobject - ZScript Polyobject Library

Post by Dynamo »

Not much I can say other than this is an absolutely fantastic package, which has been absolutely vital for my mod's continued progression. A hundred thumbs up :thumb:
User avatar
Redneckerz
Spotlight Team
Posts: 1111
Joined: Mon Nov 25, 2019 8:54 am
Graphics Processor: Intel (Modern GZDoom)

Re: ZPolyobject - ZScript Polyobject Library

Post by Redneckerz »

Brilliant stuff. Worth putting up for the ZScript wiki article perhaps, or do you want to flesh it out a little more?
User avatar
mikolah
Posts: 6
Joined: Wed Oct 05, 2016 7:02 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: ZPolyobject - ZScript Polyobject Library

Post by mikolah »

Sure, that would be great!
There are some minor features I want to add at some point in the future (building a list of all linedefs that belong to a polyobject, methods that incapsulate calls to polyobject action specials, etc), but it's already fully functional as is.
User avatar
Redneckerz
Spotlight Team
Posts: 1111
Joined: Mon Nov 25, 2019 8:54 am
Graphics Processor: Intel (Modern GZDoom)

Re: ZPolyobject - ZScript Polyobject Library

Post by Redneckerz »

Oh i just connected your username with that other thing you are known for - Mikoveyors :P I have saved this as a link.
User avatar
prosto
Posts: 1
Joined: Thu Jan 16, 2025 8:47 pm

Re: ZPolyobject - ZScript Polyobject Library

Post by prosto »

Hello, can you add methods for rotation to absolute angle, in degrees. Using these specials as a base
https://zdoom.org/wiki/Polyobj_RotateLeft
https://zdoom.org/wiki/Polyobj_RotateRight

If you can't, I'll make it by myself, because I need this. But I think, as the author, you can make it in the proper way. Or I can do it by myself, and then you'll update it with my patch (maybe 1-2 month later)
Last edited by prosto on Wed Mar 19, 2025 4:47 pm, edited 2 times in total.

Return to “Script Library”