Jump to content


Photo

Custom mission loading text


8 replies to this topic

#1 dmw88

dmw88

    Member

  • Member
  • PipPip
  • 83 posts

Posted 03 February 2019 - 02:33 PM

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!



#2 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5823 posts

Posted 04 February 2019 - 03:38 AM

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

 

http://wiki.thedarkm...ing_Screen_Text

http://wiki.thedarkm...n_while_Loading


  • Judith likes this
FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#3 dmw88

dmw88

    Member

  • Member
  • PipPip
  • 83 posts

Posted 04 February 2019 - 05:24 AM

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, 04 February 2019 - 05:25 AM.


#4 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37755 posts

Posted 04 February 2019 - 03:26 PM

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.


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#5 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5823 posts

Posted 04 February 2019 - 05:03 PM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#6 dmw88

dmw88

    Member

  • Member
  • PipPip
  • 83 posts

Posted 07 February 2019 - 06:35 PM

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.

#7 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 821 posts

Posted 07 February 2019 - 06:42 PM

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, 07 February 2019 - 06:44 PM.


#8 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5823 posts

Posted 08 February 2019 - 02:57 AM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#9 dmw88

dmw88

    Member

  • Member
  • PipPip
  • 83 posts

Posted 11 February 2019 - 04:29 PM

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...



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users