Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Nicant on January 14, 2016, 06:49:06 PM

Title: Need help with Set Text [SOLVED]
Post by: Nicant on January 14, 2016, 06:49:06 PM
How can you make it so that you can use Set Text to display a number that changes? Ex: I want to display a number, and the number keeps changing (being added or subtracted) and i want the number to be displayed to change when it changes. Hope this makes sense and any help will be appreciated! (and credited :) )
Title: Re: Need help with Set Text
Post by: Lost in Nowhere on January 14, 2016, 08:03:59 PM
Whenever you use SetText, it just overwrites what was previously there, so repeatedly changing the text will allow you to show a changing value.
Title: Re: Need help with Set Text
Post by: Nicant on January 14, 2016, 09:20:44 PM
Quote from: Lost in Nowhere on January 14, 2016, 08:03:59 PM
Whenever you use SetText, it just overwrites what was previously there, so repeatedly changing the text will allow you to show a changing value.
What i mean is how can i have it show a number from an input variable. Here's a picture on what happens. (This may or may not be the creep forge ;) )
Title: Re: Need help with Set Text
Post by: Grayzzur on January 15, 2016, 01:45:41 AM
use Concat to get all your static and dynamic bits into a single string value, and feed that into SetText

You didn't provide the code you used for your sample picture there, but let me take a guess:
Change:
"<-CreepRift" SetText
To:
<-CreepRift SetText
Title: Re: Need help with Set Text
Post by: GameGibu on January 15, 2016, 09:28:40 AM

once
"
" ->newline
endonce
"ImportantVarName: " <-ImportantVarName concat <-newline concat "SecondImportantVarName: " concat <-SecondImportantVarName concat #and so on until
"FinalVarName: " concat <-FinalVarName concat SetText


Maybe that helps?
-GameGibu
Title: Re: Need help with Set Text
Post by: Nicant on January 15, 2016, 09:54:04 AM
Quote from: Grayzzur on January 15, 2016, 01:45:41 AM
use Concat to get all your static and dynamic bits into a single string value, and feed that into SetText

You didn't provide the code you used for your sample picture there, but let me take a guess:
Change:
"<-CreepRift" SetText
To:
<-CreepRift SetText
Thank you for helping and it works BTW! You will be credited on the sleeper map!

Quote from: GameGibu on January 15, 2016, 09:28:40 AM

once
"
" ->newline
endonce
"ImportantVarName: " <-ImportantVarName concat <-newline concat "SecondImportantVarName: " concat <-SecondImportantVarName concat #and so on until
"FinalVarName: " concat <-FinalVarName concat SetText


Maybe that helps?
-GameGibu
Thank you GameGibu for helping, but the other code is less complex and simple. Thank you for trying though! :) :) :)