Page 1 of 1

Wander waypoints

Posted: Sun Nov 29, 2015 3:13 am
by Iyfgf
Usually the bot wander aimlessly (randomly) around when it' is going in wander mode, I have modified it to go for next mob within our wander radius if any.

Otherwise the functionality is as before.

Attached is a new version of classes/waypointlist_wander.lua

Best regard
Iyfgf

Update:
Turns out player wanders way off due to targeting, to keep it within wander radius I've added a check in the default target evaluation function in class/player.lua, function evalTargetDefault, before the MAX_TARGET_DIST check:

Code: Select all

	
	-- New, check if target is within wander radius
	if( __WPL.Mode == "wander" and distance(__WPL.OrigX, __WPL.OrigZ, target.X, target.Z) > __WPL.Radius ) then
		debug_target("target not within wander radius")
		return false;
	end
	
	-- check distance to target against MAX_TARGET_DIST
	if( distance(player.X, player.Z, target.X, target.Z) > settings.profile.options.MAX_TARGET_DIST ) then
		debug_target("target dist > MAX_TARGET_DIST to player")
		return false;			-- he is not a valid target
	end;

Re: Wander waypoints

Posted: Sun Nov 29, 2015 12:30 pm
by BlubBlab
nice idea