Jump to content

Recommended Posts

Posted

So in python i can write:

 

 

g = 'hey there number'

h = 1

print("%s, %d" % (g, h))

 

 

how do i do that in papyrus?

i basically need this - debug.notification('you killed this enemy an X number of times')

Posted

Natively?

newstring = oldstringprefix + iValue + oldstringsuffix

 

I ended up writing a string substitution script that would do the trick.

 

 

  Reveal hidden contents

 

 

That way you could just do:

Notification(StringSubst("You have # arrows left", "#", iNumArrows)

 

Would be great if we had a C version of this in StringUtil. It would be a simple passthrough to the native function and much faster.

 

Hope that helps.

Posted

That sure looks complicated.... Glad I have no need to do that.

 

@HailHell

Assuming you already have an integer or float that tracks the # killed...

For the example we'll call that variable NumKilled.

 

Debug.Notification("You have killed this enemy "+NumKilled+" times.")

Posted

If you're going to be reusing the same text and only want to change the numerical value, you can use message.show(Number)

 

http://www.creationkit.com/Show_-_Message

 

And format the message according to the flags on that page. In your case it would look like:

 

"You killed this enemy %.0f times."

 

Preferable in my opinion to putting the string in your script.

  • Recently Browsing   0 members

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