View Full Version : Hidden Transmissions
Silromen
02-11-2006, 06:42 AM
Examining the Telepathy (http://www.wowwiki.com/Telepathy) addon, I noted that it allowed for hidden whispers... I've been developing an addon that expands the emotes available to players (EmotePack (http://ui.worldofwar.net/ui.php?id=2614#comments)).
The Telepathy addon allows for the hidden transmission of Chat and Whisper messages, is it possible to have hidden Say messages so the information only passes to addon users within earshot? If so, how? (Or some other way of doing similarly?)
Keion
02-11-2006, 12:21 PM
If you intend to use Say or Whisper then you can just hook the event that is triggered when such a message is recived/sent by for example using a prefix in from of the message such as EMOTEMOD for example. This way you can communicate between all the other users of the mod without them even noticing. However other players will be able to see this message as a normal text print which may be a problem if you want to use SAY channel.
There are hidden UI messages in the game as well, but that only works in the PARTY, RAID, BATTLEGROUND or GUILD channel.
You can look here for useful information (http://www.wowwiki.com/API_SendAddonMessage)
Silromen
02-11-2006, 07:34 PM
The main issue I'm having is that if I use a channel, then addon users can "hear" the sound effect throughout the area... That's not sensible for an emote.
I need to have the data be transmitted only to addon users within the range of the emote.
I would want to try to get the addon to be able to read directly from the emote to determine the sound, but with all of the variables, that makes it exceedingly difficult to implement. It also adds another layer of difficulty in that sound effects vary between races, genders, and classes.
Klishu
03-11-2006, 10:24 AM
I'm not sure if this is what you meant but can't you use the "emote" channel and then parse the text in the emote?
I mean, if you want to hear a sound for the /baa emote then when you get:
Klishu makes sounds similar to that of a sheep.
You can parse the text "makes sounds similar to that of a sheep." and play a sound respectively.
Like this the other users won't get anything unusuall on their screens like:
Klishu EP_SHEEP_SOUND
Silromen
03-11-2006, 10:31 AM
Pretty much... But the main issue is that there are additional variables within the emotes, like class references and gender references... Additionally, the sound effect varies between speakers (by race and gender), so it'd have to identify the race and gender of the speaker as well... That's what's boggling me most.
Example:
"Bob sneers at the Tauren warrior... Anyone up for Tauren Tacos?"
(Speaker Bob is a human male, so the sound referenced is human male...)
alternatively...
"Bob tells a joke."
(There are five different jokes Bob could be telling... Of course, it's important that the same joke is shared amost all listeners...)
Klishu
03-11-2006, 10:42 AM
You could try cheating a bit for this:
After you parse the message and everything (arg2 will be the name of the player that sent the emote):
TargetByName(arg2);
local unitRace = UnitRace("target");
local unitClass = UnitClass("target");
local unitSex = UnitSex("target");
-- Get any other information
TargetLastTarget();
-- Do something with the information like play the matching sound
Here we can assume that the other player is in range for targetting since we heard an emote which he sent so he's pretty close!
After you get the information needed it's up to you to put that info together and find the right sound to play. :)
Silromen
08-11-2006, 10:26 PM
Ok... lemme see if I've got this right... Here's a sample of theoretical code (My WoW account's currently inactive until christmas, so I can't test it :cry: ) Please, correct me if I'm wrong - I'm still a novice at this.
if (event == "CHAT_MSG_EMOTE") then
local emoteinfo = ChatTypeInfo["EMOTE"];
if ( string.find( arg1, " emote message") ) then --Checks for a specific emote. Determines the specific sound file.
result = string.find( arg1, "emote message");
SoundFile = "sound.mid"
elseif ( string.find( arg1, " emote message") ) then
result = string.find( arg1, "emote message");
SoundFile = "sound.mid"
end
if ( UnitName("target") ) then
Targeting = "1"
end
TargetByName(arg1);
EmoteRace = UnitRace("target")
if ( UnitSex("target") == 2 ) then
EmoteGender = "Male"
elseif ( UnitSex("target") == 3 ) then
EmoteGender = "Female"
else
DEFAULT_CHAT_FRAME:AddMessage("|cffFF0000EmotePack Error. Cannot recognize speaker gender.", 1.0, 1.0, 0.5);
end
if (result ~= nil) then --Uses the speaker's race and gender to determine which version of the sound file should be played.
PlaySoundFile("Interface\\AddOns\\EmotePack\\Sounds\\" ..EmoteRace.. "\\" ..EmoteGender.. "\\" ..SoundFile.. "");
end
--The following code is intended to "clean the slate" for the next emote.
if Targeting = "1" then
TargetLastTarget();
Targeting = "0"
end
emoterace = ""
emotegender = ""
result = ""
end
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.