8:32pm - Late start tonight but better late than not at all.
My current problem is architecture, so I've got some thinking to do. Visible thinking!
First off, I'm trying to figure out how to handle the player clicking on a far away NPC, and then clicking on a different NPC before they get to the first one. I want the NPC to wait, but to resume its behavior if the player changes focus.
So, I'm thinking that the player should have a 'Target' field that keeps track of its current objective, and when it changes objective it should let the previous objective know that it's nolonger the target.
8:54pm - Geez I'm having trouble focusing. I'm just wandering all over in my head and on the net. I can do it though, I'm confident.
So the next problem is figuring out how to do the communication between the player and the objective.
I could have the player object use a function to tell its new target to sign up for a signal the player has, after sending that signal to let the old target know it's not the target anymore.
That should work.
The other big thing I'm trying to figure out is, when the player has multiple steps to get to an NPC and interact with them, how do I handle that? I'm thinking I'll give the player object an ordered list of commands to follow, and replace them if the player chooses a new target before they're completed.
So like, if the player clicks on an NPC they'll get the commands "Approach Target X" and "Talk to Target X" and the former will only move to the latter when its in range to talk.
When the second command runs, the player object will run a function on the target NPC to do its 'interaction' lets say. That way anything can have an 'interaction' function but they can have a different result. The interaction function on an NPC will make their conversation dialogue appear, and then you can tell them what you want.
9:08pm - I'm trying not to jump into bed now, but I'm not sure I can resist the urge. I've made some progress and that's satisfying the need to work, but I've barely done anything despite how difficult thinking of those simple sounding things was.
I'm also thinking about a problem that results from this system, in that I also have to make some sort of 'pick a work location' system for showing the NPC where to work when you're talking to them. Otherwise, what if you're talking to them from far enough away that you can't easily click on the carrot patch? Now, that's not likely to happen, but I want to future proof this for when I have more than one carrot patch or whatever.
9:57pm - Alright time to wrap up again. I've got dinner and other things to do now.
My current problem is architecture, so I've got some thinking to do. Visible thinking!
First off, I'm trying to figure out how to handle the player clicking on a far away NPC, and then clicking on a different NPC before they get to the first one. I want the NPC to wait, but to resume its behavior if the player changes focus.
So, I'm thinking that the player should have a 'Target' field that keeps track of its current objective, and when it changes objective it should let the previous objective know that it's nolonger the target.
8:54pm - Geez I'm having trouble focusing. I'm just wandering all over in my head and on the net. I can do it though, I'm confident.
So the next problem is figuring out how to do the communication between the player and the objective.
I could have the player object use a function to tell its new target to sign up for a signal the player has, after sending that signal to let the old target know it's not the target anymore.
That should work.
The other big thing I'm trying to figure out is, when the player has multiple steps to get to an NPC and interact with them, how do I handle that? I'm thinking I'll give the player object an ordered list of commands to follow, and replace them if the player chooses a new target before they're completed.
So like, if the player clicks on an NPC they'll get the commands "Approach Target X" and "Talk to Target X" and the former will only move to the latter when its in range to talk.
When the second command runs, the player object will run a function on the target NPC to do its 'interaction' lets say. That way anything can have an 'interaction' function but they can have a different result. The interaction function on an NPC will make their conversation dialogue appear, and then you can tell them what you want.
9:08pm - I'm trying not to jump into bed now, but I'm not sure I can resist the urge. I've made some progress and that's satisfying the need to work, but I've barely done anything despite how difficult thinking of those simple sounding things was.
I'm also thinking about a problem that results from this system, in that I also have to make some sort of 'pick a work location' system for showing the NPC where to work when you're talking to them. Otherwise, what if you're talking to them from far enough away that you can't easily click on the carrot patch? Now, that's not likely to happen, but I want to future proof this for when I have more than one carrot patch or whatever.
9:57pm - Alright time to wrap up again. I've got dinner and other things to do now.