[ZScript] ZForms 1.0

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
krokots
Posts: 266
Joined: Tue Jan 19, 2010 5:07 pm

Re: [ZScript] ZForms 1.0

Post by krokots »

Is there some easy way to make the menu not pausing the game?

Ha, never mind, I found this great tip from Nash

Code: Select all

    override void Ticker(void)
    {
        menuactive = Menu.OnNoPause;
    }
User avatar
Xeotroid
Posts: 436
Joined: Sat Jun 23, 2012 7:44 am
Graphics Processor: nVidia with Vulkan support
Location: Czech Rep.

Re: [ZScript] ZForms 1.0

Post by Xeotroid »

You can also put that in the Init() virtual method with the rest of the menu set-up.
julmust
Posts: 5
Joined: Tue May 30, 2023 5:43 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)

Re: [ZScript] ZForms 1.0

Post by julmust »

*Edit* Fixed it. If you are using the latest gzdoom there is a small bug in ZForms in "Frame.zsc" line 4 and 5. Change uint to int and you will be able to run the script. Thank you for an awesome framework.

I am trying to get ZForms to work.

I've gotten SimpleMenu.ZS to work, without the buttonClickCommand. When I run the project with buttonClickCommand, it throws this error:

C:/projects/doom/project/game/:zscript/simplemenu.zs, line 17: Attempt to override non-existent virtual function buttonClickCommand

I have copied the Samples project to a T, just generating a new Prefix from the main repo.

Any ideas?
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: [ZScript] ZForms 1.0

Post by Gutawer »

After helping someone with a ZForms issue on Discord I realized that I never actually linked the new documentation for the git version, even though it's been up for ages...
https://gutawer.gitlab.io/gzdoom-zforms ... index.html
This entirely replaces the old miraheze wiki, and is specifically for the current git version (which, I feel like pointing out at this point, is a much better version of ZForms than the one this thread advertises. I am working on bringing it to a releasable state again after being quite swamped by university work!).
User avatar
Major Cooke
Posts: 8176
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [ZScript] ZForms 1.0

Post by Major Cooke »

Epic! I was just about to get started, and admittedly I was confused when I had first began. Hopefully this makes it much easier to delve into.

Does this include the 'animation' branch or just 'master'?
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: [ZScript] ZForms 1.0

Post by Gutawer »

This is for the main branch. The animation branch does have a bunch of cool work but it's (varying levels of) experimental and I'm currently in the progress of overhauling some things to introduce a layout system. I wouldn't advise using it unless you're willing to ask me a lot of questions about migrating stuff whenever I decide to work on it lol
User avatar
Major Cooke
Posts: 8176
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [ZScript] ZForms 1.0

Post by Major Cooke »

Heh fair enough. Yeah I'll wait. Though I am curious what is planned for it?
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: [ZScript] ZForms 1.0

Post by Gutawer »

Lots of stuff, a fair amount of which is done.
  • Removing the separation of tickers/drawers, the library in general has been refactored to run at any frame rate, making it much smoother than it used to be.
  • Affine transformations on elements, allowing any element to be rotated, offset, sheared, scaled, etc.
  • An API for defining custom "stylers" for visually complicated elements like buttons. For example, you can use this to add hover animations to a button without messily putting this functionality into something like a hover handler.
  • A fully-fledged animation system heavily inspired by (and in some respects matching in power) the CSS animation system. This allows you to automatically run animations without writing the logic yourself, including a standard library of easing functions from https://easings.net, with the capability to define easing functions yourself. It can animate any double-type property in the entire library, and has functionality for changing the speed of and pausing animations, and calling a function when an animation ends.
  • The most drastic thing, which unfortunately is a non-trivial API break (hence me doing all this work on a branch until I'm confident of it!) is a fully-fledged layout system for defining menus without manually specifying coordinates for things. This is what is currently WIP, though progress is coming along quickly. I did do something like this before, but it was based on a very different principle and didn't hold up in runtime performance. The new system is inspired by UI systems like SwiftUI by Apple. Luckily, nothing particularly changes besides API surface - manual coordinates are still totally supported because a lot of game menus work best specified like that at least to some degree.
I think that's all but this is a lot of work in total.

A note on the layout system in particular - back when I started ZForms, it wasn't something I wanted to do because my main layout experience was with the CSS layout system, which is, to be honest, pretty terrible. It's more like 4+ layout systems that interact in weird ways, with the "old one" having different rules to flexbox which has different rules to grid. This made me think that a layout system wouldn't be worthwhile for game menus, which are often more freeform than websites. I have since looked at many more systems here and found ones that do allow for a better mixture of free-form and layouted parts, with every part following the same rules.

Once all of this is finalized it'll be documented and then I'd like to produce some tutorials, because some bits can be initially confusing.

Here's an example of the layout system running:
User avatar
Major Cooke
Posts: 8176
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [ZScript] ZForms 1.0

Post by Major Cooke »

That's amazing, and going to revolutionize menus further. I'll be eager to try it when its done. But if you need any kind of testing, feel free to send me some stuff to try for it.
User avatar
Deon
Posts: 232
Joined: Thu Oct 08, 2020 10:44 am

Re: [ZScript] ZForms 1.0

Post by Deon »

This looks amazing. I will be happily waiting for the release, to rework my inventory system in never-to-be-released mod :). Thank you for everything.
User avatar
Major Cooke
Posts: 8176
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [ZScript] ZForms 1.0

Post by Major Cooke »

Will this also feature the ability to make ghost preview when dragging with a mouse? I.e. clicking and holding on something selectable and moving it around, akin to Diablo-style inventory when selecting an item.

Asking because I'm intending to make a Keyconf Destroyer mod that will allow reassigning all weapons to different slots and orders. Got to thinking about mouse support and, while it's still quite early for me to even think about attempting yet, figured I'd ask if it's doable now or if it'll be in 2.0 only. Primary method right now will be simply pressing enter on a weapon entry in the list and moving it with the arrow keys, but this does scream for mouse drag support. I know for a fact people will crave for it immediately out the gate.
Post Reply

Return to “Script Library”