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

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 5 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...