PDA Starter Kit v1.2

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
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

PDA Starter Kit v1.2

Post by Nash »





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.

Customize your PDA by opening the "zscript/PDAConfig.zc" file. This is the ONLY file you'll need to edit - do not touch the other source files unless you know what you're doing.

NAVIGATION
- Pick up the PDA Reader (DoomEdNum 20000) and it will be added to your inventory bar. Press your "use inventory" button and the PDA menu will open. All of your collected PDAs will be shown in this menu.
- Additionally, if you have not picked up a PDA Reader yet; simply collecting any PDA pickups will automatically add the reader to your inventory.
- 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.
- You can click on a scrollbar to navigate through long texts quickly.
- You may also navigate the PDA using the keyboard or gamepad. For keyboard, press up or down to choose a PDA, and press Enter to open it. Use Page Up and Page Down to scroll through the PDA contents. For gamepads, use the D-Pad or the left analog stick to choose a PDA, button 1 to open a PDA, and the left and right bumpers to scroll through the PDA contents. Note: these controls are hardcoded into GZDoom and cannot be changed. Additionally, these buttons won't work if the mouse cursor is currently hovering over the PDA list, so be sure to move the mouse away from the screen (shouldn't be an issue for users who disable mouse navigation in the GZDoom menu).

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

CREDITS

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.

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.

2nd November 2020: v1.0 release, adds many improvements including: full keyboard/gamepad navigation, clickable scrollbars for quick navigation, UI sounds, and a separate file for easily configuring the look of the PDA interface. All known bugs fixed.

3rd November 2020: v1.1 released. Several fixes and improvements.

21st October 2021: v1.2 released. Relicensed everything to MIT, and force GZDoom 4.7.1 as that version of the engine is necessary to fix performance issues when the PDA menu is open.

LICENSE: MIT

> Download v1.2 <
> Github <

Wanna chat about my mods? Join my studio's Discord server, Mischief Donut!
Image

I spend an uncountable amount of hours making mods. Consider supporting me on Patreon for cool benefits!
Image
Last edited by Nash on Thu Sep 01, 2022 6:06 am, edited 16 times in total.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: PDA Starter Kit

Post by Enjay »

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

Are you aware of these warnings?

Code: Select all

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
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: PDA Starter Kit

Post by Nash »

Hmmm, I get no warnings. :O I'm using GZDoom 4.2.0 BTW.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: PDA Starter Kit

Post by Enjay »

Same version, but I have the developer cvar set to "2".
XLightningStormL
Posts: 384
Joined: Mon May 09, 2016 1:38 am
Location: Anywhere but here
Contact:

Re: PDA Starter Kit

Post by XLightningStormL »

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
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: PDA Starter Kit

Post by Nash »

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
Ghost Prototype
Posts: 185
Joined: Sun May 19, 2013 12:22 pm
Location: Philadelphia

Re: PDA Starter Kit

Post by Ghost Prototype »

Thanks Nash! This is something I did not know I would really need, but here we are :D
ENEMY!!!
Posts: 5
Joined: Sun Jan 08, 2017 3:27 pm

Re: PDA Starter Kit

Post by ENEMY!!! »

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!
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: PDA Starter Kit

Post by Nash »

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
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: PDA Starter Kit

Post by Nash »

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.
Jaska
Posts: 113
Joined: Tue Dec 17, 2019 5:12 am
Graphics Processor: nVidia with Vulkan support

Re: PDA Starter Kit

Post by Jaska »

This is great! Works fine but for some reason inventory icon doesn't show up when I imported this to my project..
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: PDA Starter Kit

Post by Nash »

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
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: PDA Starter Kit

Post by Enjay »

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
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: PDA Starter Kit

Post by Nash »

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
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: PDA Starter Kit

Post by Enjay »

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]
Post Reply

Return to “Script Library”