Can I display named variables in a messagebox?

Post » Mon May 02, 2011 3:02 am

OK I know how to display number variables like printC "fBloodCraving is %.2f" fBloodCraving displays my variable fBloodCraving number. But can you do words? I know you can set a named variable to a new name... but how do you display it? What is the syntax for displaying a named variable?

I am making a vampire advancement system that uses how long you have been a vampire as variable 1, and how many times you have fed as variable 2. this will be used to create a two word vampire rank with the first word their age and the second word their feed count. So they could be a fledgling bloodsvcker or fledgling leech, or fledgling nightstalker if they are age 1 and feed count 1 2 or 3, etc. If they are age 2, then they would be a young bloodscuker, leech or nightstalker. At age 3 they could be a mature bloodsvcker, mature leech, or mature nightstalker, etc.
User avatar
kasia
 
Posts: 3427
Joined: Sun Jun 18, 2006 10:46 pm

Post » Sun May 01, 2011 2:08 pm

Seems like http://cs.elderscrolls.com/constwiki/index.php/MessageBoxEx is what you're looking for.
User avatar
hannaH
 
Posts: 3513
Joined: Tue Aug 15, 2006 4:50 am

Post » Mon May 02, 2011 4:49 am

Welcome to the wonderful world of OBSE :)

Here's a very general way of doing it. Just written down fast, without any testing, so no guarantees.

array_var time_namearray_var feed_nameshort vamp_timeshort feed_timestring_var full_nameBegin GameMode	If GetGameLoaded		let time_name := ar_Construct Array		let time_name[0] := "fledgling"		let time_name[1] := "young"		let time_name[2] := "mature"		let feed_name := ar_Construct Array		let feed_name[0] := "bloodsvcker"		let feed_name[1] := "leech"		let feed_name[2] := "nightstalker"	endif	...; vamp_time and feed_time must be in the range 0-2	let full_name := time_name[vamp_time] + " " + feed_name[feed_time]	MessageBoxEx "You are now a %z", full_nameEnd

User avatar
Erin S
 
Posts: 3416
Joined: Sat Jul 29, 2006 2:06 pm

Post » Sun May 01, 2011 8:33 pm

Seems like http://cs.elderscrolls.com/constwiki/index.php/MessageBoxEx is what you're looking for.

Looks a little easier than the below option?

Welcome to the wonderful world of OBSE :)

Here's a very general way of doing it. Just written down fast, without any testing, so no guarantees.

array_var time_namearray_var feed_nameshort vamp_timeshort feed_timestring_var full_nameBegin GameMode	If GetGameLoaded		let time_name := ar_Construct Array		let time_name[0] := "fledgling"		let time_name[1] := "young"		let time_name[2] := "mature"		let feed_name := ar_Construct Array		let feed_name[0] := "bloodsvcker"		let feed_name[1] := "leech"		let feed_name[2] := "nightstalker"	endif	...; vamp_time and feed_time must be in the range 0-2	let full_name := time_name[vamp_time] + " " + feed_name[feed_time]	MessageBoxEx "You are now a %z", full_nameEnd

I've never seen a "let" command. Did you mean set?

EDIT: Its definitely not the first one, that only works with real references. I just need to store a string name into a variable, so I'll explore this second option for a bit.
User avatar
adame
 
Posts: 3454
Joined: Wed Aug 29, 2007 2:57 am

Post » Sun May 01, 2011 1:48 pm

W00t! I got it! Your code worked perfect! A million thanks!
User avatar
Mr.Broom30
 
Posts: 3433
Joined: Thu Nov 08, 2007 2:05 pm


Return to IV - Oblivion