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. 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.

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.

Future to do:
- Add keyboard/gamepad controls
- Add ability to click on a scrollbar to jump to a specific position

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 Mar 13, 2020 6:23 am, edited 1 time 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
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


Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest