Page 3 of 3

Re: NPC's and custom voice/sound?

Posted: Sat Dec 20, 2014 12:12 am
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

Re: NPC's and custom voice/sound?

Posted: Mon Dec 22, 2014 5:15 am
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 :)

Re: NPC's and custom voice/sound?

Posted: Mon Dec 22, 2014 10:21 am
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" },

Re: NPC's and custom voice/sound?

Posted: Mon Dec 22, 2014 5:26 pm
by Slade
Nice work everyone, i love this community! :)

Re: NPC's and custom voice/sound?

Posted: Mon Dec 22, 2014 5:46 pm
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!

Re: NPC's and custom voice/sound?

Posted: Wed Jul 03, 2024 3:33 pm
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.