how to make message debug.notification display a variable

Post » Thu Jul 17, 2014 10:19 pm

i want a debug notification to pop up and announce "Due to equipment changes, your new total armor is Player.getav("Damageresist")"

however, anytime i attempt to use or reference a variable or actor value like this, the compiler has an error

User avatar
carla
 
Posts: 3345
Joined: Wed Aug 23, 2006 8:36 am

Post » Thu Jul 17, 2014 10:33 pm

float DamageResist = Player.getav("Damageresist")

Debug.Notification("Damage Resist = "+DamageResist+)

I'd show you the correct Message.Show() method but on my phone and no time to explain ;)
User avatar
Cathrine Jack
 
Posts: 3329
Joined: Sat Dec 02, 2006 1:29 am

Post » Thu Jul 17, 2014 10:51 pm

C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\alchemyrewardsscript.psc(25,77): no viable alternative at input ')'

still errors unless i put the " after the +damageresist+, but then it just says "+damageresist+" in the debug message

User avatar
Queen of Spades
 
Posts: 3383
Joined: Fri Dec 08, 2006 12:06 pm

Post » Thu Jul 17, 2014 7:31 pm

I'm sure that was a typo. Try this:
Debug.Notification("Damage Resist = " + DamageResist)

Put a space before and after the "+", then the variable you want to display the value of (or another string or whatever). The plus sign "+" just concatenates things on either side (for strings that is, if this was an arithmetic operation, then "+" would be adding numbers up). You can concatenate multiple strings and variables together using this.
User avatar
Catharine Krupinski
 
Posts: 3377
Joined: Sun Aug 12, 2007 3:39 pm

Post » Thu Jul 17, 2014 1:11 pm

BTW: a string is whatever lies between the two double quotes, which is why your second attempt failed - you were displaying the string "+damageresist+" rather than the variable DamageResist.
User avatar
Maria Leon
 
Posts: 3413
Joined: Tue Aug 14, 2007 12:39 am

Post » Thu Jul 17, 2014 5:34 pm

ok i got it going, but the debug.notifcation is tiny.

i used debug.messagebox instead but it pauses the game and makes me click OK

how do i use the "show" function? read the wiki page about it but they don't explain it at all.

they show example

Helloworld.show()

compiler errors everytime with that and says EOF

User avatar
Katy Hogben
 
Posts: 3457
Joined: Mon Oct 30, 2006 12:20 am

Post » Thu Jul 17, 2014 10:25 pm

You need to create a message property in your script. Then create a new message object in the Creation Kit. Then link the message object to the property in your script. Then you can use show().

e.g.

1. Setup property in script: message property myMessageNotification auto

2. In Creation Kit, go to "Message" item under "Miscellaneous". Right click somewhere in the resulting list of message objects and create new message (e.g. "myMessageNotification"). Set it up however you want.

3. In Creation Kit, go to your script properties. Your myMessageNotification property should be listed. Then just link it to your new message object using the "Pick Object" menu.

4. In script, display it using: int buttonPressed = myMessageNotification.show()

The buttonPressed variable is just the index of whichever button you added to the messagebox. Probably not relevant if this isn't a message box.

As for how to get custom strings being displayed using the messageProperty.show() method (because the strings are otherwise hardcoded in the Creation Kit, which is not flexible), I haven't actually done that yet. But the instructions are here: http://www.gamesas.com/topic/1486888-pass-string-to-messageshow/

User avatar
Matthew Barrows
 
Posts: 3388
Joined: Thu Jun 28, 2007 11:24 pm

Post » Thu Jul 17, 2014 8:16 am

so much complications to do something sooooo simple. *sigh* thx for link tho.

by the way, is there a way to make Debug.Notification bigger on the screen or use larger text etc?

User avatar
Haley Merkley
 
Posts: 3356
Joined: Sat Jan 13, 2007 12:53 pm

Post » Thu Jul 17, 2014 8:32 am

Only to use less text.

User avatar
Abi Emily
 
Posts: 3435
Joined: Wed Aug 09, 2006 7:59 am


Return to V - Skyrim