ZoneRegion.NearestChild problem.

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
blackwinter
GamingTools Subscriber
Posts: 74
Joined: Sun Jun 25, 2006 8:29 am

ZoneRegion.NearestChild problem.

Post by blackwinter » Thu Jul 09, 2009 8:12 pm

${ZoneRegion.NearestChild[${Me.ToActor.Loc}]}

This is not working right sometimes. It will get the point far away.

makes my char running just like mad.

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Thu Jul 09, 2009 8:45 pm

Can you produce a code sample I can use to test for this issue? I have no way of reproducing it otherwise. If it involves loading an extension and playing a specific game I can't guarantee anything (in which case you may need to get some assistance on that extension's forum, etc)

blackwinter
GamingTools Subscriber
Posts: 74
Joined: Sun Jun 25, 2006 8:29 am

Post by blackwinter » Fri Jul 10, 2009 7:57 am

ok,another question
Can I use
${NavPath.NearestPoint[${Me.ToActor.Loc}]}

to replace

${ZoneRegion.NearestPoint[${Me.ToActor.Loc}]}

what's difference??

As ZoneRegion.NearestPoint is alway the point I stand ,no matter it's mapped or not.

blackwinter
GamingTools Subscriber
Posts: 74
Joined: Sun Jun 25, 2006 8:29 am

Post by blackwinter » Sat Jul 11, 2009 7:04 am

It's EQ2 ,I think it's something about coordinates.
I saw this in wiki

point3f NearestPoint[x,y,z]: Retrieves the nearest point to the given location (coordinates may be ommitted to use x,0,0 or x,y,0)

In eq2 it sould be x,z,y ,it mean x,0,y. it's so different from other games.

So I get this error

mapping data between your current (-1191.727783,-990.426147,637.838196) and the nearest CenterPoint (-1192.208984,-991.350830,12.513396) is within 625.325684

blackwinter
GamingTools Subscriber
Posts: 74
Joined: Sun Jun 25, 2006 8:29 am

Post by blackwinter » Sat Jul 11, 2009 7:35 am

And I am sure I have mapped points within 20 m.

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sat Jul 11, 2009 7:59 am

There may be bugs in the old and busted nav system, and since it has been deprecated and unsupported for years, there is no plan to solve any of those bugs. You should switch to LavishNav if you are wanting support -- sorry

blackwinter
GamingTools Subscriber
Posts: 74
Joined: Sun Jun 25, 2006 8:29 am

Post by blackwinter » Sat Jul 11, 2009 7:03 pm

It's just LavishNav!

From InnerSpace\Scripts\EQ2Navigation\EQ2Nav_Lib.iss



Code: Select all

	method MoveToNearestRegion(float FinalDestX, float FinalDestY, float FinalDestZ)
	{
	    This.CheckLocPassCount:Set[0]
		;declarevariable NextRegion lnavregionref local ${This.NearestRegion[${Me.ToActor.Loc}]}
		variable lnavregionref ZoneRegion
		variable lnavregionref NextRegion
		variable float NearestRegionDistance
		ZoneRegion:SetRegion[${LNavRegion[${Mapper.ZoneText}]}]
		NextRegion:SetRegion[${ZoneRegion.NearestChild[${Me.ToActor.Loc}]}]
		NearestRegionDistance:Set[${Math.Distance[${Me.ToActor.Loc},${NextRegion.CenterPoint}]}]
		
		/*  This function is not working exactly right -- reported to Lax
		echo "Me.ToActor.Loc: ${Me.ToActor.Loc}"
	    echo "NearestChild: ${ZoneRegion.NearestChild[${Me.ToActor.Loc}].FQN} (Distance: ${NearestRegionDistance})"
	    variable index:lnavregionref NearestChildren
	    echo "NearestChildren: ${ZoneRegion.NearestChildren[NearestChildren,20,${Me.ToActor.Loc}]}"
	    echo "NearestChildren[1]: ${NearestChildren.Get[1].FQN}"
		variable index:lnavregionref DescendantsWithin
		echo "DescendantsWithin: ${ZoneRegion.DescendantsWithin[DescendantsWithin,20,${Me.ToActor.Loc}]}"
		echo "DescendantsWithin[1]: ${DescendantsWithin.Get[1].FQN}"
		variable index:lnavregionref ChildrenWithin
		echo "ChildrenWithin: ${ZoneRegion.ChildrenWithin[ChildrenWithin,20,${Me.ToActor.Loc}]}"
		echo "ChildrenWithin[1]: ${ChildrenWithin.Get[1].FQN}"
		*/
		
		
		if ${NearestRegionDistance} > 50
		{
		    This:StopRunning
		    face ${FinalDestX} ${FinalDestY} ${FinalDestZ}
		    This.MeMoving:Set[FALSE]		
		    This:Output["The nearest mapped CenterPoint (${NextRegion.CenterPoint}) is ${NearestRegionDistance} away.  More mapping data is required before continuing"]
		    return
		}

blackwinter
GamingTools Subscriber
Posts: 74
Joined: Sun Jun 25, 2006 8:29 am

Post by blackwinter » Sat Jul 11, 2009 7:05 pm

lol, I just notice this in the script

/* This function is not working exactly right -- reported to Lax

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sun Jul 12, 2009 9:12 am

You were specifically saying NearestPoint, which does not exist in LavishNav, so I was a bit confused as to what you were doing.

If it's with LavishNav, I would need a test case that proves that it is broken, I can't just guess at how to reproduce the issue you are saying exists. What if it's doing exactly what it's supposed to do, but someone thought it was supposed to find the nearest descendant, not just the nearest child? Also, if it finds a child that you are *inside*, then it is automatically "the nearest", even if you are closer to the center point of another region. So anyway, I either need data that shows the bug, or I can't verify it at all.

blackwinter
GamingTools Subscriber
Posts: 74
Joined: Sun Jun 25, 2006 8:29 am

Post by blackwinter » Sun Jul 12, 2009 5:12 pm

no, I just asked if I could use NearestPoint to replace that broken one, then I found it's the old system, doesn't work.

Post Reply