Adding Simple Clickable Notes

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Adding Simple Clickable Notes

Postby JulyForToday » Thu Aug 06, 2020 8:32 pm

I'm wondering how should I go about adding simple notes (the type of thing like on Sharper's desk where you've got the note for numbers of the pressure plates in Teledahn's prison cave).

I was able to use a journal modifier with a cover image specified as a sort of poor-man's way to do this.
<cover src="note.hsm" blend=alpha>


The trouble is you can still open it like a journal. And If I didn't add any text in addition to the cover tag it caused Uru to crash.
Plus the blend attribute doesn't seem to work for covers, so the note itself looks weird anyways.

I looked at the moul scripts repository. I can't find anything besides xJournalBookGUIPopup.py and xLinkingBookGUIPopup.py that would be relevant for this.
I would imagine there would have been some kind of built in way Cyan did something so basic.
User avatar
JulyForToday
 
Posts: 118
Joined: Sat Sep 29, 2007 5:34 am

Re: Adding Simple Clickable Notes

Postby JulyForToday » Fri Aug 07, 2020 1:46 am

Seems like this is a bit more complicate to do with Plasma than I anticipated (although I should really know better by now than to be surprised when something simple is ridiculously difficult to get working with Plasma)

I came across this tutorial for adding notes (or GUI popups) with the 3ds Max plugin

The salient points are:
- A separate .prp page is needed for each note/GUI-popup you want to have.
- This separate page will contain the following: (hidden somewhere out-of-sight in the scene)
  • a fixed camera
  • a mesh/plane containing the note texture
  • a plane located behind the note to serve as clickable surface to exit the GUI popup
- You need a clickable mesh that represents the note in the scene itself. (add a nodetree where the clickable activates a python script)
- You need to use xDialogToggle.py and provide it with the name of the page your note GUI is on

After that I got stuck, since there are a few other components mentioned on that page that don't have a straight-forward mapping to Korman modifiers/nodes/python scripts. GUI ID Tag, GUI Dialog, GUI Button are all elements that I don't know what the Blender equivalents would be.

Any pointers from anyone who has gotten this sort of thing working would be welcome! :D

But oh man, wow, what a pain in the butt. :lol:
User avatar
JulyForToday
 
Posts: 118
Joined: Sat Sep 29, 2007 5:34 am

Re: Adding Simple Clickable Notes

Postby Tsar Hoikas » Fri Aug 07, 2020 8:24 am

GUI dialogs are currently not supported in Korman.
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Adding Simple Clickable Notes

Postby Semjay » Tue Aug 11, 2020 3:10 am

I came across this tutorial for adding notes (or GUI popups) with the 3ds Max plugin


This is the way I have done this and it is very boring and tedious. It took me three days to do the ones in Zahlto (and I want those days back!). But it was worth it in the end.

I suggest you have a separate file with one camera, the clickable and the GUI toggles set up and all renamed. When you merge this into your main build file the Plasma components come too and Max renames everything automatically so you can merge in as many times as you like. And that's the quickest way I have found to do it.

I also find the Journal a bit restrictive. I would like to change the way it opens and even the paper background. For Tovaht I wanted to have a clipboard where the paper folds over at the top and then I could put translations of the text in other languages on the following pages. Does anyone know how this could be done?
User avatar
Semjay
 
Posts: 60
Joined: Tue Nov 03, 2015 6:52 am
Location: UK

Re: Adding Simple Clickable Notes

Postby JulyForToday » Thu Aug 13, 2020 9:50 pm

Tsar Hoikas wrote:GUI dialogs are currently not supported in Korman.


Do you have plans to add them to Korman? Or is there something about GUI Popups that would keep Korman from being able to support such a feature?

Semjay wrote:Max renames everything automatically


Trouble is I don't have access to 3ds Max (hell, I'm not even sure if I could get the appropriate version these days). And I'd rather not forsake Blender just for something like this.

Was it possible to do this using Alscript? I never got far enough with using it to know whether it could.
It's worth asking, is it even possible to mix using Korman and PyPRP / Alscript?

What's maddening about that tutorial is that it says right at the start:
Most GUI Pop Ups have their very own prp file. There is a very good reason for this that I will show you later on. It has something to do with Python.

But then neglects to follow up and explain why. Why is it so important to have a separate PRP file? You don't need a separate PRP for journals, and they do quite a bit more.
Since that tutorial uses the Max plugin, the implication is that whenever someone at Cyan wanted to add a clickable note / picture somewhere, they had to follow that entire procedure. Yuck.
User avatar
JulyForToday
 
Posts: 118
Joined: Sat Sep 29, 2007 5:34 am

Re: Adding Simple Clickable Notes

Postby Tsar Hoikas » Sat Aug 15, 2020 5:02 pm

JulyForToday wrote:Do you have plans to add them to Korman? Or is there something about GUI Popups that would keep Korman from being able to support such a feature?

Certainly, the goal is to support everything that Uru supports across all known versions. While there is not a formal roadmap, I do try to cultivate feature requests and enhancements using milestones and labels on the GitHub Issues page. Nothing there is set in stone though.

JulyForToday wrote:Was it possible to do this using Alscript? I never got far enough with using it to know whether it could.
It's worth asking, is it even possible to mix using Korman and PyPRP / Alscript?

Yes, I know "simple" GUI popups like you're asking about were possible in AlcScript. I'm not sure how much more was supported though. Part of the holdup with GUIs in Korman is that there is some upfront design work that needs to be done to provide a good user experience and, additionally, some reworking done on a few older features.

I seem to recall that Sirius did some work with producing parts of an Age with Korman and another part with pyprp... or maybe he just edited the game files directly. Either way, you should be able to export a single PRP from pyprp and add it into the .age file produced with Korman.

JulyForToday wrote:But then neglects to follow up and explain why. Why is it so important to have a separate PRP file? You don't need a separate PRP for journals, and they do quite a bit more.
Since that tutorial uses the Max plugin, the implication is that whenever someone at Cyan wanted to add a clickable note / picture somewhere, they had to follow that entire procedure. Yuck.

Multiple GUIs can exist in the same PRP, but it's a bad idea to try that in practice. In the python API, there are functions to show and hide GUIs, but these functions take the page name, not the GUI name. Meaning that it assumes that one page is one GUI. I'm not sure what happens if you violate these assumptions, but we can probably safely assume "nothing good". Journals, OTOH, are all constructed inside the engine C++ code (with a little help from python to source the text book options) and avoid this limitation. The file containing the journal code is over 3,000 lines long :ugeek:
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Adding Simple Clickable Notes

Postby Christian Walther » Sun Aug 16, 2020 3:03 am

Tsar Hoikas wrote:Journals, OTOH, are all constructed inside the engine C++ code (with a little help from python to source the text book options) and avoid this limitation. The file containing the journal code is over 3,000 lines long :ugeek:

In other words, if these 3000 lines could be extended by a few more such that simple notes could be a special case of book rather than a special case of GUI, that would make things easier for age authors?
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: Adding Simple Clickable Notes

Postby Sirius » Sun Aug 16, 2020 4:47 am

Tsar Hoikas wrote:I seem to recall that Sirius did some work with producing parts of an Age with Korman and another part with pyprp... or maybe he just edited the game files directly. Either way, you should be able to export a single PRP from pyprp and add it into the .age file produced with Korman.

Yeah, that's it. IIRC that was back when Korman didn't support sound. I exported the visuals in the default "page" using Korman, and the audio using PyPRP in a special audio "page" (both exported in different folder so they don't clash until I put them into Uru's folder). Then I edited the .age file to tell the game to load both pages, updated the checksum, and dropped everything into Uru's data folder.
It helped that I was using my own Blender 2.7 port of PyPRP instead of the old 2.49 version, this way I could keep all the Age into a single Blender file. (On the other hand, my version of PyPRP was also lacking many features, so it probably wouldn't work for exporting GUIs in its current state. Best stick to the 2.49 version or the 3dsMax plugin.)

On a related note, I tried backporting the Yeesha Binder book type from Myst V to CC. Never got it to work, the game always showed the default book. Maybe valid book types are hardwired in an enum somewhere in the engine (didn't have the source code to check at the time)...


Semjay wrote:I also find the Journal a bit restrictive. I would like to change the way it opens and even the paper background. For Tovaht I wanted to have a clipboard where the paper folds over at the top and then I could put translations of the text in other languages on the following pages. Does anyone know how this could be done?

Paper background unfortunately cannot be changed easily (although it's possible to display an image on top of a whole page if needed - like the share page in the Relto Book). As for translations, most versions of Uru support translated journals (as long as you provide the translated text, obviously). I don't know how to do it in 3dsMax but Korman definitely has that option.


Tsar Hoikas wrote:I'm not sure what happens if you violate these assumptions, but we can probably safely assume "nothing good"

Hehe, if Cyan systematically did something, then going against this standard is a bad idea ! :)


Christian Walther wrote:if these 3000 lines could be extended by a few more such that simple notes could be a special case of book rather than a special case of GUI, that would make things easier for age authors?

They aren't exactly related, so I don't think it's a good idea. However, having a Python method/class to build a simple note without redoing an entire PRP for it sounds helpful. Most notes are simply a paper background with some text anyway.
User avatar
Sirius
 
Posts: 1506
Joined: Mon Jul 26, 2010 4:46 am
Location: France


Return to Scripting

Who is online

Users browsing this forum: No registered users and 6 guests

cron