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,558 - 6,569 of 7,766

16 years ago #6558
1. I never used before the ihave mem
...
4. When I import the file, the TEST RUN return me the error: ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is (key3)". Please correct this and try again.

There is a line in the header of your import file that starts AIScript: <0>

If that is all this line says, add the following to it after the semicolon:

default "" as "ihave";<0>

If the line starting "AIScript: <0>" already has code in it, paste

default "" as "ihave";<0>"

into a new line immediately below.
Then the AIEngine will know the memory already exists (but has no value.) 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.

EDIT: oops! sorry, my first entry missed the "default" - I've fixed it now

16 years ago #6559
Exactly the same error...
and on a new bot!

3BTESTBOT * October 20 2008
62569.62290.22 [UserID,MakerID,Responses]

StoryTeller: no
Compound: yes
Memory: 2
Gossip: 2
AIScript: "" as "ihave";"

Language Center
---------------
ZINDEX_PERSONALINFO [0,0]
    WhoIsBot
(do you have|have you got) (a|an|the) (thingsihave62290) [5,0] <?PF remember (key3) as "ihave"; ?>
    Yes I have a (key3) <?PF if (mem-ihave) is (key3); ?>

(xsentences follows...)

16 years ago #6560
To be exact, the error is:

KeyPhrase: "ZINDEX_PERSONALINFO" Rank: 0 Emotion: 0 (New)
Response: 1) "WhoIsBot" (New)KeyPhrase: "(do you have|have you got) (a|an|the) (thingsihave62290)" Rank: 5 Emotion: 0 AIScript: remember (key3) as "ihave" AIScript: (New)
Response: 1) "Yes I have a (key3)" ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is (key3)". Please correct this and try again.

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


Posts 6,558 - 6,569 of 7,766

» More new posts: Doghead's Cosmic Bar