Creating books on the fly?

Post » Sat Feb 19, 2011 2:29 am

I was looking around in the OBSE command documentation trying to find something that would enable me to take a string of text and put it in a note/letter/scroll/book and then spawn it into the gameworld. I couldn't find anything so I assume it's impossible? I could be missing something though...

I suppose if it is impossible I'll have to use a pop-up message box when the player tries to read the book instead. I was hoping I could actually change the text of a book though.
User avatar
Kayla Bee
 
Posts: 3349
Joined: Fri Aug 24, 2007 5:34 pm

Post » Sat Feb 19, 2011 1:00 am

have a look http://obse.silverlock.org/obse_command_doc.html#Text_Input_Functions.
User avatar
Stay-C
 
Posts: 3514
Joined: Sun Jul 16, 2006 2:04 am

Post » Sat Feb 19, 2011 3:32 am

have a look http://obse.silverlock.org/obse_command_doc.html#Text_Input_Functions.

That's interesting... I originally skipped over that because I wasn't trying to let the player edit the text, I was trying to put text from a string already created into the book, but I wonder if using SetInputText and then CloseTextInput right after could set the text of the book without giving a chance for the player to actually edit the text.

*Goes off and tests* :lightbulb:
User avatar
Khamaji Taylor
 
Posts: 3437
Joined: Sun Jul 29, 2007 6:15 am

Post » Fri Feb 18, 2011 11:08 pm

http://obse.silverlock.org/obse_command_doc.html#SetDescription says sth. about books. Not sure if this works, though.
User avatar
kyle pinchen
 
Posts: 3475
Joined: Thu May 17, 2007 9:01 pm

Post » Sat Feb 19, 2011 1:51 am

Ah yes, Low Post, that did the trick, thanks!

I tried this at first:
scn CMDynamicNoteTeststring_var textbegin onActivate	if (IsTextInputInUse == 0)		openTextInput "%e" 2 200		let text := "New Text"		insertInInputText "%z" text		closeTextInput        endifend

But, it would also print out a weird cursor ("|") character at the end as well.

Low Post's suggestion fixed that though:
scn CMDynamicNoteTeststring_var textref selfbegin onActivate	set self to getSelf	let text := "New Text"	self.setDescription text	activateend

I can even enter HTML formatting too :)
User avatar
Robert DeLarosa
 
Posts: 3415
Joined: Tue Sep 04, 2007 3:43 pm


Return to IV - Oblivion