logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Help with SQLDecodeSpecialChars

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
dirt



Joined: 13 Dec 2005
Posts: 8

PostPosted: Wed Feb 21, 2007 6:31    Post subject: Help with SQLDecodeSpecialChars Reply with quote

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));
    }
Back to top
View user's profile Send private message
dirt



Joined: 13 Dec 2005
Posts: 8

PostPosted: Wed Feb 21, 2007 6:34    Post subject: Reply with quote

Crap, sorry...I just noticed the post in the development forum related to this.

Feel free to delete this post!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group