Jump to content
  • Objects inside vehicle


    camelot10
    • Version: All Product: WRobot General Type: Bug Status: Fixed

    im encountered major problem

    quest: http://wowhead.com/quest=39801

    its a stormheim first scenario. you need to do few stages on different ships. last ship its a flying vehicle. while on this ship character marked as ObjectManager.Me.PlayerUsingVehicle = true

    and main problem here that all WoWGameObjects on this ship have some kine of local coordinates, but all WoWUnit have global coordinates

    i found main root object its a http://www.wowhead.com/object=241630/the-skyfire

    but all local coordinates rotated according to root object.

    ObjectManager.GetNearestWoWGameObject(ObjectManager.GetWoWGameObjectByEntry return very wierd object.

    i made custom search for http://www.wowhead.com/object=243244/place-volatile-flare

    	WoWGameObject Fire()
    	{
    		var skyfire = Skyfire();
    		if (skyfire == null)
    			return null;
    
    		var fires = ObjectManager.GetWoWGameObjectByEntry(243244);
    		var i = 0;
    		foreach (var f in fires)
    		{
    			var l = f.Position;
    			var g = SkyfirePosition(l);
    			Logging.Write(" FIRE: " + f.Name + " local=" + l + " global=" + g + " dist=" + ObjectManager.Me.Position.DistanceTo(g) + " distZ=" + ObjectManager.Me.Position.DistanceZ(g));
    			i += 1;
    		}
    		Thread.Sleep(60 * 1000);
    		return null;
    		var fire = fires.OrderBy(f => (skyfire.Position + f.Position).DistanceTo(ObjectManager.Me.Position)).FirstOrDefault();
    		if (fire != null && fire.IsValid) // && fire.GetDistance < 10)
    		{
    			return fire;
    		}
    		return null;
    	}
    	WoWGameObject Skyfire()
    	{
    		var skyfire = Questing.FindObject(241630);
    		if (skyfire != null && skyfire.IsValid)
    		{
    			return skyfire;
    		}
    		return null;
    	}
    	Vector3 SkyfirePosition(Vector3 position)
    	{
    		var skyfire = Skyfire();
    		if (skyfire == null)
    			return position;
    
    		return skyfire.Position + position;
    	}

     

    this show me in log this:

    02:31:04 -  FIRE: Разместить нестабильную взрывчатую смесь local=-42,00801 ; 20,33346 ; -5,301661 ; "None" global=5029,452 ; 3161,753 ; 341,6329 ; "None" dist=65,96511 distZ=0,1261902
    02:31:04 -  FIRE: Разместить нестабильную взрывчатую смесь local=4,292825 ; 21,32118 ; 9,675672 ; "None" global=5075,753 ; 3162,741 ; 356,6102 ; "None" dist=26,25074 distZ=14,85114
    02:31:04 -  FIRE: Разместить нестабильную взрывчатую смесь local=11,65337 ; 22,25098 ; -5,199101 ; "None" global=5083,113 ; 3163,671 ; 341,7355 ; "None" dist=16,22754 distZ=0,02362061
    02:31:04 -  FIRE: Разместить нестабильную взрывчатую смесь local=30,94354 ; 13,90275 ; 9,602867 ; "None" global=5102,403 ; 3155,323 ; 356,5374 ; "None" dist=16,90774 distZ=14,77835
    02:31:04 -  FIRE: Разместить нестабильную взрывчатую смесь local=-11,01605 ; 26,19757 ; -5,261852 ; "None" global=5060,444 ; 3167,617 ; 341,6727 ; "None" dist=37,54287 distZ=0,08636475
    02:31:04 -  FIRE: Разместить нестабильную взрывчатую смесь local=43,98859 ; 11,11288 ; 9,266898 ; "None" global=5115,449 ; 3152,533 ; 356,2015 ; "None" dist=25,24469 distZ=14,44238
    02:31:04 -  FIRE: Разместить нестабильную взрывчатую смесь local=31,18011 ; -12,76628 ; 9,604154 ; "None" global=5102,64 ; 3128,654 ; 356,5387 ; "None" dist=29,02637 distZ=14,77963
    02:31:04 -  FIRE: Разместить нестабильную взрывчатую смесь local=1,801268 ; -22,6643 ; 9,656803 ; "None" global=5073,261 ; 3118,756 ; 356,5914 ; "None" dist=42,54895 distZ=14,83228
    02:31:04 -  FIRE: Разместить нестабильную взрывчатую смесь local=12,40635 ; -22,39768 ; -5,23788 ; "None" global=5083,866 ; 3119,022 ; 341,6967 ; "None" dist=35,06266 distZ=0,06240845
    02:31:04 -  FIRE: Разместить нестабильную взрывчатую смесь local=47,24242 ; -11,90643 ; 9,221651 ; "None" global=5118,702 ; 3129,513 ; 356,1562 ; "None" dist=36,09694 distZ=14,39713
    02:31:04 -  FIRE: Разместить нестабильную взрывчатую смесь local=-29,31074 ; -24,93864 ; -5,243851 ; "None" global=5042,149 ; 3116,481 ; 341,6907 ; "None" dist=63,66412 distZ=0,06838989

     

    but i stay right on needed gameobject http://www.wowhead.com/object=243244/place-volatile-flare

    GNMnlnR.png

    distance for one of http://www.wowhead.com/object=243244/place-volatile-flare must be < 5

    i assume there is some kind parent rotation applied to local gameobjects positions

    i think wrobot should add support for converting local position to global position according to parent rotation

    something like

    Vector3 WoWGameObject.PositionGlobal {get;} // if no parent return Position

     

    ps. i have no idea how i can find global position. maybe i can calculate somehow ?

     

     

     



    User Feedback

    Recommended Comments

    Not sure but try that:

        WoWGameObject Fire()
        {
            var skyfire = Skyfire();
            if (skyfire == null)
                return null;
    
            var fires = ObjectManager.GetWoWGameObjectByEntry(243244);
            var i = 0;
            foreach (var f in fires)
            {
                var l = f.Position;
                var g = GetWorldPosition(l);
                Logging.Write(" FIRE: " + f.Name + " local=" + l + " global=" + g + " dist=" + ObjectManager.Me.Position.DistanceTo(g) + " distZ=" + ObjectManager.Me.Position.DistanceZ(g));
                i += 1;
            }
            Thread.Sleep(60 * 1000);
            return null;
            var fire = fires.OrderBy(f => (GetWorldPosition(f.Position)).DistanceTo(ObjectManager.Me.Position)).FirstOrDefault();
            if (fire != null && fire.IsValid) // && fire.GetDistance < 10)
            {
                return fire;
            }
            return null;
        }
        WoWGameObject Skyfire()
        {
            var skyfire = Questing.FindObject(241630);
            if (skyfire != null && skyfire.IsValid)
            {
                return skyfire;
            }
            return null;
        }
        Vector3 GetWorldPosition(Vector3 position)
        {
            if (position == Vector3.Zero ||
                !ObjectManager.Me.IsValid ||
                !ObjectManager.Me.InTransport)
                return position;
    
            return position + (ObjectManager.Me.PositionWithoutType - ObjectManager.Me.PositionRelativeWithoutType);
        }

    After you need to interact manually like that:

            if (fire != null && fire.IsValid)
            {
                if (GoToTask.ToPosition(GetWorldPosition(fire.Position)))
                {
                    Interact.InteractGameObject(fire.GetBaseAddress);
                    Usefuls.WaitIsCastingAndLooting();
                }
            }

     

    Link to comment
    Share on other sites

    On 16.07.2017 at 6:19 PM, Droidz said:

    Not sure but try that:

    After you need to interact manually like that:

     

    its working but not precise. here video explained:

    green circles > fire places WoWGameObject drawed at runtime > GetWorldPosition(fire.position)

    green lines > i saved path on ship, converted in local positions and also draw it > GetWorldPosition(pathPoint.position)

    converting local position to global position is not good,  can vary up to ~10-15 meters (yards) ingame

     

     

    Link to comment
    Share on other sites

    When you are in GameObject radar 3d is not always accurate.

    Try this code if the ship move:

            if (fire != null && fire.IsValid)
            {
                for (int i = 0; i < 5; i++)
                {
                    if (GoToTask.ToPosition(GetWorldPosition(fire.Position)) && ObjectManager.Me.Position.DistanceTo(GetWorldPosition(fire.Position)) <= 4.5)
                    {
                        Interact.InteractGameObject(fire.GetBaseAddress);
                        Usefuls.WaitIsCastingAndLooting();
                    }
                }
            }

     

    Link to comment
    Share on other sites

    no problem with interact. problem with navigation inside vehicle.

    local coords converted to global coords > get shifted in about 5-10 meters/yards.

    something wrong with converting local to global.

    Link to comment
    Share on other sites

    On 19.07.2017 at 4:25 PM, Droidz said:

    When you are in GameObject radar 3d is not always accurate.

    Try this code if the ship move:

    
            if (fire != null && fire.IsValid)
            {
                for (int i = 0; i < 5; i++)
                {
                    if (GoToTask.ToPosition(GetWorldPosition(fire.Position)) && ObjectManager.Me.Position.DistanceTo(GetWorldPosition(fire.Position)) <= 4.5)
                    {
                        Interact.InteractGameObject(fire.GetBaseAddress);
                        Usefuls.WaitIsCastingAndLooting();
                    }
                }
            }

     

    here result

    also fight not working inside vehicle.

    02:54:05 - [Fight] Player Attacked by Пехотинец "Небесного огня" (lvl 110)
    [D] 02:54:06 - [Fight] BlackList Пехотинец "Небесного огня" during 30 sec
    02:54:09 - [Fight] Player Attacked by Пехотинец "Небесного огня" (lvl 110)
    [D] 02:54:10 - [Fight] BlackList Пехотинец "Небесного огня" during 30 sec

    attacked by mob. and do nothing. i think becouse of pathfinding.

    is there any possibility to add offmesh for dynamic object?

     

    Link to comment
    Share on other sites

    3 minutes ago, Droidz said:

    I need to test myself in game to found solution. If you know similar zone easy to reach.

    stormheim first quest scenario (hord and alliance) last two steps.

    ship in icecrown citadel.

    Link to comment
    Share on other sites

    7 hours ago, Droidz said:

    I need to test myself in game to found solution. If you know similar zone easy to reach.

    also any ship in world quest (broken isles) and invasion scenario at world quests

    Link to comment
    Share on other sites

    So, I bought for a month. Mr. ignores me via PM. Lasts more than a week before responding (if it's ever planned) fools against this. I asked him to refund my money, if not in other ways. I say: do not buy.

    Link to comment
    Share on other sites

    On 23.08.2017 at 6:15 PM, Droidz said:

    @camelot10 I don't forget you, I leveling a character (currently level 80)

    @nicky0412 If you want help, create your own post in the good forum category. 

    you can start demon hunter on server when you have any level 70 character on that server

    Link to comment
    Share on other sites

    1 hour ago, Droidz said:

    I cannot found this quest after demon hunter intro

    what zone choosed for questing in class hall ? azsuna? probably my fault with profile provided. check if its azsuna or stormheim ?

    Link to comment
    Share on other sites

            var skyfire = ObjectManager.GetWoWGameObjectByEntry(241630).FirstOrDefault();
            var fires = ObjectManager.GetWoWGameObjectByEntry(243244);
            wManager.Wow.Forms.UserControlMiniMap.LandmarksMiniMap.Remove("volatileflare");
            foreach (var f in fires)
            {
                var g = new Vector3(f.Matrix.M41, f.Matrix.M42, f.Matrix.M43); // Good position
                Logging.Write(" FIRE: " + f.Name + " matrix=" + f.Matrix + " local=" + f.Position + " global=" + g + " dist=" + ObjectManager.Me.Position.DistanceTo(g) + " distZ=" + ObjectManager.Me.Position.DistanceZ(g));
                wManager.Wow.Forms.UserControlMiniMap.LandmarksMiniMap.Add(g, "volatileflare", System.Drawing.Color.Chartreuse, 10, "", true);
            }

     

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...