The AI Engine
This forum is for discussion of how The Personality Forge's AI Engine works. This is the place for questions on what means what, how to script, and ideas and plans for the Engine.
Posts 6,787 - 6,798 of 7,766
Posts 6,787 - 6,798 of 7,766
OscarTheBuilder
15 years ago
15 years ago
I noticed that in debug mode, the parts of the sentence are assigned to plugin names (subj), (v), etc. and can be used in responses. I didn't see any reference to this in the Book of AI. Is this undocumented feature something that can be counted on to "always" exist? Is there a complete list of these and other such features?
Slingshot
15 years ago
15 years ago
Maybe my question wasn't clear. As I understand it, if a response has a bunch of if statements attached to it, it will execute when the FIRST if statement it encounters (from left to right) evaluates as TRUE. Is there a way to make it so that the response executes only when ALL the if statements are true?
Thanks in advance for any help.
Thanks in advance for any help.
Ty Paige
15 years ago
15 years ago
one possible way, if you think about it, is to include mem-statements in your responses. If you put 5 statements in there and one doesn't exist.. it doesn't get used.
or you could use the "if exists" statement at the root of your keyphrase to do the same, I guess.
careful, the root doesn't usually agree with a "rem" statement before an "if" statement
or you could use the "if exists" statement at the root of your keyphrase to do the same, I guess.
careful, the root doesn't usually agree with a "rem" statement before an "if" statement
OscarTheBuilder
15 years ago
15 years ago
Slingshot--
Two if statements, included with a response, need to both evaluate to true in order for the response to be chosen. In other words, logical and is a consequence of having multiple if statements.
I just tested it myself.
In the bot's settings, I initialized two memory locations thus:
rem "true" as only "a"; rem "true" as only "b";
In a response to my test phrase, I included this:
true <?PF if (mem-a) is "true"; if (mem-b) is "true"; ?>
If I, instead, initialized one of the memory locations with "false," (as shown below) the above response would not fire.
rem "false" as only "a"; rem "true" as only "b";
- or -
rem "true" as only "a"; rem "false" as only "b";
* Note that I used true/false in my example for clarity, but any values could be used.
* Also note that the "true" in the response was an arbitrary choice. I could have easily been something like this:
I don't like you. <?PF if (mem-youAre) is "asshole"; if (mem-youDid) is "smack me"; ?>
As an aside, if you want a logical "or," you would include the same response with each of the conditionals:
I don't like you. <?PF if (mem-youAre) is "asshole"; ?>
I don't like you. <?PF if (mem-youDid) is "smack me"; ?>
* Also, note that I'm not implying that you are an asshole. lol
Two if statements, included with a response, need to both evaluate to true in order for the response to be chosen. In other words, logical and is a consequence of having multiple if statements.
I just tested it myself.
In the bot's settings, I initialized two memory locations thus:
rem "true" as only "a"; rem "true" as only "b";
In a response to my test phrase, I included this:
true <?PF if (mem-a) is "true"; if (mem-b) is "true"; ?>
If I, instead, initialized one of the memory locations with "false," (as shown below) the above response would not fire.
rem "false" as only "a"; rem "true" as only "b";
- or -
rem "true" as only "a"; rem "false" as only "b";
* Note that I used true/false in my example for clarity, but any values could be used.
* Also note that the "true" in the response was an arbitrary choice. I could have easily been something like this:
I don't like you. <?PF if (mem-youAre) is "asshole"; if (mem-youDid) is "smack me"; ?>
As an aside, if you want a logical "or," you would include the same response with each of the conditionals:
I don't like you. <?PF if (mem-youAre) is "asshole"; ?>
I don't like you. <?PF if (mem-youDid) is "smack me"; ?>
* Also, note that I'm not implying that you are an asshole. lol
prob123
15 years ago
15 years ago
I think it's easier to use the if mem exists, or does not exist.
<?PF if (mem-asshole) does not exist; ?>
<?PF if (mem-asshole) does not exist; ?>
Ty Paige
15 years ago
15 years ago
If there is an istance where you want to say something once, the "does note exist" and "exists" or "yes" commands will be the way to go.. But that method probably doesn't apply to alot of users.. just a select few.. but, it will help you think of different coding techniques.
OscarTheBuilder
15 years ago
15 years ago
I'd love to be able to use the "exists" conditional, but there is no way to programmaticly remove memories once they have been created. Using the asshole example, what if the bot decided you are no longer an asshole? It does not work to do <?PF rem "" as only "asshole"; ?> and have it be removed.
Ty Paige
15 years ago
15 years ago
You are a dick <?PF rem "yes" as only "asshole"; ?>
Bot: You suck <?PF if (mem-asshole) exists; ?>
I am sorry <?PF rem "no" as only "asshole"; ?>
Bot: You called me asshole before. I will forgive but not forget <?PF if (mem-asshole) is "no"; ?>
just code for futre key phrases and responses to equal "no" or any other variable you want to put in.
I use this in many different forms of additional emotions and attitudes
I even apply it to certain sarcastic remarks. Why? cause that is who I am..
Bot: You suck <?PF if (mem-asshole) exists; ?>
I am sorry <?PF rem "no" as only "asshole"; ?>
Bot: You called me asshole before. I will forgive but not forget <?PF if (mem-asshole) is "no"; ?>
just code for futre key phrases and responses to equal "no" or any other variable you want to put in.
I use this in many different forms of additional emotions and attitudes
I even apply it to certain sarcastic remarks. Why? cause that is who I am..
OscarTheBuilder
15 years ago
15 years ago
Right, that's what I am currently doing. It would be nice to be able to erase them and use the exists test as prob123 mentioned, though.
eta: I wish I had chosen a friendlier example. lol
eta: I wish I had chosen a friendlier example. lol
» More new posts: Doghead's Cosmic Bar