ZScript "Standard Library" - Brainstorming

Post your example zscripts/ACS scripts/etc here.

Re: ZScript "Standard Library" - Brainstorming

Postby Graf Zahl » Tue Jan 31, 2017 2:41 am

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript "Standard Library" - Brainstorming

Postby dpJudas » Tue Jan 31, 2017 3:17 am

I might end up calling it Hamish's Open Example Scripts ;)
dpJudas
 
 
 
Joined: 28 May 2016

Re: ZScript "Standard Library" - Brainstorming

Postby Rachael » Tue Jan 31, 2017 3:23 am

You dirty, dirty man. :P
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: ZScript "Standard Library" - Brainstorming

Postby Major Cooke » Tue Jan 31, 2017 9:22 am

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?
User avatar
Major Cooke
d = klabs(wall[wall[wall[sector[dasect].wallptr].point2].point2].x-s->x)...
 
Joined: 28 Jan 2007

Re: ZScript "Standard Library" - Brainstorming

Postby Gez » Tue Jan 31, 2017 9:42 am

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.
Gez
 
 
 
Joined: 06 Jul 2007

Re: ZScript "Standard Library" - Brainstorming

Postby Xaser » Tue Jan 31, 2017 10:54 am

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.
User avatar
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: ZScript "Standard Library" - Brainstorming

Postby Gez » Tue Jan 31, 2017 11:47 am

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

"So You Seek To Enhance Mods" ;)
Gez
 
 
 
Joined: 06 Jul 2007

Re: ZScript "Standard Library" - Brainstorming

Postby Major Cooke » Tue Jan 31, 2017 2:33 pm

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
d = klabs(wall[wall[wall[sector[dasect].wallptr].point2].point2].x-s->x)...
 
Joined: 28 Jan 2007

Re: ZScript "Standard Library" - Brainstorming

Postby Major Cooke » Tue Feb 14, 2017 9:21 pm

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
Major Cooke
d = klabs(wall[wall[wall[sector[dasect].wallptr].point2].point2].x-s->x)...
 
Joined: 28 Jan 2007

Re: ZScript "Standard Library" - Brainstorming

Postby Nash » Thu Feb 16, 2017 12:33 pm

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...
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: ZScript "Standard Library" - Brainstorming

Postby Gez » Thu Feb 16, 2017 1:28 pm

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?
Gez
 
 
 
Joined: 06 Jul 2007

Re: ZScript "Standard Library" - Brainstorming

Postby Nash » Thu Feb 16, 2017 1:32 pm

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
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: ZScript "Standard Library" - Brainstorming

Postby Major Cooke » Thu Feb 16, 2017 2:54 pm

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
Major Cooke
d = klabs(wall[wall[wall[sector[dasect].wallptr].point2].point2].x-s->x)...
 
Joined: 28 Jan 2007

Re: ZScript "Standard Library" - Brainstorming

Postby Graf Zahl » Thu Feb 16, 2017 3:06 pm

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript "Standard Library" - Brainstorming

Postby Matt » Sat Mar 04, 2017 1:06 am

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.
Attachments
sincos_standalone.txt.7z
(2.03 KiB) Downloaded 62 times
Last edited by Matt on Sat Mar 04, 2017 12:14 pm, edited 1 time in total.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

PreviousNext

Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest