ZScript "Standard Library" - Brainstorming

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript "Standard Library" - Brainstorming

Post by Graf Zahl »

ZZYZX wrote:We desperately need a portal-aware CheckSight.
CheckSight is portal aware. If you think it doesn't work right, make a demo map and file a bug report.
dpJudas
 
 
Posts: 3109
Joined: Sat May 28, 2016 1:01 pm

Re: ZScript "Standard Library" - Brainstorming

Post by dpJudas »

I might end up calling it Hamish's Open Example Scripts ;)
User avatar
Rachael
Posts: 13720
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: ZScript "Standard Library" - Brainstorming

Post by Rachael »

You dirty, dirty man. :P
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript "Standard Library" - Brainstorming

Post by Major Cooke »

Since Handy Open Example Repository SYSTEM is what Xaser's sold on and ZBoost is taken, I think we can settle on it and get rolling. So Xaser, what's next?
Gez
 
 
Posts: 17922
Joined: Fri Jul 06, 2007 3:22 pm

Re: ZScript "Standard Library" - Brainstorming

Post by Gez »

I have no idea how and why exactly Scripts got replaced by an all-caps SYSTEM by the way. It's not something I consciously wanted to do.
User avatar
Xaser
 
 
Posts: 10773
Joined: Sun Jul 20, 2003 12:15 pm

Re: ZScript "Standard Library" - Brainstorming

Post by Xaser »

Do we need a bacronym for SYSTEM too, now? :P

@Major Cooke: I'll hit you up on Discord tonight-ish when I'm through being a real-life-human for the day; gears are turning, though.
Gez
 
 
Posts: 17922
Joined: Fri Jul 06, 2007 3:22 pm

Re: ZScript "Standard Library" - Brainstorming

Post by Gez »

Xaser wrote:Do we need a bacronym for SYSTEM too, now? :P
"So You Seek To Enhance Mods" ;)
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript "Standard Library" - Brainstorming

Post by Major Cooke »

Xaser wrote:@Major Cooke: I'll hit you up on Discord tonight-ish when I'm through being a real-life-human for the day; gears are turning, though.
Same. I'll be a few hours before I can get on.
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript "Standard Library" - Brainstorming

Post by Major Cooke »

Rachael wrote:Time to get researching! The world is counting on you! You are our second most knowledgeable person on the subject!

Kidding, of course...

Except about that last part... :twisted:
Hurrrr... Sad to say, the straightforward part fell into a river and swept up the butt stream of oblivion.

Menus are going to be a pain in the ass to figure out...
User avatar
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: ZScript "Standard Library" - Brainstorming

Post by Nash »

Going to town with the ZScriptified menu, man this is some powerful shit, it's fun even if the learning curve is damn high. It's really satisfying to see my custom made widgets come to life on the screen, though.

I plan to make some ready-to-use menu design templates. Gonna start simple and make menu layout imitations of some famous games...
Gez
 
 
Posts: 17922
Joined: Fri Jul 06, 2007 3:22 pm

Re: ZScript "Standard Library" - Brainstorming

Post by Gez »

So can you do stuff like ROTT's new game menu (random set of skill setting names, character portrait that changes depending on skill selected; etc.)? Is it possible to have a menu music that interrupts the normal music loop while the menu is on?
User avatar
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: ZScript "Standard Library" - Brainstorming

Post by Nash »

random set of skill setting names: Yes

character portrait that changes depending on skill selected: Yes

menu music that interrupts the normal music loop while the menu is on: Don't know, I haven't tried to change music through ZScript yet... but even if that's possible, I don't think you can continue the level's music from where it previously was before you opened the menu.
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript "Standard Library" - Brainstorming

Post by Major Cooke »

It's not doable because Close() is not a virtual. It would've been possible otherwise with the following hack:

1. Set global freeze to true.
2. Open the menu, grab the global cvar for music.
3. Call S_Sound with the menu music.
4. On close, silence the sound, disable the global level freeze if it wasn't set before.

The problems with this:

1. Menu music not adjustable while playing.
2. Requires a custom keybind.
3. Not multiplayer compatible.

And those are some very good reasons not to do it too.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript "Standard Library" - Brainstorming

Post by Graf Zahl »

Close is not virtual to prevent it from blocking the close action. If you need to do something on menu close, override OnDestroy.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: ZScript "Standard Library" - Brainstorming

Post by Matt »

Just a little thing, but one that takes long enough to prepare that most people might not bother: a sine/cosine lookup table for every whole degree up to 360.

(I don't even know for sure if the VM is enough to counteract any performance increase, but given that the discussions I was reading about were talking about lookup tables many thousands of items in length I'm going to assume this will be faster.)


EDIT: Do not use this. It's actually several times slower than the native sine function, and the difference isn't even noticeable until you're getting into many thousands of these calculations per tic. Leaving it up for reference only.

[2020-10-24 deleted]
Last edited by Matt on Sat Oct 24, 2020 9:06 pm, edited 2 times in total.

Return to “Script Library”