Problem with GetCurrentMapContinent menu

User Tag List

Results 1 to 6 of 6
  1. #1
    tanis2000's Avatar Active Member
    Reputation
    39
    Join Date
    Feb 2009
    Posts
    123
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with GetCurrentMapContinent

    This is kind of funny.

    I used to have a block of LUA that I called through DoString and whose return value I read through GetLocalizedText.

    The code is this:
    Code:
    SetMapToCurrentZone(); local continent = GetCurrentMapContinent();
    Now, I have moved on to ditching all the GetLocalizedText stuff and I'm using my own LUA input handler to read all the return values. I have changed it to be:

    Code:
    SetMapToCurrentZone(); InputHandler(GetCurrentMapContinent());
    Considering I tested this with a toon in Northshire, the old code always returned 2 as I expected (2 being Azeroth) while the new code is returning 0.

    Any idea why it's behaving differently now?

    Problem with GetCurrentMapContinent
  2. #2
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How are you interpreting results from InputHandler?

  3. #3
    tanis2000's Avatar Active Member
    Reputation
    39
    Join Date
    Feb 2009
    Posts
    123
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
            public static List<string> Values = new List<string>();
    
            public static int InputHandler(uint luaState)
            {
                lock (Values)
                {
                    Values.Clear();
                    uint n = Lua_GetTop(luaState);
                    for (uint i = 1; i <= n; i++)
                    {
                        string res = Lua_ToString(luaState, i, 0);
                        Values.Add(res);
                    }
                }
                return 0;
            }
    And then I just go through a foreach on Values to check the output parameters.

  4. #4
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know to be honest. Make sure the result is valid at least.. Can't help you otherwise sorry, don't see anything obviously wrong

  5. #5
    tanis2000's Avatar Active Member
    Reputation
    39
    Join Date
    Feb 2009
    Posts
    123
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The funny thing is that calling InputHandler(GetTime()); actually returns the correct floating point value.. it's more like SetMapToCurrentZone() fails at setting the map to the correct one and goes to the main view with all the continents (which is the one with id = 0).

    Do you know if there's any other way of retrieving the name of the continent the player is in with LUA?

  6. #6
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by tanis2000 View Post
    The funny thing is that calling InputHandler(GetTime()); actually returns the correct floating point value.. it's more like SetMapToCurrentZone() fails at setting the map to the correct one and goes to the main view with all the continents (which is the one with id = 0).

    Do you know if there's any other way of retrieving the name of the continent the player is in with LUA?
    If you're using the code I posted (which it looks like you are), you need to make sure you're doing all those calls from the main thread, or you'll never receive anything back from GetTop/ToString. (You will, but it's very sporadic, so it's easier just to say, do it on the main thread.)

    Anyway, I just tested this myself, and it works fine.

Similar Threads

  1. Problems With Instance Switching
    By SandLOL in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 08-30-2006, 09:22 PM
  2. Problem with WPE
    By weedlord in forum World of Warcraft General
    Replies: 0
    Last Post: 08-14-2006, 03:35 AM
  3. Problem with BWH 1.11.2
    By gwl15 in forum World of Warcraft General
    Replies: 3
    Last Post: 08-11-2006, 05:37 PM
  4. Problem with CE.
    By Eldretch in forum World of Warcraft General
    Replies: 1
    Last Post: 08-08-2006, 06:49 PM
  5. I have problem with BHW 3.0
    By sunrize1 in forum World of Warcraft General
    Replies: 1
    Last Post: 07-17-2006, 08:49 AM
All times are GMT -5. The time now is 09:54 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search