Scripts / how do i make NPC talk?

Author
Message
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 27th Oct 2016 22:09
hi there!
i have two questions
1.
i want to make an intro video for a game and i need a character to talk a while in front of me so i can film this. i would make an own audio to play then but i need the animation. i have the character "dylan", an fbi agent (??) from the store. i need him to stand in front of me and just talk. i have seen the talking animations when i worked with it in fragmotion so it must be possible to trigger this somehow?

2.
how do i make this? the character is standing in front of me. i get "press e to talk" and when i press e the npc talks and some lines are displayed. then he keeps on talking and another line appears, after a few lines he finishes. this would be a nice alternative for a video, maybe better but i just got it working that the character talks but i can't start it with e.
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
Gtox
3D Media Maker
9
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 28th Oct 2016 14:31 Edited at: 28th Oct 2016 14:42
You need to get the animation frames for the talking animations, and then play them using the PlayAnimation(e) command. You'll need to use a flag of some sort to check whether or not the animation has started, otherwise the animation will start x times per second (whatever your frame rate is) and will never actually play.
For example, if your animation frames are 300-350, you could use this code.

You could use the Prompt command with a timer to show the text, with a variable to determine which line is displayed. The duration is in milliseconds.
For example

The timer duration will depend on how long that particular line takes to speak - you'll have to use trial and error to work this out.

Edit : I'm guessing that the talking animation is just lips moving, and not actual lip-synching, so you should use LoopAnimation(e) rather than PlayAnimation(e)
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 28th Oct 2016 15:36
Well, i do it this way ......


i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 28th Oct 2016 16:18
Great stuff Belidos,that realy cheered me up.he is one cool guy .

Dave
PM
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 29th Oct 2016 01:47 Edited at: 29th Oct 2016 02:01
@belidos: great this is what i want to do! trigger a video when standing in front of the NPC.
@gtox: this looks right! i have no idea how to even get a lua script working. can i copy these into a new lua file or do i need more? when i try the second script i don't get "press e to talk"

in frag motion i get the talking animation is 3000 - 3412 can that be?

can you help me make a complete script of this?

is it possible to display a line like in the second and make tha talking animations as long as the text is displayed?


EDIT
the first script works! thank you for this!
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
Gtox
3D Media Maker
9
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 29th Oct 2016 06:55
The second script should work as is, as I tried it myself - I'll attach it here.

Attachments

Login to view attachments
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 29th Oct 2016 12:46 Edited at: 29th Oct 2016 12:46
Quote: "@belidos: great this is what i want to do! trigger a video when standing in front of the NPC."


This is the pot I made when I first did it:
https://forum.game-guru.com/thread/215419

I used a piece of software called Crazy Talk 7, you take an image of a character, mark some points around it's face, eyes, mouth, nose etc, then you add the audio and It syncs the lips, after which you can add a background and save it as WMV. When I made that post you could get it free on the cover of a magazine, unfortunately that was some months ago so it's not free any more. However the newer version (Crazy Talk 8) is not that expensive ($49) and you can get a trial of it from here http://www.reallusion.com/crazytalk

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 29th Oct 2016 18:21
@gtox: yes, this also works now! thank you for this! now i can start working on my intro cutscene
@belidos: this is great but i don't want to spend more money for my project anymore. i had a budget that is already away. but i will take a look at the trial version. but ths is really a awesome idea
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti

Login to post a reply

Server time is: 2024-04-30 13:19:52
Your offset time is: 2024-04-30 13:19:52