+Rusty O Junk Posted May 17, 2008 Share Posted May 17, 2008 Is there a way to display the value of a variable to the player in a message? I want to initialize a numeric variable and give it a value. After cretin events the value will change and I want to show a message to the player which will give them the updated value of the variable. Quote Link to comment
+qlenfg Posted May 17, 2008 Share Posted May 17, 2008 Display a message, and make the text like this: [[it took you ]]..variable_name..[[ minutes to get here.]] Quote Link to comment
Ranger Fox Posted May 17, 2008 Share Posted May 17, 2008 Remember that the builder may not like the above edit. If you're through with the section of code that will display the message box, I suggest opening the code itself and moving that function to the Author Functions section so the builder won't touch it. Quote Link to comment
+twolpert Posted May 17, 2008 Share Posted May 17, 2008 Actually, I'm pretty sure the builder will accept this. Haven't tried it in a while, but I remember being surprised by the fact that it worked. Quote Link to comment
+Rusty O Junk Posted May 18, 2008 Author Share Posted May 18, 2008 Display a message, and make the text like this: [[it took you ]]..variable_name..[[ minutes to get here.]] I tried that and it wouldn't compile. Ranger Fox, I don't understand what you are saying. Open the code in what and how do I move it to and where is the Author Functions? In the Wherigo tutorial wherigo_player_tut the player names the alien. Later the Wherigo cartridge shows the player some text using the name you just gave your alien. This is pretty much what I want to do only I want to show the player the numerical value of the variable every time it changes through the players actions. The source code for the tutorial is locked so I can't see how that was done. Quote Link to comment
Ranger Fox Posted May 18, 2008 Share Posted May 18, 2008 I tried that and it wouldn't compile. Did you use the correct variable name? Are you using an updated version of the builder? Ranger Fox, I don't understand what you are saying. Open the code in what and how do I move it to and where is the Author Functions? The .lua file you see is a simple text file. You can open it with any text editor. Double-click on it and Windows will ask what program it should use to open the file. Choose notepad and you can see the code. The builder application you're using creates this file for you. In the Wherigo tutorial wherigo_player_tut the player names the alien. Later the Wherigo cartridge shows the player some text using the name you just gave your alien. This is pretty much what I want to do only I want to show the player the numerical value of the variable every time it changes through the players actions. The source code for the tutorial is locked so I can't see how that was done. You'll have to edit the code yourself for that. You can make everything in the builder up to the point where you need to insert the alien's name (using the example). Here's some quick steps. I can't go into too much detail at the moment because it's past 2:30 AM and I need to sleep before I get up for church in the morning. -- Create a variable. Since you're not letting the user type the value, this can be a number. -- Since I'm using an input to determine how I should change the variable (I'm calling it "runningcount"), I created a second variable to store the user's input. -- Right your code changes the value, add a message. Type everything else but the number. -- Save your code and open it in notepad. -- Do a search for what you just typed and edit the line. I included a quick example. Enter the zone and answer the question. The variable will increment depending on the answer provided. If you have any more questions, please post them to the thread and someone will provide you with an answer. rusty.zip Quote Link to comment
+qlenfg Posted May 19, 2008 Share Posted May 19, 2008 I've got the latest builder and the example I gave was one I was using to display a timer value when the player reached the zone. The timer tick is every second and it updates this variable, which is displayed later. Quote Link to comment
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.
Note: Your post will require moderator approval before it will be visible.