Jump to content
The Dark Mod Forums

Recommended Posts

Posted

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!

Posted

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

Posted (edited)

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
Posted

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.

Posted

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

Posted

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.

Posted (edited)

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
Posted

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

Posted

What I ended up doing is adding the word 'gold' to the background image and aligning the reward value to the right so the spacing works. Unfortunately it might be all for nought, since tdm crashes when I try to dmap the FM...

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

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
×
×
  • Create New...