Jump to content

How do I add text sections to MessageBox?


Okiir

Recommended Posts

Having a small problem with scripting in the CreationKit.

 

I'm working on a mod, and in this mod I have an object - that when activated - a text box shows up on the screen.

 

Problem is I can't find out how I add line-breaks to my text.

 

 

 

To better illustrate what I mean:

 

 

this is how my script looks like in the CreationKit (added random text):

 

Scriptname (name) extends ObjectReference

 

Event OnActivate(ObjectReference akActionRef)

Debug.MessageBox("headline text text text text text text text text text text text text text text text text text text text text text text text text text text text text text end")

 

 

 

And in-game the text box looks like this:

 

headline text text text text text text text text

text text text text text text text text text text

text text text text text text text text text text

text end

 

 

 

But I want it to look like this:

 

headline

 

text text text text text text text text text

text text text text text text text text text

 

text text text text text text text text text

text text

 

end

 

 

 

 

So, do anyone know how I add line-breaks (sections) to the text?

 

thanks

Edited by Okiir
Link to comment
Share on other sites

What you need are manual line breaks with "\n" if you're doing it manually like in your example. The easier way would be to write out a Message form the way you want (including carriage returns/line breaks) and then do something the like the following:

 

Scriptname yourScript extends objectreference
Message Property yourMessage Auto
   
Event OnActivate(ObjectReference akActionRef)
    yourMessage.Show()
endEvent

Link to comment
Share on other sites

What you need are manual line breaks with "\n" if you're doing it manually like in your example. The easier way would be to write out a Message form the way you want (including carriage returns/line breaks) and then do something the like the following:

 

Scriptname yourScript extends objectreference
Message Property yourMessage Auto
   
Event OnActivate(ObjectReference akActionRef)
    yourMessage.Show()
endEvent

 

 

Thanks for the reply, but I can't get it to work :/

 

I just get "Compilation failed" when I try to save the script.

 

 

Could you explain a bit better. Maybe show an example of how it looks like with text added?

 

 

 

EDIT:

 

also do anyone know how I add "player name" to the text?

Edited by Okiir
Link to comment
Share on other sites

Thanks for the reply, but I can't get it to work :/

 

I just get "Compilation failed" when I try to save the script.

What I gave you should be a working script. My guess is that you didn't declare the property? You have to click the Properties box and select your actual Message from the dropdown box.

 

EDIT:

 

also do anyone know how I add "player name" to the text?

Use <Alias=Player> in place of where you want the name in the Message.

 

Also, I'm assuming you've set up your Message properly: When you create your message, make sure the "Message Box" checkmark is ticked. You can ignore the title field, just fill in the text area as you normally would. What you put in there is what you see, so you do not need to format string characters for line breaks. Just hit enter. An example of Message Box text could be:

 

<Alias=Player>,

I hope you find this letter.  I would like you to perform XYZ:

1. Do X
2. Do Y
3. Do Z

You will be rewarded upon completion.

As you need, you can also set text justification, etc., using basic HTML p aligns.

Link to comment
Share on other sites

Thanks for the reply, but I can't get it to work :/

 

I just get "Compilation failed" when I try to save the script.

What I gave you should be a working script. My guess is that you didn't declare the property? You have to click the Properties box and select your actual Message from the dropdown box.

 

 

I still can't get it to work, I'm afraid I'm not that familiar with the scripting part of the creation kit.

 

I initially just followed this tutorial on the CreationKitWiki: http://www.creationkit.com/Bethesda_Tutorial_Papyrus_Hello_World

 

 

do you know if there is some kind of tutorial for the method your suggesting?

Link to comment
Share on other sites

Assuming you're following the generic tutorial, where you attach your script, there's a Properties button. Click it, select "yourMessage", and choose the FormID of Message you created.

 

sorry, but I don't get it. Where do I type in my message, in the script itself (edit source), like in the example in my first post. Or do I create the message somewhere else and add it to the script later?

 

I see where the Properties button is, but how do I get my message there, and how do I choose the FormID?

 

 

 

sorry for all the questions :P

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...