Quick question on syntax...

Moderator: Event DM

Post Reply
Teibidh
Prince of Bloated Discourse
Posts: 255
Joined: Fri Oct 17, 2003 3:04 am

Quick question on syntax...

Post by Teibidh » Fri Nov 21, 2003 9:29 am

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
I could care less whether the glass is half full or half empty you pathetic PhD wielding excuse for a slime troll! Who the flying furry fu*k drank my water??
User avatar
Neve
Prince of Bloated Discourse
Posts: 192
Joined: Mon Apr 14, 2003 4:09 pm
Location: The Netherlands
Contact:

Post by Neve » Fri Nov 21, 2003 9:46 am

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 =)
Last edited by Neve on Fri Nov 21, 2003 9:48 am, edited 1 time in total.
- As you gaze unknowingly into the seemingly infinite depths of the optics of this altogether passionate embodiment of insatiability, you experience a gradual realisation that the heavily-embellished vocabulary scattered lavishly throughout the sentence you are currently reading is indisputably nothing greater than a generous ration of masculine bovine faeces.
Teibidh
Prince of Bloated Discourse
Posts: 255
Joined: Fri Oct 17, 2003 3:04 am

Post by Teibidh » Fri Nov 21, 2003 9:47 am

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.")
I could care less whether the glass is half full or half empty you pathetic PhD wielding excuse for a slime troll! Who the flying furry fu*k drank my water??
Post Reply