• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua NPC System Question

Laylee

Active Member
Joined
Dec 20, 2019
Messages
53
Reaction score
36
Good day everyone
I need help with a server I am playin
Is just a cosmetic thing
The npcs display their messages on the game window where the characters are
But the messages I type to the NPCs doesn't appear on the gamewindow, just NPC game chat

I post a copy of the system here

Is there a way to fix it?
Thank you

Yours Layee
 

Attachments

Solution
E
I want character messages to be displayed in blue above character while talking to an NPC
if that is really what you want, that is not possible, due to client limitation, blue character messages are only displayed in chat window or by NPCs, you can't have your own message to be blue and above your character
Explain more, The NPC messages appear in game-chat channel instead of NPC channel?
And where are you writing you messages which doesn't appear? default channel? NPC channel or game-chat channel?
 
PLEASE HELP I LACK OF COMPUTER SKILLS :(
WHATS SO FUNNY @Evil Puncker LOL

I don't know but maybe the change should be done in this code, in case anyone is lazy to download and search for it:

LUA:
-- Handles onCreatureSay events. If you with to handle this yourself, please use the CALLBACK_CREATURE_SAY callback.
    function NpcHandler:onCreatureSay(cid, class, msg)
        local callback = self:getCallback(CALLBACK_CREATURE_SAY)
        if(callback == nil or callback(cid, class, msg)) then
            if(self:processModuleCallback(CALLBACK_CREATURE_SAY, cid, class, msg)) then
                if(not self:isInRange(cid)) then
                    return
                end

                if(self.keywordHandler ~= nil) then
                    if((self:isFocused(cid) and (class == TALKTYPE_PRIVATE_PN or NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT)) or not self:isFocused(cid)) then
                        local ret = self.keywordHandler:processMessage(cid, msg)
                        if(not ret) then
                            local callback = self:getCallback(CALLBACK_MESSAGE_DEFAULT)
                            if(callback ~= nil and callback(cid, class, msg)) then
                                if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then
                                    self.talkStart[cid] = os.time()
                                else
                                    self.talkStart = os.time()
                                end
                            end
                        elseif(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then
                            self.talkStart[cid] = os.time()
                        else
                            self.talkStart = os.time()
                        end
                    end
                end
            end
        end
    end
 
Explain more, The NPC messages appear in game-chat channel instead of NPC channel?
And where are you writing you messages which doesn't appear? default channel? NPC channel or game-chat channel?

MY OWN CHRACTER MESSAGES dont display on game window while talking to an NPC thru the NPC Chat Window :c You know, the messages in blue
 
Thats how real tibia is. Messages you speak to NPC via NPC chat window are not displayed above your character.

Or am I wrong? And I hope I understood what you originally mean.

If I am wrong, double check if there are any tibia client settings that are being prevented from displaying.
 
Thats how real tibia is. Messages you speak to NPC via NPC chat window are not displayed above your character.

Or am I wrong? And I hope I understood what you originally mean.

If I am wrong, double check if there are any tibia client settings that are being prevented from displaying.

I can't remember It's been years since the last time I played real tibia. Back on the days all messages were yellow and everything was thru game window. And yes I do want the messages to be displayed on blue above my character.

I don't know but maybe the change should be done in this code, in case anyone is lazy to download and search for it:

LUA:
-- Handles onCreatureSay events. If you with to handle this yourself, please use the CALLBACK_CREATURE_SAY callback.
    function NpcHandler:onCreatureSay(cid, class, msg)
        local callback = self:getCallback(CALLBACK_CREATURE_SAY)
        if(callback == nil or callback(cid, class, msg)) then
            if(self:processModuleCallback(CALLBACK_CREATURE_SAY, cid, class, msg)) then
                if(not self:isInRange(cid)) then
                    return
                end

                if(self.keywordHandler ~= nil) then
                    if((self:isFocused(cid) and (class == TALKTYPE_PRIVATE_PN or NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT)) or not self:isFocused(cid)) then
                        local ret = self.keywordHandler:processMessage(cid, msg)
                        if(not ret) then
                            local callback = self:getCallback(CALLBACK_MESSAGE_DEFAULT)
                            if(callback ~= nil and callback(cid, class, msg)) then
                                if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then
                                    self.talkStart[cid] = os.time()
                                else
                                    self.talkStart = os.time()
                                end
                            end
                        elseif(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then
                            self.talkStart[cid] = os.time()
                        else
                            self.talkStart = os.time()
                        end
                    end
                end
            end
        end
    end


What I should change on that code?
 
I want character messages to be displayed in blue above character while talking to an NPC
if that is really what you want, that is not possible, due to client limitation, blue character messages are only displayed in chat window or by NPCs, you can't have your own message to be blue and above your character
 
Solution
if that is really what you want, that is not possible, due to client limitation, blue character messages are only displayed in chat window or by NPCs, you can't have your own message to be blue and above your character
Well I mean, you could spawn an NPC with the characters name (can you change the name of an NPC?), make the NPC say the message (to all the players in the area) and then remove the NPC...
But I find that a bit too 'extreme' for something that's just a cosmetic thing
 
Back
Top