NPC's and custom voice/sound?
NPC's and custom voice/sound?
Hey! I had an idea about npc's and found this :
viewtopic.php?f=14&t=5144
https://www.youtube.com/watch?v=o2BZoFmKlVk
So.. is this working on new editor? And are there any way to add my custom sound effects/voices for those npc's or enemies?
Thanks for answers already.
viewtopic.php?f=14&t=5144
https://www.youtube.com/watch?v=o2BZoFmKlVk
So.. is this working on new editor? And are there any way to add my custom sound effects/voices for those npc's or enemies?
Thanks for answers already.
Re: NPC's and custom voice/sound?
There's a basic version running that enabled you to tell NPCs to walk somewhere, but the interaction part isn't done yet.
I'll look into it, but I don't dare to promise to meet a deadline
I'll look into it, but I don't dare to promise to meet a deadline
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
Re: NPC's and custom voice/sound?
Hey mahric, for NPC, i'm thinking for two simples solution :
- Clickable + offset + size + onClick(NPC)
- Control panel ( OnDrawGui ) - Button "Communicate" - Hook onComm(NPC) -> brain = "NPC"
- Clickable + offset + size + onClick(NPC)
- Control panel ( OnDrawGui ) - Button "Communicate" - Hook onComm(NPC) -> brain = "NPC"
Re: NPC's and custom voice/sound?
Trying your "clickable" suggestion as we speak
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
Re: NPC's and custom voice/sound?
Already "tried" with my clickable doors, and see result ( It was a test to learn clicklable class and funtions utility )
Re: NPC's and custom voice/sound?
I've uploaded a version for LoG2 that includes almost ALL (40+) of the basic monsters. (video here or download demo and source here)
With a few lines of scripting it's easy to interact with them, give them something or command them to move.
You can register functions that are called if the player clicks on the npc or gives something to the npc.
Warning: these functions are only called if the npc is not moving.
For more info, check the source in the example from the link above.
Edit: It is not possible to add custom voices or sounds to the npcs
With a few lines of scripting it's easy to interact with them, give them something or command them to move.
Code: Select all
mdNPC.source:registerNPC("myNPC") -- registers the npc at the framework
mdNPC.source:setRoute("myNPC", "f") -- moves the npc one square forward (use 'f' for forward, 'l' for turn left, 'r' for turn right and 'w' to wait a tiny bit)
Warning: these functions are only called if the npc is not moving.
Code: Select all
mdNPC.source:setOnInteract("myNPC", myScriptEntity.script.myFunction) -- Means: Call the 'myFunction' in the script 'myScript' if the npc 'myNPC' is clicked on while the player has NO item on the cursor
mdNPC.source:setOnGive("myNPC", myScriptEntity.script.myFunction) -- Means: call the 'myFunctoin' in the script 'myScript' if the npc 'myNPC' is clicked while the player HAS an item on the cursor
Edit: It is not possible to add custom voices or sounds to the npcs
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
Re: NPC's and custom voice/sound?
You made it again mahric Sticked in the superthread ^^
Are you sure ? If you define another NPC with attached script on hooks AND adding sounds/voices, i think it'll be possible. More else, remember that in LoG2, sounds injections are really easier, so adding a custom sound ( declared before of course ) for this or that action is pretty easy, no ?mahric wrote:Edit: It is not possible to add custom voices or sounds to the npcs
Re: NPC's and custom voice/sound?
I didn't mean that it was impossible at all, just that I didn't built in any specific support for that. The way you describe should be very doable indeed.Doridion wrote:Are you sure ? If you define another NPC with attached script on hooks AND adding sounds/voices, i think it'll be possible. More else, remember that in LoG2, sounds injections are really easier, so adding a custom sound ( declared before of course ) for this or that action is pretty easy, no ?
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
- cromcrom
- Posts: 549
- Joined: Tue Sep 11, 2012 7:16 am
- Location: Chateauroux in a socialist s#!$*&% formerly known as "France"
Re: NPC's and custom voice/sound?
I will give it a try, but it looks really amazing, thank you so much for sharing.
A trip of a thousand leagues starts with a step.
- Eleven Warrior
- Posts: 745
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: NPC's and custom voice/sound?
This script is totally awesome imam using it right now to the max so much potential. Man thxs for this