Post by chainsawpenguin on Feb 3, 2017 5:16:53 GMT
Good evening, team!
Okay, I've got some programming chops (full disclosure, I have a math degree and professionally I'm a really specialized software developer), BUT my day-to-day work is with large, enterprise-scale databases (I built a huge one for California's individual income tax agency, for example), so my brain tends to go "make a database out of it" before it makes any other decision. That said, I can probably sit down and bang out a C# script for what I'm trying to do, but I figured I'd at least ask a question here before I started banging my head against the wall.
I'm looking to create a script to tell NPC_1 to move from Point A to Point B, perform action X, and then move back to Point A (go whack on a tree for a while, have it fall down, collect the lumber, and take it back to a wood pile... and have the tree resurrect while he's stacking the logs). But then I want the player to be able to interrupt, with at least three distinct responses:
1 - Oh, hallo! What can I do for ye, stranger? -- NPC is a quest giver and launches a dialogue with the player
2 - Ach! I've got no time for ye, stranger. -- NPC is not a quest giver, but I want him to react to the player trying to talk to him, and then carry on
3 - YOU DARE!! -- NPC becomes violent when disturbed. Maybe he's got a hangnail, or something, but if the player talks to him, it is ON.
So my thought process is this:
First, script the walking/chopping/dropping. Then make sure that those states are in the animator controller, and that they're invoked in the right areas of the scene. But also make sure that they don't overwrite the actual Invector controller.
Second, script the "interruption" with the basic dialogue steps. Stop your route, face the player, display your dialogue, wait until the player responds, and when the dialogue is concluded, move on with your life, you wood-chopping FIEND.
Third, script the "interruption results in combat" scenario (as the "interruption results in nothing", or scenario 2 above, just short-circuits the dialogue path, so it's effectively the same as path 1 with fewer options, now that I think about it...), which will kick in the Invector fightin' logic.
So when I sat down and started to think, "Now, how would I do this??", it did immediately occur to me, "HEY! I bet other people have done this...."
If you have words of wisdom on this topic, I am all ears, is what I'm saying!
Completely Unrelated But I Don't Want To Start Another Thread:
My game is about pirates. I want the player to walk onto a ship and then have the control shift from the actual humanoid out to the actual full ship, so that the player model is still commanding the ship (wandering around, or even locked in place in a command position), but the actual model being controlled is now the ship, but then when the player pulls the ship into the dock, it reverts back to the Invector controller...
Have you instituted a "vehicle override" in your project? If so, how did you do it? If not, how WOULD you do it??
Cheers!
~~ chainsawpenguin ~~
PS If I (or others) come up with solutions for the questions above, is it permissable to post the code here in the forums? I'm not sure what the ramifications are, specifically for the second request where it will escape from the Invector Controller code and then revert to it, so I don't want to solicit or post anything that would upset any of the people who have worked so hard to make the Invector stuff happen!! Thanks!
Okay, I've got some programming chops (full disclosure, I have a math degree and professionally I'm a really specialized software developer), BUT my day-to-day work is with large, enterprise-scale databases (I built a huge one for California's individual income tax agency, for example), so my brain tends to go "make a database out of it" before it makes any other decision. That said, I can probably sit down and bang out a C# script for what I'm trying to do, but I figured I'd at least ask a question here before I started banging my head against the wall.
I'm looking to create a script to tell NPC_1 to move from Point A to Point B, perform action X, and then move back to Point A (go whack on a tree for a while, have it fall down, collect the lumber, and take it back to a wood pile... and have the tree resurrect while he's stacking the logs). But then I want the player to be able to interrupt, with at least three distinct responses:
1 - Oh, hallo! What can I do for ye, stranger? -- NPC is a quest giver and launches a dialogue with the player
2 - Ach! I've got no time for ye, stranger. -- NPC is not a quest giver, but I want him to react to the player trying to talk to him, and then carry on
3 - YOU DARE!! -- NPC becomes violent when disturbed. Maybe he's got a hangnail, or something, but if the player talks to him, it is ON.
So my thought process is this:
First, script the walking/chopping/dropping. Then make sure that those states are in the animator controller, and that they're invoked in the right areas of the scene. But also make sure that they don't overwrite the actual Invector controller.
Second, script the "interruption" with the basic dialogue steps. Stop your route, face the player, display your dialogue, wait until the player responds, and when the dialogue is concluded, move on with your life, you wood-chopping FIEND.
Third, script the "interruption results in combat" scenario (as the "interruption results in nothing", or scenario 2 above, just short-circuits the dialogue path, so it's effectively the same as path 1 with fewer options, now that I think about it...), which will kick in the Invector fightin' logic.
So when I sat down and started to think, "Now, how would I do this??", it did immediately occur to me, "HEY! I bet other people have done this...."
If you have words of wisdom on this topic, I am all ears, is what I'm saying!
Completely Unrelated But I Don't Want To Start Another Thread:
My game is about pirates. I want the player to walk onto a ship and then have the control shift from the actual humanoid out to the actual full ship, so that the player model is still commanding the ship (wandering around, or even locked in place in a command position), but the actual model being controlled is now the ship, but then when the player pulls the ship into the dock, it reverts back to the Invector controller...
Have you instituted a "vehicle override" in your project? If so, how did you do it? If not, how WOULD you do it??
Cheers!
~~ chainsawpenguin ~~
PS If I (or others) come up with solutions for the questions above, is it permissable to post the code here in the forums? I'm not sure what the ramifications are, specifically for the second request where it will escape from the Invector Controller code and then revert to it, so I don't want to solicit or post anything that would upset any of the people who have worked so hard to make the Invector stuff happen!! Thanks!