
NPC's and custom voice/sound?
Re: NPC's and custom voice/sound?
Nicely done Mahric. 

- Mysterious
- Posts: 226
- Joined: Wed Nov 06, 2013 8:31 am
Re: NPC's and custom voice/sound?
Hi mahric. The script you made is awesome and I was wondering how I could the Item given to the NPC be a certain item. Your script allows for any item. I would like to for example, if the player give the NPC a Staff then the se_ogre.script.WizardGone1() activates. I cant remember how to do that. I think it's like: if item==staff then etc... Could you help me on this please thxs 
function onGive(self, monster, item) --Would like this to be a certain item only--
hudPrint("Thank you for that "..item:getUiName())
se_ogre.script.WizardGone1()
return true

function onGive(self, monster, item) --Would like this to be a certain item only--
hudPrint("Thank you for that "..item:getUiName())
se_ogre.script.WizardGone1()
return true
Re: NPC's and custom voice/sound?
In the script you can check the name if the item that is given.
If it's not the item you want the NPC to accept, return false and the item will be kept on the cursor.
See the example below; it's what I use in the mod i'm working on now.
The name of the item the npc accepts is "md_sewer_package". You can replace it with anything you want to accept.
If it's not the item you want the NPC to accept, return false and the item will be kept on the cursor.
See the example below; it's what I use in the mod i'm working on now.
The name of the item the npc accepts is "md_sewer_package". You can replace it with anything you want to accept.
Code: Select all
function onGive(self, npc, item)
if item.go.name == "md_sewer_package" then
-- do magic stuff here, the right item was given
return true
end
hudPrint("I have no need for this item")
return false
end
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
Re: NPC's and custom voice/sound?
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.
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.
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: NPC's and custom voice/sound?
Hi mahric. This script is awesome man I was wonder is there a way that if the party attacks the npc then the npc turns on the party and attacks them? I do hope this is possible because this script has so much potential. Thxs for any help 

- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: NPC's and custom voice/sound?
SORRY BUMP 

Re: NPC's and custom voice/sound?
It's not possible at the moment, but I don't think it's too hard to add to the script, as long as you don't mind the monster will stay hostile once it is.
I don't have time to look at this right now, I hope I can get to it this weekend.
I don't have time to look at this right now, I hope I can get to it this weekend.
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: NPC's and custom voice/sound?
Thxs for the reply Mahric. It will be awesome, because if the party attacks the NPC they may fail a Quest or he gets the Shits and say imam not help you now unless you say sorry lol 

Re: NPC's and custom voice/sound?
It is possible and its very easy with a hook onDamage. Here is example if your using mahric npc scripts.
mdNPC.script:registerNPC("npc_neutral")
mdNPC.script:registerNPC("npc_neutral")
SpoilerShow
Code: Select all
npc_neutral.monster:addConnector("onDamage",self.go.id,"npcdamage")
function npcdamage(sender)
spawn("regular_mob",npc_neutral.level,npc_neutral.x,npc_neutral.y,npc_neutral.facing,npc_neutral.elevation,nil)
delayedCall(self.go.id,0.1,"killnpc")
end
function killnpc()
npc_neutral:destroy()
end
Re: NPC's and custom voice/sound?
Thanks for the solution Aisuu, now I don't have to worry how to fit this into my schedule!
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?