What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

Totem placement problem

ajw7989

New Member
Joined
Jun 8, 2012
Messages
90
Reaction score
1
I am not sure why but the totem placement logic is not working for me. I am trying to get it to cast ice spear totem which it does fine sometimes but it tries to cast it on the target instead of near it. This results in the target having to move before it will successfully cast the totem. I tried changing the distancepercent from 100 to various values such as 75 or .75 and it does not seem to affect the placement. Please fix this or let me know a solution.
 
Without any code, or reference to what you're doing, I can't really help.

What routine?
What code?
 
View attachment 8524 2013-11-04 08.04.txt

I have attached a recent log. What it does is try to cast the ice spear totem on the enemy itself and not between me and the enemy. So really the totem is only successfully if it tries to cast it when the enemy dies or moves.

private Vector2i CalculateTotemPlacement(Vector2i target, float distancePercent)
{
// If we're not normalized to 0-1, normalize it. (People like to use either 0.75 or 75 for values)
if (distancePercent > 1f)
{
distancePercent /= 75f;
}

Vector2 myPos = LokiPoe.Me.WorldPosition;
Vector2 theirPos = target.MapToWorld();

// 43 * 0.75
float distance = myPos.Distance(theirPos) * distancePercent;

Vector2 direction = theirPos - myPos;
direction.Normalize();

// So the direction is now normalized to 0-1.
// We can apply our distance percentage to this.
direction *= distance;

// Convert from world -> map. We only used the world coordinates for float precision.
return (myPos + direction).WorldToMap();
}
Above is the code I am talking about
I changed the distancepercent from 100f to 75f and various other values to try and get it to work.
 
You're changing the wrong code. The distancePercent /= 100f is to normalize the value from 0.0 to 1.0. You need to change the code that actually calls that method. Not the method itself.
 
You're changing the wrong code. The distancePercent /= 100f is to normalize the value from 0.0 to 1.0. You need to change the code that actually calls that method. Not the method itself.

Ah ok which part should I change to fix this. I left it as 100f before this problem started so not sure what to change. Thanks
 
I need this too. I've tried many different settings but it always ends up placing my totem right ontop of the mobs and it dies almost instantly which results in the bot spamming summon totem (since it dies) which means I dont life leech and eventually die :D
 
Just find calls to the function (you'll see CalculateTotemPlacement(0.75) or something similar) that 0.75 is a % of distance to the target. (Change it to 0.3 or 0.5 or any other % you want)
 
Back
Top