Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Ways to differentiate local traps to other players traps

Joined
Jan 25, 2015
Messages
121
I'm wondering doing something using traps but stil don't knowing how to check if trap owns to local player. What do you suggest to this? This may envolves varps/varbits?
 
Java Warlord
Joined
Nov 17, 2014
Messages
4,906
The ownership of traps is resolved server sided, there is no way to check it with certainty
 
Last edited:
Joined
Jan 25, 2015
Messages
121
So how efficient do you think it would be to implement this by, for example, saving the trap position immediately when building and check only objects in that position etc?
 
Joined
Aug 23, 2015
Messages
1,961
So how efficient do you think it would be to implement this by, for example, saving the trap position immediately when building and check only objects in that position etc?
Here's how I would approach it (btw never made a hunter bot)
  • Attempt to set a trap
    • Delay until trap is set on that tile and your inv has one less trap
      • Add trap location to a list of your traps if delay returns true
  • Attempt to pick up a trap
    • Delay until your player is on/near that tile and animating to pick up trap
      • If this delay times out, this trap might not be yours, and should be removed from list
Will definitely need some fine tuning, or maybe an entirely different approach, but that's one way to approach it.
 
Joined
Jan 25, 2015
Messages
121
Good approach I think I'll implement something like this. However, I'm dealing with another problem where I have to get empty surroundings coordinates.

I tried check like this pseudo in a loop on target coordinates
Code:
GameObject entity = nearestFromQuery;

if (!coordinate.contains(entity.getInteractablePoint())){
    //something...
}

but always it walks to a coordinate that contains a trap.
 
Last edited:
Top