Page 1 of 1

Quick question on syntax...

Posted: Fri Nov 21, 2003 9:29 am
by Teibidh
I want to use ActionSpeakString() to spit out the state of some variables in my script for debugging and informational purposes... It's been so damn long since I've messed with anything coding related though that I can't remember what I have to do to get output from a non-string variable included in a line... What I'm going for is this...

You have been given 2,000 gold coins.

Skeletal version of the string should look like:

You have been given vGoldAward gold coins.

What I tried, cause I couldn't remember any better:

ActionSpeakString("You have been given " vGoldAward " gold coins.")


Now, obviously ActionSpeakString() doesn't like the multiple strings sitting there, but if I put vGoldAward within the quotes then it will say "You have been given vGoldAward gold coins." which also doesn't do me much good. I know the answer is simple, but I'm getting old and my memory is failing :P

Posted: Fri Nov 21, 2003 9:46 am
by Neve
This will make the object speak the line :

Code: Select all

ActionSpeakString("You have been given " + IntToString(vGoldAward) + " gold coins.");
use SendMessageToPC if you want it to appear in the Server message window, the rest is the same =)

Posted: Fri Nov 21, 2003 9:47 am
by Teibidh
After even more digging in nwn.bioware.com's forums I came up with the answer... I'd already looked for half an hour before posting here.

ActionSpeakString("You have been given "+IntToString(vGoldAward)+" gold coins.")