PDA Starter Kit

Post your example zscripts/ACS scripts/etc here.

PDA Starter Kit

Postby Nash » Mon Sep 09, 2019 11:45 am





This is a generic PDA system for creating audio, text and image logs in your projects. Perfect for story/exploration-based projects, as seen in Doom 3, System Shock, etc.

Just pick up any PDA item, and a PDA Reader will be added to your inventory. Use this item to open the PDA interface. You can create an unlimited amount of PDAs, in either DECORATE or ZScript.

If a PDA has an image, it will be drawn statically. Currently images are hardcoded to be 230 tall and aren't interactable.

If a PDA has audio attached to it, clicking on it will play the audio. Closing the menu, or clicking on another PDA will stop the audio.

You're also able to customize the PDA graphic at the back (pardon my lame graphics skills, I'm not much of a UI artist :P), and the PDA UI colours.

NAVIGATION
- Click on any PDA in the PDA list to the left to read its contents.
- Scrolling with the mouse wheel while the mouse is hovered on the left will scroll your list of owned PDA collectibles, while hovering the mouse on the right and scrolling the mouse wheel will scroll the text.
- Currently, mouse in menus must be enabled (Options -> Mouse Options -> Enable mouse in menus, or "m_use_mouse 1" in the console). Keyboard/gamepad navigation will be added in future.

ISSUES
I have compiled a list of issues; both planned enhancements as well as bugs, on the Github issue tracker.

PDA Starter Kit is powered by ZForms, an extremely easy-to-use GUI library for ZScript. ZForms is brought to you by Gutawer and phantombeta.

Credits:

Nash Muhandes - code, graphics
Gutawer and phantombeta - ZForms
Nemrtvi, Nash Muhandes - Intentionally cheesy, early 2000's-style voice acting

Updates:
10th September 2019: Initial release.
13th March 2020: Significantly cleaned up the code and reduced code duplication. There are now common, reusable classes with built-in scrollbar support. Removed copyrighted content.

> Download <
> Github <
Last edited by Nash on Fri Jul 10, 2020 11:42 pm, edited 4 times in total.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Enjay » Mon Sep 09, 2019 12:12 pm

Very neat stuff. Very neat indeed. It looks to be very flexible too.

Are you aware of these warnings?

Code: Select allExpand view
Script warning, "PDA_Starter_Kit.pk3:zscript/pdamenu.zc" line 84:
Truncation of floating point value
Script warning, "PDA_Starter_Kit.pk3:zscript/pdamenu.zc" line 90:
Truncation of floating point value
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: PDA Starter Kit

Postby Nash » Mon Sep 09, 2019 12:17 pm

Hmmm, I get no warnings. :O I'm using GZDoom 4.2.0 BTW.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Enjay » Mon Sep 09, 2019 12:19 pm

Same version, but I have the developer cvar set to "2".
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: PDA Starter Kit

Postby XLightningStormL » Mon Sep 09, 2019 5:34 pm

Almost perfect, just two feature requests.

In DOOM (2016) you could gain codex entries by killing monsters, and picking up items. Essentially once you picked up an item (or a weapon), or killed a monster you'd automatically get the entry.
Page/Category/Structure support, so things such as the above, as well as audio, images, notes, beastiary, arsenal and items

With those you'd have a perfect PDA source.
User avatar
XLightningStormL
Former DUSK Wiki Master
 
Joined: 09 May 2016
Discord: XLightningStormL#7461
Twitch ID: XLightmingStormL

Re: PDA Starter Kit

Postby Nash » Mon Sep 09, 2019 9:34 pm

All of that is too specific for a generic template kit. This is a starter kit after all, not a "I'll Demake Doom 2016 For You" kit. :P Anyway all of that stuff is trivial to add for anyone who knows enough ZScript and want to expand this kit to fit their needs.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Ghost Prototype » Wed Sep 18, 2019 5:06 pm

Thanks Nash! This is something I did not know I would really need, but here we are :D
User avatar
Ghost Prototype
Be the problems you want to see in the world
 
Joined: 19 May 2013
Location: Philadelphia

Re: PDA Starter Kit

Postby ENEMY!!! » Sun Oct 06, 2019 10:47 am

I tried this out, and found out that the player has to have "Mouse Options - Enable mouse in menus" enabled for this to work. I originally had this setting disabled which meant that the PDA didn't work properly for me, but enabling the setting resulted in the PDA working perfectly - just mentioning this for in case anyone else stumbles upon this issue.

Great stuff - I was wondering if we'd ever get Doom 3-esque PDA functionality into the original Dooms, and indeed, here we are!
ENEMY!!!
 
Joined: 08 Jan 2017

Re: PDA Starter Kit

Postby Nash » Sun Oct 06, 2019 11:04 am

There's plenty of room for improvements, which will come over time. There is currently no keyboard controls, will be added in future.


Known issue. I do plan to add it when I next update this kit. :)
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Nash » Fri Mar 13, 2020 6:28 am

I pushed a significant update, although it's one not immediately apparent to the front-facing user. When I initially released this, I was terrible at using ZForms. I tried to create the various interface elements manually, resulting in a lot of duplicated code (you could see how bad it is with the scrollbars especially).

I refactored a huge chunk of it so now there are common, re-usable elements, including a list box element which has scrolling support built-in.

What this means for modders is that you can quickly add as many scrolling lists as you want with relative ease. This will be obvious and appreciated if you intend to expand this kit beyond what I initially offer. Because I know it'd be pretty boring to have only the default PDA style for every project.

Hopefully the custom elements are easy to use.

Oh also I replaced all the copyrighted content.

Now that the base is clean, I can eventually work on adding keyboard/joypad controls, and maybe some other QoL improvements.

Link in first post.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Jaska » Sat Apr 18, 2020 2:47 am

This is great! Works fine but for some reason inventory icon doesn't show up when I imported this to my project..
Jaska
 
Joined: 17 Dec 2019
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: PDA Starter Kit

Postby Nash » Tue May 26, 2020 6:35 am

Because apparently it's still not clear to some people, I've added that big bold part about the lack of keyboard and gamepad navigation.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Enjay » Tue May 26, 2020 7:56 am

Actually, I'm struggling to get the mouse to work fully. I have tried "enable mouse in menus" with "Yes" and "Touchscreen-like" and both show this problem.

I can use the mouse to navigate between messages (clicking the various options in the left panel) but I can't seem to make the scroll-bars move. For example, the "Jonny's Code" message contains a lot of text and a scroll bar is shown ("The Convert..." even more so). I have clicked and dragged and done everything that I can think of on the scroll bar but I cannot get it to scroll down to display the bottom part of the text. Is it me or is there something wrong?

(Freshly downloaded from the download link in the FP.)

[edit]
Hmmm... an even more problematic issue, I've just noticed that sometimes when I quit ZDoom after using the test map, mouse clicks in other programs are not always registring properly either. I'll need to dig a bit deeper to see if I can figure out exactly what the symptoms are.
[/edit]
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: PDA Starter Kit

Postby Nash » Tue May 26, 2020 8:32 am

Scrolling is currently done with the mousewheel. Sorry if I did not make it clear. Will add to OP. :)

[EDIT] it actually already was in the OP all along (the instructions about using the mousewheel). I'll move it to its own paragraph to increase its visibility.

Clicking on the scroll bars should of course be supported, eventually - either by clicking on the track to jump the position, or dragging the scrollbar on the track - something that isn't done yet, but thanks to you for bringing it to attention.

I don't get that issue with quitting - would appreciate any followups you may discover. :)
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Enjay » Tue May 26, 2020 11:45 am

Nash wrote:Scrolling is currently done with the mousewheel. Sorry if I did not make it clear. Will add to OP. :)

[EDIT] it actually already was in the OP all along (the instructions about using the mousewheel). I'll move it to its own paragraph to increase its visibility.

Doh! Yup, complete reading fail on my part. Sorry. It does indeed work with the scroll wheel. I must have done it in the past too because I have used the resource before.

Nash wrote:Clicking on the scroll bars should of course be supported, eventually - either by clicking on the track to jump the position, or dragging the scrollbar on the track - something that isn't done yet, but thanks to you for bringing it to attention.

Yes, that's what I was trying to do. If that could be added it would certainly improve things. (I guess especially if someone is playing with a mouse or other device without a scroll wheel - if those still exist (hmmm... trackpad maybe?)).

Nash wrote:I don't get that issue with quitting - would appreciate any followups you may discover. :)

I *think* it might be something to do with my mouse4 button. However, I think that it may be a bigger issue and possibly mouse specific (Logitech G300).

If I press mouse 4 while in the PDA interface it exits the PDA interface (back to the game screen) and if I then quit the game entirely, my mouse is semi-borked in Windows (as described). Pressing the additional buttons while at the desktop seems to then fix things. Mouse4 is bound to alt-fire but I unbound it entirely and exactly the same behaviour happened (including it exiting the PDA interface). So I think that, maybe, the PDA interface is using the driver binding for that button (which is "Back" in a web browser or file explorer window) to exit the PDA interface and somehow this ends up with the mouse kind of being stuck in some mode or other.

The same thing does not seem to happen with mouse5 which is bound to "forward" in the driver but pressing mouse5 at the desktop seems to be what fixes the issue and allows the mouse to work normally in Windows again.

FWiW, I didn't actually mean to press mouse4 in the PDA. It only happened when I mashed the mouse buttons to try to get the scroll to work. :lol:

Anyway, the reason that I think it may be a bigger issue is that pressing mouse4 while in a menu inside GZDoom seems to act like the Esc key (i.e.I go up one menu level). However, if I go into the main menu, press mouse4 and then immediately quit, I seem to get the same weird behaviour in Windows.

I think I'll post about this in Technical issues to see if anyone has any ideas.
[edit] viewtopic.php?f=50&t=68726 [/edit]
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Next

Return to Script Library

Who is online

Users browsing this forum: No registered users and 0 guests