Question about variables...

Post » Fri Mar 19, 2010 1:07 am

Is there any way to directly display a variable to the player? Without making a specific message for each number the variable could possibly be? Like if I have a timer thats counting down from 2 minutes, and want it to show a message in the corner or somewhere for every second, would I have to make 120 messages? One showing 2:00, one for 1:59, 1:58, ect. Or could I simply somehow put the variable for seconds remaining into it? So it would say 120 seconds left, 119, 118, and so forth. I figure this is impossible since variables would'nt run in a message, but can it be done somehow?

Gunmaster95
User avatar
Victoria Bartel
 
Posts: 3325
Joined: Tue Apr 10, 2007 10:20 am

Post » Thu Mar 18, 2010 9:38 pm

Values/variables do display in messageboxes. They don't show in tutorialmenu but they do in messageboxes. Check the geck wiki and also look through Bethesda's messages to see what the code for variables looks like.
User avatar
Logan Greenwood
 
Posts: 3416
Joined: Mon Jul 30, 2007 5:41 pm

Post » Thu Mar 18, 2010 6:20 pm

Oh they do? So I could run a script that... every second adds one to the variable in a SINGLE message, and every second at the same time do a showmessage of the SAME message every time, and it would count up by one each time with just a simple script and one message?

I will poke about and see what I can figure out.
User avatar
Cameron Wood
 
Posts: 3384
Joined: Wed Oct 31, 2007 3:01 pm

Post » Fri Mar 19, 2010 12:58 am

Message:
%.0f:%.0f

Have two variables, myMin and mySec.

Show the message:
ShowMessage myTimerMessage myMin mySec

User avatar
Jack Bryan
 
Posts: 3449
Joined: Wed May 16, 2007 2:31 am

Post » Fri Mar 19, 2010 2:29 am

Message:
%.0f:%.0f

Have two variables, myMin and mySec.

Show the message:
ShowMessage myTimerMessage myMin mySec

Ok... thats confusing me a bit -_-

I get its like X:XX and wha the two variables are doing. But would I control them through a script on another object like any other, and can you explain the %.0f and what the means. I only yesturday even learned what % does. Sorry, I'm just new to more complicated scripting with more variables than like one or two simple ones.
User avatar
jessica sonny
 
Posts: 3531
Joined: Thu Nov 02, 2006 6:27 pm

Post » Thu Mar 18, 2010 4:06 pm

http://geck.gamesas.com/index.php/ShowMessage

Had this bookmarked, might help: http://www.gamesas.com/bgsforums/index.php?showtopic=1047313&hl=
User avatar
Mike Plumley
 
Posts: 3392
Joined: Wed Sep 05, 2007 10:45 pm

Post » Fri Mar 19, 2010 4:45 am

Yea, I have made timers before, I just didn't understand the whole %.0f and such, but I now notice it on the message page of the Wiki, so I somewhat understand it now.
User avatar
Mandi Norton
 
Posts: 3451
Joined: Tue Jan 30, 2007 2:43 pm

Post » Fri Mar 19, 2010 12:19 am

Ok, I think I understand how to do this. But I have an additional question. Would it be best to do it by the second, or could I possibly use the other thing to make it show 100th's of a second too, and would there be a way to have one message updating the variable every frame without telling it to do ShowMesage like 30 times a second. Like just constantly have the message up, or would it update the message's variable even if it is already showing it? Or is this too complicated and should I just have it show every 1 second?
User avatar
Kelly Tomlinson
 
Posts: 3503
Joined: Sat Jul 08, 2006 11:57 pm

Post » Thu Mar 18, 2010 9:01 pm

Ok, I think I understand how to do this. But I have an additional question. Would it be best to do it by the second, or could I possibly use the other thing to make it show 100th's of a second too, and would there be a way to have one message updating the variable every frame without telling it to do ShowMesage like 30 times a second. Like just constantly have the message up, or would it update the message's variable even if it is already showing it? Or is this too complicated and should I just have it show every 1 second?


I've never tried displaying a message with less than a second on the delay. I have no idea if it will accept a fraction of a second. But you couold try it with 0.1 and see if it works. Otherwise you will most likely be stuck with a minimum of 1 second updates. But, do you really need to be more precise than that while in game? If you need the values for testing you could always use printc and that can show fractions.
User avatar
Kat Lehmann
 
Posts: 3409
Joined: Tue Jun 27, 2006 6:24 am

Post » Fri Mar 19, 2010 4:44 am

I agree with pkleiss here, I don't think you can get under a second with standard messaging - any less than that and the player would not be able to read it (with any normal message), and as such would be something to avoid.
User avatar
Nadia Nad
 
Posts: 3391
Joined: Thu Aug 31, 2006 3:17 pm

Post » Thu Mar 18, 2010 3:44 pm

Sounds alien to me. The messages that you do not have to click Okay on do not display instantly, they fade in, and if you call them too fast, they kinda queue up. Once a second sounds too fast. I think it would be a cluster [censored].
User avatar
Luis Reyma
 
Posts: 3361
Joined: Fri Nov 02, 2007 11:10 am

Post » Fri Mar 19, 2010 1:14 am

Alright, I just figured that would look better. I'll just stick with trying to update once every second. Thanks guys.
User avatar
Nick Swan
 
Posts: 3511
Joined: Sat Dec 01, 2007 1:34 pm

Post » Fri Mar 19, 2010 1:27 am

In my mod, where you have so many seconds to get away from the blast zone when you blow up the boulders at the entrance, I only display the last 3 seconds in a message at the top of the screen. I also only perform the 'ShowMessage' once for each second, since I have a internal timer controlling when the message displays and when the explosion occurs.
I did it this way for the same resons noted above, how the messages are not 'exactly' a second. So, at 3.3 seconds out, I display the '3 second' message. At 2.2 seconds out, I display the '2 second' message. At 1.1 seconds out, I display the '1 second' message. And then Boom!.

For a two minute timers, you might consider displaying every 5 or 10 seconds until the last seconds are near.
User avatar
Lew.p
 
Posts: 3430
Joined: Thu Jun 07, 2007 5:31 pm

Post » Fri Mar 19, 2010 2:17 am

Yea I guess that might work. maybe updating every 15 seconds till 1 min, then 10, till 30 seconds, then 5 till 5, then one or something.
User avatar
IM NOT EASY
 
Posts: 3419
Joined: Mon Aug 13, 2007 10:48 pm


Return to Fallout 3