Jump to content
The Dark Mod Forums

Gui displaying different sections of xdata file


datiswous

Recommended Posts

I don't understand the question.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                                                                                  A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

Ok so the original reason I came up with this question is that I was looking at Sotha's Button Controlled Animated Briefing

To make that work, you have to edit a gui file and put the text blocks in it. Wouldn't it be easier if you can use text from xdata instead? Then the gui file is just for the looks and operation, like a template that you snap onto your mission, while you create the text in the xdata file. I wondered if that's possible. The normal text based briefing also uses a gui (obviously), which then includes the xdata file.

At that point I was thinking of a broader aproach for other gui's, but I probably should've keep it simple.

Edited by datiswous
Link to comment
Share on other sites

The text based briefing uses one xdata "section" consisting of multiple pages, which you scroll through while reading the briefing. But whould it be possible to make a gui with text only from page one of the briefing text from xdata and then make somewhere else in the same gui text from page 2 of the briefing text from xdata.

 

I wasn't asking for a whole tutorial. Just wanted to know if it's technically possible.

Edited by datiswous
Link to comment
Share on other sites

It might be possible, but the thing to realise is that for readables the text that is displayed in the readable's gui is set by the script tdm_readables.script. This, amongst other things. extracts each page from the xdata item and sets the corresponding items in the gui.

The briefing text is similar but in this case the xdata item is read by the C++ code which then sets the BriefingText item.

In other words, guis know nothing about xdata.

  • Like 1
Link to comment
Share on other sites

Hm, looking at the mainmenu_briefing.gui file it might actually be possible to make a gui with navigation buttons, make the navigation buttons move to a new page with possible graphics, but also list the second page of the xdata file. Because it does this:

windowDef scrollDown
	{
		rect		292,390,57,27
		background	"guis/assets/briefing/nextpage"
		visible		("gui::ScrollDownVisible" == 1)

		onMouseEnter
		{
			set "cmd" "play sound/meta/menu/mnu_hover;";
		}

		onAction
		{
			// Send the request to the script
			set "cmd" "play sound/meta/menu/mnu_select; briefing_scroll_down_request";
		}
	}

So you remove the scrolldown button and when you do the next page action, you activate:

set "cmd" "play sound/meta/menu/mnu_select; briefing_scroll_down_request";

 

Edit: Actually you can also keep the normal navigation but include graphics, etc. and when you do the scroll down action, you can change the page, add new graphics, etc. and also move to the next xdata page. I think.

But it doesn't seem like you can specify a certain xdata page.

Edited by datiswous
Link to comment
Share on other sites

It's at least interesting (to me) to think of possibilities of a different briefing gui. Currently there is a.f.a.I.k.:

  1. A text based briefing
  2. A briefing with navigation slides, or auto-slides all specified in a gui file.
  3. an mp4 movie (which still might include slides)

 

Maybe it could be useful for some to have the option of:

A text based briefing of x page(s) with a background image for every page.

Edited by datiswous
Link to comment
Share on other sites

On 9/29/2023 at 8:42 PM, datiswous said:

But it doesn't seem like you can specify a certain xdata page.

I think this is the crux of the problem in that there's no linkage from a .gui to an xdata item. What you need to be able to do is call a script from inside the gui and the script will read the xdata and populate the gui variables.

Now theoretically there is a "runScript" command that is callable from inside guis but it doesn't currently seem to work in TDM. There's actually a feature request, 6164, to fix this. Maybe we should agitate to get this fixed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taaaki

      Apologies for the unplanned downtime. A routine upgrade did not go to plan, and the rollback had its own issues
      · 2 replies
    • freyk

      Got tdm 2.12 running on my android phone. For more info, read the latest post in the topic on subforum techsupport.
      · 2 replies
    • snatcher

      TDM Modpack v4.5 released!
      Introducing... The Loop
      · 1 reply
    • Ansome

      Taking a break to alleviate burnout. In retrospect, I probably shouldn't have jumped into a map-making contest so quickly after just finishing another project and especially with my busy schedule, but I do believe I have something that the community will enjoy. No clue if I'll be able to finish it on time for the competition if I factor in a break, but I'd rather take my time and deliver something of quality rather than engage in development crunch or lose part of the map's soul to burnout.
      · 1 reply
    • Skaruts

      Working on an update for my mission By The Cookbook. If anyone that played it has any further bugs to report, please let me know.
      I posted more details about the update in the mission thread.
      · 1 reply
×
×
  • Create New...