I know bits and bobs and I'm very eager to learn, however it's incredibly difficult for me to learn these things myself or from snippets that aren't exactly broken down or explained in laymans terms and so I am in need of a little nudge in the right direction.
My Objective - Relatively Smart Chat Bots
Code:
for(var/mob/M in view()) // if mob is in view
if(findtext(msg,M.name)) // and their name is said
for(var/t in chatchecker["Openers"])
if(findtext(msg,t)) // if they are told an opener
if(istype(M,/mob/NPC/A)) // and if they are NPC A
sleep(3)
I << "<B> [M.name]</B> replies: Hello"// they will respond
return
for(var/mob/M in view())
if(findtext(msg,M.name))
for(var/t in chatchecker["HRU-Queries"])
if(findtext(msg,t)) // if they are asked how they are
if(istype(M,/mob/NPC/A)) // and if they are NPC A
sleep(3)
I << "<B> [M.name]</B> replies: I'm fine thanks, you?"// they will respond
return
During runtime this will look something like...
A replies: Hello
or
Nakashima_Taiki says: How are you A?
A replies: I'm fine thanks, you?
Problem description:
If I use an opener the NPC will reply, if I ask them how they are they will reply but if I ask both in one sentence the NPC will only reply "Hello" why is this? and what can I do to fix this issue?
Bonus Problems, Issues & Queries (You don't have to help with this part)
I'm trying to figure out how I would be able to ask an NPC about another NPC, i.e "Hey A, have you seen B around?" I can't work out how to do it without it finding B's name in the text and triggering B's response when in view... any tips?
Thanks in advance,
- Nakashima_Taiki
P . S
If any rules were broken during my post or the text stretches the screen I apologise, this is my first post.
About finding B. "Have you seen B?" for/var/mob/M in world() if(M.name=="B") done.