The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to deaf a NPC?
Author Message
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #1
How to deaf a NPC?
In some circunstances I would be interested that my NPCs couldn´t hear anything my players could say them.

For example, if I hide my mercenary NPCs, I don´t want anyone can speak with them when they are hidden. But they need to talk when they are not hide.

I can not remove a TSPEECH from a NPC because is a read only value, any ideas?
03-06-2013 02:15 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: How to deaf a NPC?
Inside your tspeech, add

PHP Code:
ON=*
    IF <
flags> & statf_hidden
        
return 1
    
endif 


tested with an alchemist Tongue
03-06-2013 03:53 AM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #3
RE: How to deaf a NPC?
The problem is after that code, the npc don´t hear anything.

Either if it is true or false that conditional, don´t enter in other words like ON=Britain, or ON=Yew because have entered before ON=*
03-06-2013 07:29 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: How to deaf a NPC?
That is what you asked for...

(03-06-2013 02:15 AM)Gil Amarth Wrote:  In some circunstances I would be interested that my NPCs couldn´t hear anything my players could say them.

For example, if I hide my mercenary NPCs, I don´t want anyone can speak with them when they are hidden. But they need to talk when they are not hide.

I can not remove a TSPEECH from a NPC because is a read only value, any ideas?

[Image: 2nis46r.jpg]
03-06-2013 07:33 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #5
RE: How to deaf a NPC?
In some circunstances, not always.

The NPC don´t hear anything with that code even if he is not hidden. Because when goes into ON=*, don´t enter in others ON= words even is not hidden.
03-06-2013 07:45 AM
Find all posts by this user Like Post Quote this message in a reply
sco
Apprentice
*

Posts: 38
Likes Given: 0
Likes Received: 3 in 1 posts
Joined: Mar 2012
Reputation: 7

Elantharil

Post: #6
RE: How to deaf a NPC?
Code:
[speech spk_hidden_silence]
ON=*
    IF <flags> & statf_hidden
        return 1
    endif

Have a speechblock like the above.

Then add it to your NPCs, either on your custom hiding event or on=@create with:

Code:
on=@create
speech +spk_hidden_silence

Speech added with speech command are checked before any tspeech.
03-06-2013 10:12 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #7
RE: How to deaf a NPC?
Maybe setup context menus to communicate with them when they are hidden.
03-06-2013 04:09 PM
Find all posts by this user Like Post Quote this message in a reply
BladeCraft
Apprentice
*

Posts: 42
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 2



Post: #8
RE: How to deaf a NPC?
I believe if you want the NPC to respond to certain things while hidden, you can put them before the on=* in the speech block and it checks in order.

on=Britain
say hi

on=reveal thyself
say ok fine

on=*
if hidden, return 1

Or, when they hide, add a speech event then and when revealed, remove it?

[Image: topsitesbanner4.gif]
03-07-2013 11:59 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)