dmw88 24 Posted February 3, 2019 Report Share Posted February 3, 2019 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! Quote Link to post Share on other sites
Obsttorte 1508 Posted February 4, 2019 Report Share Posted February 4, 2019 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_Texthttp://wiki.thedarkmod.com/index.php?title=Mission_Title_Screen_while_Loading 1 Quote 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 post Share on other sites
dmw88 24 Posted February 4, 2019 Author Report Share Posted February 4, 2019 (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 February 4, 2019 by dmw88 Quote Link to post Share on other sites
Springheel 4645 Posted February 4, 2019 Report Share Posted February 4, 2019 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. Quote 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 Link to post Share on other sites
Obsttorte 1508 Posted February 4, 2019 Report Share Posted February 4, 2019 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. Quote 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 post Share on other sites
dmw88 24 Posted February 7, 2019 Author Report Share Posted February 7, 2019 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. Quote Link to post Share on other sites
HMart 334 Posted February 7, 2019 Report Share Posted February 7, 2019 (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 February 7, 2019 by HMart Quote Link to post Share on other sites
Obsttorte 1508 Posted February 8, 2019 Report Share Posted February 8, 2019 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. Quote 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 post Share on other sites
dmw88 24 Posted February 11, 2019 Author Report Share Posted February 11, 2019 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... Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.