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,561 - 6,572 of 7,766

16 years ago #6561
sorry, mea culpa - too many quotation marks!
I started out quoting the line, then added the "default" outside them, and it all turned into a mess - you need to use:

default "" as "ihave";<0>

on the AIScript line


16 years ago #6562
Your memory 'Ihave' can't use the (key#) it has to be what ever the memory is under 'Ihave' in your inner life. Then pull up the memory by using (mem-Ihave)

(do you have|have you got) (a|an|the) (thingsihave62290) [5,0] <?PF remember (key3) as "ihave"; ?>

Ihave will show some thing. what ever (key#) was. Inner life will show the memory value next to Ihave in the persons or bots chat.
The AI script
<?PF if (mem-Ihave) is..or isn't.. "what ever the memory value says he has, but not a (key#)"; ?>


16 years ago #6563
Thanks Psims, but same error...

Prob, as I understand it is not possible to catch a user's word in a sentence and check if it exists in the bot memory?

16 years ago #6564
The (key#) is causing your error.

I have a keyphrase

I like (actor-catch) <?PF remember "actors" as only "sub" ?>
If I put <?PF remember "(key1)" as only "sub" ?>
It will either error or make the actors name (key1)

16 years ago #6565
yes, you do not need to name the key "(key3)" - it just has to be the third plugin or wildcard in the keyphrase. Then it will automatically use the value of that plugin or wildcard into (key3) (and the first 2 will be (key1) and (key2).)

16 years ago #6566
and the AIScript is on the response, not the keyphrase, so I think you ought to use

?PF if (mem-ihave) is (thingsihave62290) ?;<0>

You can call a (key#) into the body of the response, but I don't think it's available to the AIScript.

If you want it to trigger only on the word goat (and not any other things in (thingsihave62290) , then simply use:

?PF if (mem-ihave) is "goat" ?;<0>

16 years ago #6567
It's just like defining variables when you're programming in C++ - you'll get an error if you try to call one you haven't defined.

Ignore this - I seem to have been overcautious, and it's not the source of your error (though defining all your variables is no bad thing when programming generally.)

16 years ago #6568
My idea was a bit different. I was trying to let my bot to have an eterogeneus set of things it have (a car, a job, an house) and then, let it remember if it already say to a chatter that it have example a car, if asked twice. But it seems too hard to do...

16 years ago #6569
You could just check the 1 at the end of the keyphrase response box. This will have the bot only say anything checked once. It would apply to all the things in the Ihave though.

You could break it down with AI script <?PF if (mem-Ihave) is "car"; ?> check the 1 box
<?PF if (mem-Ihave) is "house"; ?> check the 1 box. etc

16 years ago #6570
Yes, Prob. Thanks.

God solution, but not scalable. If I'll add in the plugin a thing, I had to add a KP. That's it anyway!

SIGH!

16 years ago #6571
You can call a (key#) into the body of the response, but I don't think it's available to the AIScript.
I'm also wrong about this (sorry - I'm tired today, and getting muddled ) Ignore my preceding remarks.

I think you need your bot to remember what it has already said to this individual (a subset from the (thingsihave62290)<0> plugin) into a new memory, and test that one - that ought to be possible. Every time you tell the human you have something, save it, eg:

?PF rem (key3) as "ihavealreadysaidihave" ?;<0>

then qualify any responses in other KPs when you say you have something, eg:

I have a (thingsihave62290)<0>

with the AIScript:

?PF if (mem-ihavealreadysaidihave) is not (key1) ?;<0>

But always make sure you have an alternative response to go to, or you will get "Sorry, I have No Valid Responses to Go To"

Having said that, the (thingsihave62290) plugin will not duplicate an entry in a response until all its values have been called once, so put a dozen values in there (or 30 or 50 or 100,) and in practice they'll never all get called by one person, so I've never knowingly used memories like this. I just pack the plugins

16 years ago #6572
plugin will not duplicate an entry in a response until all its values have been called once
Great point. Usually you will never have a guest talk that often to go through all the items more than once.


Posts 6,561 - 6,572 of 7,766

» More new posts: Doghead's Cosmic Bar