NPC's and custom voice/sound?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Eleven Warrior
Posts: 739
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: NPC's and custom voice/sound?

Post by Eleven Warrior »

Aisuu and Mahric thxs for the solution and now this system has gone up a whole new level :) I hope more people can add to this thread this system is super cool guys. Anyway thxs for the help :D
User avatar
Eleven Warrior
Posts: 739
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: NPC's and custom voice/sound?

Post by Eleven Warrior »

Hi again errrr sorry about this but it is a awesome script. Right I know how to do things when a npc takes damage, but how do you make the npc invulnerable?

function VilP2()
mdNPC.script:registerNPC("md_npc_vil2")
mdNPC.script:setRoute("md_npc_vil2","wwwrwrfffflfff")
md_npc_vil2.monster:addConnector("onDamage",self.go.id,"Why2") -- This allows damage np-- :D Can this be changed so Monster takes no damage?--
end

Thxs again :)
User avatar
Aisuu
Posts: 61
Joined: Fri Oct 31, 2014 2:07 pm

Re: NPC's and custom voice/sound?

Post by Aisuu »

I dont quite understand what do you want. If you dont want npc to by dmg, just dont use onDamage hook and add to monster definition something like this:
SpoilerShow

Code: Select all

health = 999999,
protection = 999,
evasion = 999,
immunities = { "sleep", "blinded", "frozen", "knockback" },
resistances = {fire = "immune",cold = "immune",poison = "immune",shock = "absorb",physical = "immune"},
traits = { "elemental" },
User avatar
Slade
Posts: 45
Joined: Tue Oct 21, 2014 6:31 pm

Re: NPC's and custom voice/sound?

Post by Slade »

Nice work everyone, i love this community! :)
User avatar
Slade
Posts: 45
Joined: Tue Oct 21, 2014 6:31 pm

Re: NPC's and custom voice/sound?

Post by Slade »

bongobeat wrote:if you want to add custom voice to your npc, here is a site that allow you to hear what you write, in most languages.

http://www.oddcast.com/home/demos/tts/tts_example.php
you can then record what you hear with your computer/micro the sound.
it's quite good, I have use this for my mod toorum manor, to simulate some super computer voice.

Yeah thats pretty nice,but i have my own studio so i can record lots of voices by myself..so how i add them to monsters was my question, my bad. But thanks anyway!
User avatar
The_Morlock
Posts: 17
Joined: Sun Jun 02, 2024 6:15 am

Re: NPC's and custom voice/sound?

Post by The_Morlock »

mahric wrote: Sat Nov 22, 2014 5:46 pm 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.

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)
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.

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
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
Looks like some really good stuff. Is this demo asset package still available? The link isn't working for me.
My Project(s): Grimstone Keep, a reimagining of the 1995 Interplay game, Stonekeep.
Discord: https://discord.gg/AfZVYHc8JX
Patreon: https://patreon.com/GrimstoneKeep
Post Reply