Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

[SKY] Using variable numbers in message boxes.


bleakraven
 Share

Recommended Posts

Hi TESA!

 

I'd like to know if there is a way to have message boxes display a number from a variable dynamically.

What I mean by this is that, for example, I have a message box that shows the player how many resources they need to build something there, but this number should vary as other areas require more resources. Is there a way to link a variable to this box, so that it shows...

 

In area 1:

"You need 5 wood logs to build this."

 

In area 2:

"You need 10 wood logs to build this."

 

And the message box remains the same: "You need <variable_number_here> to build this." and it gets the number assigned via scripting?

 

Cheers!

 

EDIT: I remember seeing something about Text Replacement, but I'm not sure it works without a quest. I'm not sure how to make it work with a quest...

Edited by bleakraven
Link to comment
Share on other sites

If you made a quest where there was multiple outcomes (the same # as your areas) and then set each outcome in a different area (I'm assuming these areas are large exterior cells) and just slightly changed the message and requirements for each outcome would that work? That way you could also have message prompts telling the player where to go. And map markers for the general locations.

 

That to me sounds like a smaller and easier script to write.

End of me knowing what I'm talking about.

Start of possible hot air.

 

What of instead of saying "Player, you need 5 garlic breads to settle here" (which I've never seen in Skyrim) you instead say 

"Necessary garlic breads acquired 0/5" and change that for each location/quest branch

To my knowledge it would look like this:

"Necessary garlic breads acquired (<Global=GarBreadCount>/<Global=GarBreadTotal>)"

 

Hopefully this helps you out. :thumbup:

  • Upvote 2
Link to comment
Share on other sites

There is another way. If your sending the message to the screen from a script, you can code the values in as well.

 

Message object: myBreadMessage

You need %.0f flour, %.0f honey and %.0f salt to make bread.

 

In your script, you get the values and display the message:

int myFlour = game.getplayer().GetItemCount Flour

int myHoney = game.getplayer().GetItemCount Honey

int mySalt = game.getplayer().GetItemCount Salt

 

If you want you can do calculations to get how 'many' of each the player still needs to get, or you can just say how many total of each they need.

myBreadMessage.Show(myFlour, myHoney, mySalt)

 

That will show the bread message as defined above, and replace each %.0f with the value in the variable of the Show(***) command.

  • Upvote 2
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...