ForceGossip() ?

90 Human Rogue
6455
So I've been getting increasingly aggravated at the fact that NPC gossip text is all but unviewable unless the NPC in question has multiple quests available or no quests left at all.

I finally managed to stumble onto this API thingy called ForceGossip().

How do I implement it so I can finally read the NPC gossip text again along with the lone quest offered, instead of the NPC skipping right to the quest dialogue even when they do have gossip text available? (Like Nesingwary's hunter team in Nagrand - you completely miss out on Fitz's story about how he got his embarrasing nickname while you're murdering roks for him. I only know about that one because the first time I did those quests the NPC gossip text still showed up by default, but somewhere around 4.3 that just went up in smoke.)

So yeah. Halp?
Reply Quote
90 Dwarf Mage
10875
Try replacing ForceGossip with a function that always returns true. This should stop the auto-selection of the first quest.
function ForceGossip()
return true
end


For reference, this is the default UI code that implements the auto-selection:function GossipFrame_OnEvent(self, event, ...)
if ( event == "GOSSIP_SHOW" ) then
-- if there is only a non-gossip option, then go to it directly
if ( (GetNumGossipAvailableQuests() == 0) and (GetNumGossipActiveQuests() == 0) and (GetNumGossipOptions() == 1) and not ForceGossip() ) then
local text, gossipType = GetGossipOptions();
if ( gossipType ~= "gossip" ) then
SelectGossipOption(1);
return;
end
end
[...]


http://wow.go-hero.net/framexml/16309/GossipFrame.lua#10

If ForceGossip() always returns true, not ForceGossip() will always be false, meaning the code inside the if statement is never run.
Edited by Choonster on 12/8/2012 6:25 AM PST
Reply Quote
90 Human Rogue
6455
... and I am a spectacular coding noob, so you're going to have to walk me through actually implementing that code snippet ...

Why Blizzard would make single-quest NPCs autoselect the quest and skip the gossip text without offering an Interface option is beyond me. Don't they care anymore about the work their developers put into writing up that gossip text?
Reply Quote
90 Dwarf Mage
10875
12/08/2012 06:47 AMPosted by Tuán
... and I am a spectacular coding noob, so you're going to have to walk me through actually implementing that code snippet ...

The best way would probably be to make a small AddOn out of it.

To make the AddOn copy/paste the code block below into an empty text document and save it as ForceGossip.toc. Make sure you don't save it as a .txt file. Do the same for the first code snippet in my original post, saving it as core.lua. Once you have both files, move them to a new folder called ForceGossip in your Interface\AddOns\ folder.

ForceGossip.toc## Interface: 50100
## Title: ForceGossip
## Author: Choonster
## Notes: Redefines the ForceGossip() function to prevent the Gossip UI from automatically selecting an available quest instead of showing the NPC's gossip text.
## Version: 1.0

core.lua


The TOC file tells the game how to load your AddOn and what to show the user about it in the character selection screen AddOn menu. Everything starting with ## is metadata about the AddOn, everything starting with # is a comment to be ignored by the game and everything else is treated as a code file to load and run (all file paths are relative to the AddOn's main directory).

This particular TOC file just loads the single core.lua file, which replaces the ForceGossip function.
Reply Quote
90 Human Rogue
6455
Phooey. I did exactly as you described, and no dice.
Reply Quote
90 Dwarf Mage
10875
12/08/2012 07:16 AMPosted by Tuán
Phooey. I did exactly as you described, and no dice.

Have you restarted your WoW client? WoW only loads files that existed when it was started.

If you see it in the character selection screen AddOn menu, what exactly doesn't work? Do you get any errors?
Reply Quote
90 Human Rogue
6455
The addon shows up in the character selection addon list, but it doesn't actually implement itself in-game.

I just tried it with Sky Sergeant Doryn up on Blackwind Landing by Skettis in Terokkar Forest. I know for a fact that he has one greeting gossip text and one only, since I've been trying out (the distressingly forgotten) GossipMonger addon. I right-click and he goes straight to the bombing daily. I do the quest and turn it in, right-click and he goes straight to the quest completion dialogue. I right-click a third time after the quest is over and done and ohai gossip text that I didn't get to see before.

And that's the part I'm trying to get a workaround for because my Warcraftian Lore OCD will not let me rest otherwise. -_-
Reply Quote
90 Dwarf Mage
10875
Strange. Try replacing the function with this:function ForceGossip()
print("ForceGossip!", (GetNumGossipAvailableQuests() == 0) and (GetNumGossipActiveQuests() == 0) and (GetNumGossipOptions() == 1) and not ForceGossip())
return true
end


What output do you see when talking to an NPC offering a single quest?

Edit: Forgot to return true. Fixed.
Edited by Choonster on 12/8/2012 7:35 AM PST
Reply Quote
90 Human Rogue
6455
I get no output at all, unless the print command puts the output somewhere else than my general chat pane.
Reply Quote
90 Dwarf Mage
10875
12/08/2012 07:45 AMPosted by Tuán
I get no output at all, unless the print command puts the output somewhere else than my general chat pane.

I just realised my previous function will probably cause a stack overflow error because it endlessly calls itself.

Try change the core.lua code to this:print("ForceGossip has been loaded!")

function ForceGossip()
print("ForceGossip!", (GetNumGossipAvailableQuests() == 0) and (GetNumGossipActiveQuests() == 0) and (GetNumGossipOptions() == 1) )
return true
end


If it's loading correctly, you should see "ForceGossip has been loaded!" printed in your chat when you login/reload your UI.
Reply Quote
90 Human Rogue
6455
Just as a heads-up, when I copy the text from your codeblock into Notepad to edit the file, I have to manually add in all the line breaks. Would this interfere?

EDIT: And I just tried right-clicking Dathris Sunstriker and Seer Voren'thal up on Scryer's Tier in Shattrath. Granted, Dathris doesn't have a gossip option (which I found out after accepting his Quel'Danas breadcrumb) but I know for a fact that Voren'thal totally has a gossip option.

The line "ForceGossip has been loaded!" shows up; that side, nothing.
Edited by Tuán on 12/8/2012 8:18 AM PST
Reply Quote
90 Dwarf Mage
10875
12/08/2012 08:08 AMPosted by Tuán
Just as a heads-up, when I copy the text from your codeblock into Notepad to edit the file, I have to manually add in all the line breaks. Would this interfere?

I'm not sure why that would happen, my code uses standard Windows line-endings. As long as there's at least one space or newline between keywords the interpreter shouldn't have any trouble running the code.

If you get any Lua errors, make sure you post them here. (Also make sure that they're actually enabled)
Edited by Choonster on 12/8/2012 8:17 AM PST
Reply Quote
90 Human Rogue
6455
Herpaderp, enabled lua errors display. Still nothing after the "ForceGossip has been loaded!" line in chat.
Reply Quote
90 Dwarf Mage
10875
The game should only try to auto-select the first gossip option (and hence call our new ForceGossip function) if there are no available or active quests from the NPC and there's only a single non-"gossip" gossip option (e.g. vendor or flight master but not the speech bubble icon gossip option).

I should have realised that something else is making it skip straight to the quest. It's possible that the game itself is immediately firing the QUEST_DETAIL event, causing the UI to show the quest instead of the gossip text.
Edited by Choonster on 12/8/2012 8:34 AM PST
Reply Quote
90 Human Rogue
6455
Herpaderp x2 combo, tried with mistah Shattrath Flight Master.

Chat yields "ForceGossip! true".
Reply Quote
90 Dwarf Mage
10875
Herpaderp x2 combo, tried with mistah Shattrath Flight Master.

Chat yields "ForceGossip! true".

And does it show his gossip text instead of skipping directly to the flight path window?
Reply Quote
90 Human Rogue
6455
Yes, it does. It did with the Gossipmonger addon installed as well.
Reply Quote
90 Dwarf Mage
10875
12/08/2012 08:42 AMPosted by Tuán
Yes, it does. It did with the Gossipmonger addon installed as well.

Well it's good that that's working even if it's not what you were asking for in the first place.

I'll have a look through the quest UI code and see what can be done.
Reply Quote
90 Dwarf Mage
10875
It looks like NPCs that skip directly to quests without showing the gossip text don't actually have any gossip text as far as the API is concerned. The GOSSIP_SHOW event never fires and gossip functions like GetGossipText, GetGossipOptions, GetGossipActiveQuests, etc. return info for the last NPC with gossip text you spoke to instead of the current NPC.

The only NPCs I've tested this with can't be spoken to after completing their quest, so that may be why the API doesn't give any results for them. Do you know of an NPC who skips straight to their quest but can be spoken to after completing that quest?
Reply Quote
90 Human Rogue
6455
Shado 'Fitz' Farstrider at the Nesingwary Safari in Nagrand is the most glaring example - he's the reason why I even noticed this in the first place. He's got several gossip texts that change as you turn in each quest in his windroc questline, one of which is an anecdote about how Hemet Sr gave him his embarrassing nickname. Nowadays I don't get the slightest squeak of gossip text out of 'Fitz' until I've killed the last big mama windroc and all that remains is his final congratulation to my hunting skillz.

Indeed, the gossip text skip happens to the entire hunting team, and plenty of other NPCs besides - both 1-60 Azeroth and Outland.
Edited by Tuán on 12/8/2012 9:57 AM PST
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]