What is the best way to code two sprites having a chat?

Get help using Construct 2

Post » Thu Jan 21, 2016 6:25 pm

I have two little people sprites. Those sprites can walk around, and whatever and once in awhile they will randomly have the urge to chat with another sprite. I am curious about everyones opinion on the best way to go about this would be?

The way I thought of doing it was using Wait Signals. So when the event starts the first sprite says whatever, then sends a signal for the second sprite to say whatever, back and forth back and forth until it ends. That will work just fine and dandy, but I want it to be more interactive. If sprite #1 says something like "Hugs", and sprite #2 is in a bad mood maybe it responds in a negative way like "I don't want hugs right now." I do have a mood variable that ranges from 1-100, but how in the process of the conversation logic can the sprite check its mood variable, and respond correctly to what the other sprite has said?

Anyone have any ideas, or maybe a point in the right direction on how i can implement something like that?
Last edited by jmiller4180 on Thu Jan 21, 2016 6:35 pm, edited 1 time in total.
B
9
S
3
Posts: 50
Reputation: 804

Post » Thu Jan 21, 2016 6:31 pm

Here is a thought. Would it just be different "Signals" Being sent. So if Sprite #1 says "Hugs" , Hugs is the signal "HugsSignal" which then goes to a Family event that is waiting for that specific signal, and can do a check like IF Variable Mood > 50, send positive response like "I Love Hugs!", IF Variable Mood < 50, send negative response like "I don't like hugs".?

Would this be way to much work and there is a much simpler way to do it?
B
9
S
3
Posts: 50
Reputation: 804

Post » Fri Jan 22, 2016 6:46 pm

That seems like a good place to start. You have to track the entire possible conversation tree (like an AI options tree), and send signals (or flip flags) like you are thinking.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857


Return to How do I....?

Who is online

Users browsing this forum: Elliott, jojomickymack, Palnix777 and 26 guests