PDA Starter Kit

Post your example zscripts/ACS scripts/etc here.

Re: PDA Starter Kit

Postby Enjay » Thu Jun 04, 2020 7:17 am

I've been working with the starter kit and have managed to tailor things to (more or less) what I want to achieve. The easily approachable stuff (like my own graphics, the text in the dialogues etc is easy to work with and, therefore, the starter kit does pretty much what I would expect it to do: allow me to set up my own PDA system with all of the hard work already done for me (by you Nash - thank you :) ).

However, there are a couple of things that are beyond me.
1)
I managed to find in the code where the sizes of the PDA item list and contents boxes are defined and, after a bit of head-scratching, I figured out how to tweak them slightly. However, I noticed that the scroll bars are drawn inside the text area and, therefore, occasionally can end up drawn over that trailing edge of a character or anything else that appears in the far-right of the box. I tried changing the values to what I think was trying to drawn them outside the text area* but, at that point, they simply didn't show up. I'm guessing either that my changes invalidated the bars or that that they need to be drawn inside the text area to be visible. So this "problem" is probably unavoidable but I just wanted to check.

*I tried changing formulae that had -SCROLLBAR_WIDTH to +SCROLLBAR_WIDTH and I also tried setting SCROLLBAR_WIDTH to a -ve value.

For what it's worth, my "solution" to minimise the problem was to make the scroll bars thinner. Given that they can't be grabbed by a mouse click anyway (or at least not yet) they are purely visual - indicative that there is something to be scrolled (and that's cool) - but they don't need to be wide. Making them thinner means they are less likely to be drawn over something else and, actually, I only reduced them to 2 pixels (instead of their original 4) so they will be easy enough to grab at that width if it ever becomes possible to do it anyway.

Of course, the scroll bars can be made really wide too to exaggerate the effect for testing purposes.


2)
This is one where I have no idea how to approach it but, is it possible to have some way of indicating which items have been read and which have not? (e.g. the message name changing colour or getting a tick mark or something in the items list) I really like that the items get sorted alphabetically. If I have collected a few notes around the map, it makes it nice and easy to search for the note that I want (provided that I can remember it's name - and most of my notes are people's names, so that's easy)). I certainly wouldn't want to change the alphabetic sorting but it does mean that newly collected items are not at the top of the list. So it can be hard to spot unread items once you've collected a few without reading them all.


If neither of these things are currently possible (or easily doable by an end-user klutz like me), any chance they can be added to your to-do list if you ever get the chance to work on this again?

I fully appreciate that you are very busy and this is by no means a demand; just a gentle ask. :)

What things look like so far
Spoiler:
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 » Thu Jun 04, 2020 8:10 am

That looks beautiful! About the text spilling on top of the scrollbar - ah, I hadn't considered that - seems like this thing really depends on the kind of font used. I'll see if I can get the text to wrap text lines depending on the font's horizontal size. And I'll look into adding a read/unread system too - that one IMO is generic enough that it should fit right into the base kit.

I love seeing what people do with this stuff. :D
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Enjay » Thu Jun 04, 2020 8:44 am

Nash wrote:About the text spilling on top of the scrollbar - ah, I hadn't considered that - seems like this thing really depends on the kind of font used.

It's actually that the scroll bar ends up on top of the text, but, yeah, they both try to occupy the same position and one is always going to lose in that situation.

The font does make a difference to how likely it is to happen. In my screenshot, it's using a SMALLFONT alternative with a hi-res replacement. The font that you provided with the kit shows the problem less readily but it does show it - especially if I widen the bars just for the sake of testing.

It's not a huge issue. Nothing has been obscured to the point that it becomes even close to unreadable. It just doesn't look as tidy as perhaps it could.

A read/unread system would be very cool if you can pull it off.

Glad you like what I've done with it so far. I'm still experimenting with it but, as I said, with you having take all of the hard work out of it, the kit is very approachable for anyone happy with messing with the usual modding stuff: graphics, sounds and simple text files. I really hope that others take this up and start producing things with it too. There are so many possibilities for it and it works brilliantly.
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 DoomwithaView » Tue Jun 16, 2020 3:57 pm

Hi, I wanted to second Enjay's sentiments on this. It's brilliant and makes light work of including discoverable snippets of lore. It's approachable enough to make changes to appearance (Enjay's looks great), but as heavily as I swore, I couldn't implement a 'marked as read' solution myself.
Cheers for the work Nash, my mod is fast becoming a collection of your contributions.
DoomwithaView
 
Joined: 12 Nov 2019

Re: PDA Starter Kit

Postby Nash » Fri Jul 10, 2020 11:07 pm

Added read/unread support. I totally underestimated the work it needed. :D

Right now, all that's available is colour variations for the list of owned PDAs (there are now two new colours you can define in the menu class, right at the top). I may add support for a custom graphic (like at tick mark or something like that) in future; I've added it to the list of issues so that I won't forget.

Currently it's only available from the Github repo, I am not making an official release yet because I'd like to implement scrollbar clicking - as well as fixing the text wrapping bug - before declaring the next release ready-to-use. But if you want to update your project for the read/unread feature, it should be safe to do so.

I had to rename a file for better organization, see this commit for details. Keep this in mind when updating (ie you might need to do some manual work to merge my stuff in, if you had localized changes on your end). This is the last instance I will be doing this, moving forward I will be more careful to not do any renaming anymore.

@DoomwithaView - thank you, and I'm glad my tinkerings bring you joy. :D

Stealth edit: Fixed the issue with the text spilling over the scrollbars.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Enjay » Sat Jul 11, 2020 8:57 am

Amazing Nash - as ever. The read/unread colour thing works wonderfully. :)

Quick question: I have looked in PDAMenu.zc and I can see where to change the colour values. However, I'm having difficulty changing them to a colour that is not already defined in the engine.

For example, this is the original default:
Code: Select allExpand view
pdaListUnreadColor = Font.CR_LightBlue;

I can change it to:
Code: Select allExpand view
pdaListUnreadColor = Font.CR_Orange;

and it works (so I know that other built-in colours work), but if I try to change it to:
Code: Select allExpand view
pdaListUnreadColor = Font.NJMOrange;

or
Code: Select allExpand view
pdaListUnreadColor = NJMOrange;

where NJMOrange is a colour that I have defined in textcolors.txt, and which works elsewhere, I can't get it to work:
Code: Select allExpand view
NJMorange is not a member of Font

or
Code: Select allExpand view
Unknown identifier 'NJMorange'

respectively.

I'm assuming that I've messed up, but any idea what I've done wrong? (It's not that important, the built-in colours will do fine if this isn't something that can't be fixed.)
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 Enjay » Sat Jul 11, 2020 10:18 am

A couple of additional minor points:

If the colour of the text for the menu entry is set in the language lump - e.g.
Code: Select allExpand view
PDA_TestPDA_Title = "\cDJonny's Code";

This overrides the read/unread behaviour and (in this case) the text stays green regardless of whether the message has been read or not. I don't suppose that's really a problem because the colour is deliberately being over-ridden, but it's something for a modder to be aware of.

However, this did get me thinking - a nice extension to this would be if the pdaListUnreadColor and pdaListReadColor could be used as actor properties in the DECORATE for the individual message pickups. Why? because then a modder could perhaps colour-code messages from different types of sources (e.g. enemies red, allies green etc). It's a far from essential suggestion - the thought just came to me as I was messing around with stuff.
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 » Sat Jul 11, 2020 6:09 pm

Hey Enjay, I'm a bit short on time right now but I can answer your custom font colour problem:

You'll have to use the following to get custom colours recognized

Code: Select allExpand view
pdaListUnreadColor = Font.FindFontColor('NJMOrange');


(yeeecchhh @ the american spelling of "colour" ;))

I'll respond to the other stuff a little later!
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Enjay » Sat Jul 11, 2020 6:47 pm

Works perfectly, thank you. :)

[edit]And I just wanted to acknowledge how much better having a read/unread system is. It is now so much easier for a player to keep tabs on what they've read - a huge improvement. It's basically there already, but if you can get the scroll bar clicking in as well, this will be a real pro-level API for modders. It's brilliant![/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 Hidden Hands » Sun Oct 04, 2020 3:46 pm

Nash . YOU ROCK. I'm going g to implement this to my game now. But if I have any issues I'll ask for help here.
Last edited by Blue Shadow on Sun Oct 04, 2020 3:54 pm, edited 1 time in total.
Reason: You didn't need to quote the opening post.
User avatar
Hidden Hands
Deadite
 
Joined: 21 Sep 2016
Location: London, England

Re: PDA Starter Kit

Postby Hidden Hands » Sun Oct 04, 2020 9:29 pm

I'm having trouble. I put everything in the required locations but the game wouldn't boot up. Instead I get this: (See attachment)

I did change version from 4 to 3 but other than that I cant understand why I can never get these great things to work
You do not have the required permissions to view the files attached to this post.
User avatar
Hidden Hands
Deadite
 
Joined: 21 Sep 2016
Location: London, England

Re: PDA Starter Kit

Postby Nash » Mon Oct 05, 2020 12:53 am

Hidden Hands, what version of GZDoom are you using? It looks like it's too old to support Shape2D and A_StartSound, which are very new GZDoom features.

Additionally, please don't arbitrarily change the version numbers. They are a hard requirement for a very good reason - they are in place because of non-negotiable usage of specific GZDoom engine features.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Hidden Hands » Mon Oct 05, 2020 6:31 am

Nash wrote:Hidden Hands, what version of GZDoom are you using? It looks like it's too old to support Shape2D and A_StartSound, which are very new GZDoom features.

Additionally, please don't arbitrarily change the version numbers. They are a hard requirement for a very good reason - they are in place because of non-negotiable usage of specific GZDoom engine features.


Ahh I see. Thanks Nash I didnt realize that. I actually thought the numbers were just to tell the code what engine was being used. I've changed it back. Where can I get the correct version of GZDoom to use? Is it the latest build? I'm currently on 3.3
User avatar
Hidden Hands
Deadite
 
Joined: 21 Sep 2016
Location: London, England

Re: PDA Starter Kit

Postby Nash » Mon Oct 05, 2020 7:15 am

The latest official version will always be available from here: https://zdoom.org/downloads
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: PDA Starter Kit

Postby Hidden Hands » Mon Oct 05, 2020 11:33 am

Nash wrote:The latest official version will always be available from here: https://zdoom.org/downloads

Thanks a ton Nash. Heres hoping it all goes smooth now! I think this PDA will be an amazing addition to Horrifying, I've been looking for a good note reader for the engine for ages.

This GZDoom download is 4.4.2 should it be ok with that one?
User avatar
Hidden Hands
Deadite
 
Joined: 21 Sep 2016
Location: London, England

PreviousNext

Return to Script Library

Who is online

Users browsing this forum: No registered users and 0 guests