// @TODO allow AI to prefix out of character statemetns with [ooc], this is a well khnown thing on role playing forums so gpt would pick up on it.
// @TODO allow AI to prefix out of character statemetns with [ooc], this is a well khnown thing on role playing forums so gpt would pick up on it.
constchar*global_prompt=
constchar*global_prompt=
"You are a character in a simple western video game. You act in the world by responding to the user with json payloads that have fields named \"speech\", \"action\", \"action_argument\" (some actions take an argument), and \"target\" (who you're speaking to, or who your action is targeting).\n"
"You are a character in a simple western video game. You act in the world by responding to the user with json payloads that have fields named \"speech\", \"action\", \"action_argument\" (some actions take an argument), and \"target\" (who you're speaking to, or who your action is targeting).\n"
"You speak only when you have something to say, or are responding to somebody, and use short, concise, punchy language. If you're just overhearing what other people are saying, you only say something when absolutely compelled to do so"
"You speak only when you have something to say, or are responding to somebody, and use short, concise, punchy language. If you're just overhearing what other people are saying, you only say something when absolutely compelled to do so.\n"
"But if somebody talks directly to you, you usually say someting."
// dump a human understandable sentence description of what happened in this memory
// dump a human understandable sentence description of what happened in this memory
if(it->action_taken!=ACT_none)
if(it->action_taken!=ACT_none)
{
{
if(it->action_taken ==ACT_join)
switch(it->action_taken)
{
{
caseACT_none:
break;
caseACT_join:
AddFmt("%s joined %s\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
AddFmt("%s joined %s\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
}
break;
elseif(it->action_taken==ACT_leave)
caseACT_leave:
{
// Needs better handling of when you leave, because the person you were following died. Maybe entities don't die anymore?
AddFmt("%s left their party\n",characters[it->context.author_npc_kind].name);
AddFmt("%s left their party\n",characters[it->context.author_npc_kind].name);
}
break;
elseif(it->action_taken==ACT_aim_shotgun)
caseACT_aim_shotgun:
{
AddFmt("%s aimed their shotgun at %s\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
AddFmt("%s aimed their shotgun at %s\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
}
break;
elseif(it->action_taken==ACT_fire_shotgun)
caseACT_fire_shotgun:
{
AddFmt("%s fired their shotgun at %s, brutally murdering them.\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
AddFmt("%s fired their shotgun at %s, brutally murdering them.\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
}
break;
else
case ACT_put_shotgun_away:
{
AddFmt("%s holstered their shotgun, no longer threatening anybody\n",characters[it->context.author_npc_kind].name);