Jump to content
The Dark Mod Forums

Custom mission loading text


dmw88

Recommended Posts

I'm trying to show text that changes as a mission loads. Say for example I was trying to display the percent progress loading the map - what would I list as the 'text' field in the .gui file? My assumption was that I would have a line reading ("gui::map_loading" * 100) + "%", with the + for concatenating the number and string. However this doesn't work. What is the correct way to approach this? If t is not possible to concat the two, is it possible to just display the number?

Thanks!

Link to comment
Share on other sites

The "correct way to approach this" is to checkout the wiki, that's what it was designed for ;)

 

http://wiki.thedarkmod.com/index.php?title=Loading_Screen_Text

http://wiki.thedarkmod.com/index.php?title=Mission_Title_Screen_while_Loading

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Thanks for the links, I had read through the second prior to posting (I didn't see the second, if it is not linked in the first it might be useful to do so), as I usually try to find what I can on the wiki before posting. Unfortunately, neither page has info on actually displaying (a function of) the value of "gui::mission_loading" as part of a text field, which is what I am trying to do.

Edited by dmw88
Link to comment
Share on other sites

I can't remember how to do it anymore, but I set up the loading screen of The Builder's Influence to display different images as the mission loaded. I did the same for the Training Mission. You could try looking at them.

Link to comment
Share on other sites

My assumption was that I would have a line reading ("gui::map_loading" * 100) + "%", with the + for concatenating the number and string.

I don't think that the gui interpreter automatically converts file types. So, although I haven't tested it, I would assume the right syntax to be

(scrap that, doesn't work)

In addition I am not sure whether concatenation is supported, so you probably have to use two windows here.

 

EDIT: After some testing and additional google-search I am quiet sure concatenation isn't supported. So you have to use two windows.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

I am thinking I should use an if tree updating every 10% as it loads, based on the example on the wiki. What Im actually doinf is using a Wanted poster, with the bounty going up as it loads, so I would have it increase by increments of 100 gold, up to 1000 when it has loaded fully. My only question then is where the definition they show goes in the grander scheme of the .gui file - inside the outer set of brackets or outside? It might be useful to show the markup snippet in context on the wiki page.

Link to comment
Share on other sites

In c++ is very easy, just use "const char * text = va("someText %i", somevalue)" in script is not so easy (because there's no script function defined for it) but to change a text or a number ( numbers in guis are really just strings ) on a gui, in real time and using script, you need to use gui variables of value "gui::someparm#", (# is a numeric value) then on script do something like:

 

btw guis using script are accessed through the entity that hold them and the load gui is really not attached to any entity (I think) but managed though c++, so this could not work at all.

 

To "concatenate" numbers to strings in guis you really need two windowdef's in the gui, one for the text another for the number.

 

- pseudo script code -

 

float value;

string someText;

 

value = 10;

someText = "Map load percentage ";

 

then do:

 

$my_entity.setGuiParm("someparm0", someText);

$my_entity.setGuiFloat("someparm1", value);

hope this helps.

Edited by HMart
Link to comment
Share on other sites

The problem here is that the gui doesn't support any way to merge two strings together. So if you want to combine two strings, like dmw is, you can only go the way of using two window definition, each containing and displaying one of the strings, at least for guis like the mission loading gui.

 

Once you are in game, you can use a script to combine several strings together.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

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

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...