AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Embedded/standalone outputing to console
 
 

I built chatscript with the following options on windows:
#define DISCARDSERVER 1
#define DISCARDSCRIPTCOMPILER 1
#define NOMAIN 1

I’m starting it with InitSystem followed by InitStandalone.

PerformChat is then returning responses, but chatscript is also writing to stdout or stderr somehow.  It just flashes the console window for a split second can’t even see what it’s saying, assuming it’s the output.

How can I prevent chatscript from ever writing to stderr/stdout?

Also, under VS 2013 I had to fix some issues with converting to and from ANSI/UNICODE.  Assuming the author isn’t compiling on a modern MS windows SDK?

 

 
  [ # 1 ]

what version of CS are you using. InitStandalone nowadays is part of initsystem. You would not call it separately.
CS accepts UTF8 input. It does not accept ANSI/UNICODE.

 

 
  [ # 2 ]

I’m using VS 2013 community edition.  Most of the string issues were with MS functions that I guess now take wide strings where they didn’t use to?  I fixed them with some simple casts.

 

 
  [ # 3 ]

No. What version of ChatScript are you using?

 

 
  [ # 4 ]

5.5

 

 
  [ # 5 ]

But the documentation for 5.5 says to call initsystem. It makes no mention of calling InitStandalone.

 

 
  [ # 6 ]

That’s really a side issue had zero effect on what I’m trying to fix.  I was just following the links on sourceforge for the docs, didn’t notice they were out of date.

 

 
  [ # 7 ]

I don’t know.  I define #NOMAIN 1 and added this just before the main program and watched the console output. I saw no extraneous output

#ifdef NOMAIN
int main(int argc, char* argv[])
{
InitSystem(argc,argv);
char answer[10000];
while (1)
{
PerformChat("bob","","help me",NULL,answer);
printf("%s\r\n",answer);
}
}
#endif

 

 
  [ # 8 ]

Is there any way CS would write to stdout/stderr if I’m doing something wrong?  I’m pretty new to CS so that would be entirely possible.  Or maybe a combination of args to InitSystem that might cause it?

My code is basically the same as yours.  I have swig in the mix but I just bypassed swig and still got the same console popping up.  One for every call to PerformChat.

 

 
  [ # 9 ]

What args are you passing into InitSystem? CS doesn’t write to stderr at all.  It writes to stdout during logging if echoing has been requested. What do you get in the console? Is it like a line in the user log file?

 

 
  [ # 10 ]

Try an argument of “nouserlog” and see what happens

 

 
  [ # 11 ]

I think the problem stems from a bug in the path handling for windows.  CS definitely is throwing up a console, it got stuck in a loop printing to the console when I passed in a bad path to InitSystem complaining about something already existing.  They went so fast I couldn’t get the exact words.  So I’m assuming it’s doing the same elsewhere.  There is no other explanation, there is no path in my code that prints to the console.

I added a log statement to WalkDirectory in os.cpp and the output was this:

No such directory C:/game_development/work/chatscript/Assets/chatscript/LIVEDATA/ENGLISH/*


if (hFind == INVALID_HANDLE_VALUE)
{
Log(SERVERLOG, "No such directory %s\n", DirSpec);
printf ("No such directory %s\n", DirSpec);
return;
}

 

 
  [ # 12 ]

since you have the ability to compile/modify source, you have the lead. I have no idea what went wrong in your world.
the system will echo out bugs…. so if you have a bug, you might indeed get a console complaint.

 

 
  [ # 13 ]

Found the issue.  It’s when it’s trying to execute talk.vbs.  In an embedded environment this is going to fail more often then not.

 

 
  [ # 14 ]

not that that explains why you got console output. but at least you have solved your problem

 

 
  [ # 15 ]

Yes it does.  CS tries to execute talk whether it’s in the path or not, which will open a command window if the application isn’t a console app itself.

 

 1 2 > 
1 of 2
 
  login or register to react