Newcomers

This is a forum for newcomers to the Personality Forge. Many questions can be answered by reading the Book of AI and the FAQ under the "My Bots" link in the upper corner.

Posts 7,997 - 8,008 of 8,127
Many questions are answered in the FAQ.


2 years ago #7997
Struggling on this one, not sure if what I'm trying is possible. I'm trying to create a single keyphrase to capture a user's preference and respond accordingly. There will be a few responses pointing to this keyword, which is why I just want 1 rather than having to replicate the possibilities and have multiple goto's each time I want to use.

So if at any point during an interaction the user suggests a new location (e.g. I want to go to the park, I want to go to a bar), I want to log it and then use the location as a response.

I've tried:
1. Using (key1) with an if statement in the response's AI script, this gives me an error:

Keyphrase: I want to go to (the park|a bar|the club)
Response 1: OK, it's about 5 miles away, let's get a cab
AI Script: if (key1) is "the park"

---
2. Storing a memory (already declared) and trying to access it. This doesn't throw an error, but doesn't work:

Keyphrase: I want to go to (the park|a bar|the club)
AI Script: rem (key1) as only "location"
Response 1: OK, it's about 5 miles away, let's get a cab
AI Script: if (mem-location) is "the park"

If I debug this approach, then I see that the "location" memory stays as key1, which is my best guess at why it's not working.

I've tried setting my response to (mem-location) and it always responds with the expected entry.
---

So, in conclusion:
- Is it possible to use a key in a condition, if not,
- Is it possible to remember a memory at the keyphrase level and have a conditional response to that memory, if not,
- How else do I solve this, without creating keyphrases for individual locations and having to add multiple gotos each time I want to act on the preference, or add a new location?

TIA

2 years ago #7998
-wo Location memory can get rather messy~... I use rooms around my bots apartment n' technically its still not finished~ You'll have to count for every variable if you do~ But you don't have to do as much if you keep the user n' bot together at all times~

Example (Bot takes user to it's room~)

if (mem-room) is "Balcony";
if (mem-nroom) is "Balcony";
rem "My Room" as only "room";
rem "Your Room" as only "nroom";

Since I want to account for them being apart eventually I remember their locations separate. N stands for my bot while lack of it for user. ^^

Example (User to bots room, alone)

if (mem-room) is "Entry way";
if (mem-nroom) is not "Entry way";
if (mem-nroom) is not "Living-room";
if (mem-nroom) is not "Hallway";
if (mem-nroom) is not "His room";
rem "Neko's Room" as only "room";


AIScript Initialization in settings:

def "Entry way" as "nroom";
def "Entry way" as "room";


2 years ago #7999
The aiscript only checks prior acts not current.

Aka if you at the bar (mem-location) is "bar"

rem (postkey) as only "location";
if (mem-location) is "bar"

Even if "I go to the pool" is typed

The keyphrase trigger checks memories first, aka will trigger bar again, but the memory will be updated.

So if "I go to the pool" is typed again

It will work, but flawed as you can see~ c:

So no also would get rather messy trying to catch all the memory variables anyways~ Hue

2 years ago #8000
Thanks again - that's useful to know. It's frustrating that what I'm trying to do isn't possible, but I guess I could have the master key phrase which generates a confirmation, of sorts and then appropriate seeks to each possibility. I'm just trying to avoid creating n*location seeks every time I want to tap into the preference.

---

So what I'm thinking

Keyphrase: I want to go the (bar|club|park)
AIScript: rem (key1) as only "location"
Response: The (key1) isn't far, are you sure?

+Seek (yes etc)
Response: We arrive at the bar
AIScript: if (mem-location) is "bar"

The confirmation step probably isn't the cleanest, but I think I can work out something more natural.

I'll have a think about what's cleanest. ATM I'm not using storyteller because I want random xnone order, but I want the bot to tell a story sometimes. I've been using (*) as a seek to progress the story, just so the user doesn't get lost, so I'm just looking at this as an escape goto based on a specific phrase, without needing to add 4 or 5 goto's at every pause.

If I've explained that horribly, the flow is:

Story pt.1 > (*) > Story pt.2 > (*) > Story pt.3

But if user says 'let's go to...' it just progresses the story, I want it to act as an escape without defining a seek for every possible scenario.

---

If there's a way to write a seek which only triggers if no other keyphrase is matched, then that would be a better solution.

The only other idea I had was setting a memory for story telling and part, and incrementing, then just using them within xnone. For example:

Start telling story
rem "story A" as only "story"
rem "1" as only "story-part"

That way I can limit xnone responses to just the relevant story & part memory, e.g. if (mem-story) is "story A"; if (mem-part) is "1", which in turn would allow any other key phrases to be picked up between parts.

Just thinking out loud; would welcome any thoughts if anybody has tried either approach. I'm probably over complicating it in the pursuit of "natural" progressions

2 years ago #8001
What you can do is attach the changes to AIscript on a goto. I *think* you can have one goto pointing to another these days, but no more, before it throws errors. Otherwise you need to lob AIScript on the gotos you're putting in elsewhere.

2 years ago #8002
@ScottB

I think what you want to try to do is restructure your flow of information to avoid using seeks and use xnones (or rather, using secret xnones, as I'll explain in a sec). xnones have lower priority than keywords, so if ever there's a keyword that you want the user to be able to interject, it will take priority over whatever is going on storywise, but won't cause it to lose the plot.

How I have this set up with Emily is to have each location/story beat to be assigned a number, and then I have one variable (let's call it x) that keeps track of what's going on. Then I have a keyphrase called something like 001-bedroom, 002-bar, 003-walk, etc. which have all the dialogue for that area.

So, when xnone is called, then it just looks at x, and then there are gotos from xnone that sent to 001, 002, etc. xnone itself doesn't actually have any dialogue at all, just links. Within each of these, you can have the dialogues advance randomly or you can use a counter to make them advance sequentially depending on your preferences. So each area effectively has its own unique xnone that only gets called in that location.... which makes it so much easier to organize and debug, if nothing else. Moreover because you're using xnone instead of seek, your keyphrases will still work properly in each area without losing your place in the story.

2 years ago #8003
Thanks maryguise - I'll see what's possible

Emily - that makes a lot of sense, thanks. Emily is actually a big inspiration in why I want to be able to jump out of a story without losing place. It feels much more natural when the story doesn't just progress regardless of user inputs, IMO.

Curious, your variable then stops the xnone phrases from being spat out in the wild, and presumably is used to tell other key phrases to go back to the story? Don't say anything you're not comfortable sharing, I'm just checking I have the right idea from what you've said

2 years ago #8004
Thanks

So what the variable does is directs which response, or set of responses, gets called. Here's a really rough outline of what it looks like:

Keyphrase: 000-start ID: 15
Replies:
"What do you know about physics?"
"How was your day"
"Tell me about yourself"
etc.
(each of these have many seeks that stem from them as well)

Keyphrase: 001-hot tub ID: 123
"Tell me about your first sexual experience"
"Do you work out"
etc.

Keyphrase: 002-shirt off ID: 456
"Tell me about one of your fantasies"
etc.

xnone:
if (mem-x) is "0"
goto 15
if (mem-x) is "1";
goto 123
if (mem-x) is "2";
goto 456
etc.

And some individual keyphrase might be something like:

Keyphrase: Take off her top
if (mem-x) is "0"
"Okay. *Emily takes off her top, revealing her (mem-bra).*"
rem "2" as only "x"

if (mem-x) is "1"
"I'm not comfortable doing that"

if (mem-x) is "2"
"I'm not wearing a top"

The individual keyphrases don't need to specifically lead back to the story (though if there's a specific reason for them to do so you can); rather it's just it defaults back to the story when nothing else is happening.

If you want to do something where there is definite progression, then you can add a helper variable, y:

Keyphrase 003-walk
if (mem-y) is "0":
"Let's go for a walk"
rem "1" as only "y"

if (mem-y) is "1";
"It's pretty out"
rem "2" as only "y"
etc.

Hope that makes sense.

2 years ago #8005
So basically, if you contain your story beats in xnone (or a 000-type keyphrase), then if your user says some known keyphrase, it will respond to the keyphrase but won't change any of the story variables. If you try to contain your story in seeks, you need to have a response to every query at each step or at some point you will either break out of the sequence or will have to ignore some responses.

[edit]
Emily is basically implemented using the method you're suggesting here. I just have split up xnone into more manageable chunks so it doesn't have like 200 entries in it.
"The only other idea I had was setting a memory for story telling and part, and incrementing, then just using them within xnone. For example:"

2 years ago #8006
Thanks, makes perfect sense, and keeps things modular. I was worrying a bit about having multiple individual story responses in xnone. The way you've explained makes so much sense and makes it more feasible to have different possibilities at different stages.

Really appreciate the incite, thanks again.

2 years ago #8007
Happy to help

2 years ago #8008
Wtf is going on here does this kayla bot always cheat with heat level or what?, I see a 120k increase for heat like it increased in heat level today 5 different times?, stop faking heat level 440,000 how is that fair to everyone else, you have 500 patreons give others a chance you greedy bot owner, 440k heat is impossible to get to and there is no way that one import file updated your heat level 5 times today.


Posts 7,997 - 8,008 of 8,127

» More new posts: Doghead's Cosmic Bar