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

    • 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
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
    • The Black Arrow

      Hope everyone has the blessing of undying motivation for "The Dark Mod 15th Anniversary Contest". Can't wait to see the many magnificent missions you all may have planned. Good luck, with an Ace!
      · 0 replies
×
×
  • Create New...