Thread Tools Display Modes
08-01-08, 05:39 PM   #1
Frstrm
A Murloc Raider
Join Date: Aug 2008
Posts: 5
GetGossipActiveQuests issue

Per wowwiki and other sites this command:
GetGossipAvailableQuests()
Should return all available quests in a format list below from a questgiver.
title1, level1, isLowLevel1,
title2, level2, isLowLevel2,
etc...

However when I use this command i'm only getting back 1 quest... I can't see the 2nd available quest until I make the first one active, then it registers the 2nd one as viable via this command.

ideas?
  Reply With Quote
08-02-08, 08:44 AM   #2
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
How do you fetch the data from GossipAvailableQuests() ?
Notice that the function does not return a list/array, but rather multiple variables:

This works perfectly for me:
Code:
local title1, level1, isLowLevel1, title2, level2, isLowLevel2 = GetGossipAvailableQuests()
So title1 holds the name of the first quest, title2 of the second, ...

If the solution doesn't help or you've tried it before, I'd like to see a part of your code
  Reply With Quote
08-04-08, 12:37 PM   #3
Frstrm
A Murloc Raider
Join Date: Aug 2008
Posts: 5
I'm sorting thru the variables via a parser...

example:
for i=1, #arg, 3 do
x = {};
arg[i] = x.name;
arg[i+1] = x.lvl;
arg[i+2] = x.lowlvl;
table.insert (table, x);
end

and that works, but the issue is that i'm only getting one quest back instead of the expected 2-3...

Prime test target is the Sun Offensive quest givers (Smith, and Herbalist).
Another test target is the aldor quest giver for accepting marks...

I'm going to probably scrap and rework the code but it seems like not all quest givers are setup the same way...

For example the quest giver for the Sunfury Attack Plans (another sun offensive quest) opens directly to the QUEST_DETAIL page.
How do you get the quest title information when it opens in that state?

If you have this working, maybe I can see an example of Your code. "}
  Reply With Quote
08-04-08, 03:24 PM   #4
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
Your variable assingments seem the wrong way round (should be "x.name = arg[i]" and so on, but I think it's a typo in your post ) - also the interesting part, the GetGossipAvailableQuests() is missing in your code excerpt.

Your loading the data into your arg-table with the following command, right?
Code:
local arg = { GetGossipAvailableQuests() }
Then I'm confused why it doesn't work - I've tested it on several quest givers, including Sun Offensive Smith and the Aldor one and it works perfectly.

For the QUEST_DETAIL page, this function should help: GetTitleText()
  Reply With Quote
08-04-08, 03:58 PM   #5
Frstrm
A Murloc Raider
Join Date: Aug 2008
Posts: 5
you are correct on typo's... my bad, should have just cut and pasted it...
I didn't want to list the entire function so...

but yes arg = {blahblah}

hmmm weird...
I will keep playing with it, if it's working for you, then it must be a syntax thing on my end.

Thanks for at least looking at it and verify that the function GetGossipAvailableQuests() works on the ones (NPC's) that i'm having issues with...

Much appreciated,
  Reply With Quote
08-04-08, 04:45 PM   #6
Frstrm
A Murloc Raider
Join Date: Aug 2008
Posts: 5
ok, new info...

This is my function:

function FTI_TabulateTest()
local x = {};
local arg = { GetGossipAvailableQuests() };
FTI_debug(#arg);
for i=1, #arg, 3 do
local temp = {};
temp.name = arg[i];
FTI_debug("name "..temp.name);
temp.type = arg[i+1];
FTI_debug("type "..temp.type);
table.insert(x, temp);
end
return x;
end

*FTI_debug() = print message to chat function

When I click on Smith Hauthaa in the Isles in Sun Offensive I get the following:
2
name Don't Stop Now...
type 70

I should be getting:
4
name Don't Stop Now...
type 70
name Ata'mal Armaments
type 70

the function is not returning the information on the 2nd quest!

IF you have this working, can you please list your function?
Thanks,

Last edited by Frstrm : 08-04-08 at 06:13 PM.
  Reply With Quote
08-05-08, 05:48 AM   #7
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
Okay, I've tested your code ingame and had the same problems. After changing it a bit, I figured out that "#arg3" is causing the problems, because it exits the loop after the first "nil" in arg. (And because all quests of Sun Offensive are lvl 70s, the third return-value was everytime "nil")

This new function works for me:
Code:
function FTI_TabulateTest()
    local x = {};
    local arg = { GetGossipAvailableQuests() };
    local i = 1
    while(arg[i]) do
        local temp = {};
        temp.name = arg[i];
        temp.type = arg[i+1];
        table.insert(x, temp);
        i = i + 3
    end
    return x;
end
  Reply With Quote
08-05-08, 11:49 AM   #8
Frstrm
A Murloc Raider
Join Date: Aug 2008
Posts: 5
Awesome!
so #arg doesn't count past any nils...

and Thanks!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GetGossipActiveQuests issue


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off