dirt
Joined: 13 Dec 2005 Posts: 8
|
Posted: Wed Feb 21, 2007 6:31 Post subject: Help with SQLDecodeSpecialChars |
|
|
I'm having some problems with this call, basically what I'm doing is reading text from a DB and passing it into a conversation node for a random task generator. When I installed NWNX4 and started to fix up my scripting from NWN1, I noticed it didn't have a SQLDecodeSpecialChars function, so I copied the one out of my NWN1 scripts and whats happening is the text string is getting cut off. Below is one example. I figured someone here would know if thats the problem or if it's something else. I'm also pasting the code below that makes the call in the script. Never had any issues with it in NWN1, but it seems to act this way on long text entries. Thanks in advance.
* Returning: I require a punctual person like yourself to deliver this _item_ to _protagonist_ in _location_. Upon delivery, they will provi (column 1)
Code: |
////////////////////////////////////////////////////////////////////////////
// Find a task phrase.
////////////////////////////////////////////////////////////////////////////
sSQL = "SELECT type, data FROM rtg_phrases WHERE type & " + IntToString(nTaskTypeMustMatch)
+ " = " + IntToString(nTaskTypeMustMatch) + " AND type & " + IntToString(nTaskTypeMayMatch)
+ " > " + IntToString(RTG_TASK_TYPE_NONE) + " AND type & " + IntToString(nTaskTypeExclude)
+ " = " + IntToString(RTG_TASK_TYPE_NONE) + " AND phrasetype = " + IntToString(RTG_PHRASE_TYPE_INITIAL)
+ SQLRandom();
SQLExecDirect(sSQL);
if(SQLFetch() == SQL_ERROR)
WriteTimestampedLogEntry("rtg_i0_generic: Failed to execute: " + sSQL);
else
{
retTaskData.nType = StringToInt(SQLGetData(1));
retTaskData.sText = SQLDecodeSpecialChars(SQLGetData(2));
}
|
|
|