Welcome!

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

Sign up now!

Suggestion ActorListener/GroundItemListener

Joined
May 29, 2016
Messages
18
Examples of methods(probably should rename them):

ActorListener:
onSpawned - when a new actor(npc/player) was found
onMoved - actor moved to another position
onDisappeared - when an npc is either killed or, for players, teleported away

GroundItemListener:
onDiscovered - when a new GroundItem is dropped or just appeared
onDisappeared - when an item is taken by either you or someone else or just disappeared


The only other option in the meanwhile is to use a seperate thread that watches actors/grounditems but this seems somehow.. well not good
 
Last edited:
Client Developer
Joined
Oct 12, 2015
Messages
3,781
What purpose would this serve given the functionality that is currently available?
 
Joined
May 29, 2016
Messages
18
What purpose would this serve given the functionality that is currently available?
Well this could make bots more dynamic in a way that they can interact with certain events simultaneously.
 
Client Developer
Joined
Oct 12, 2015
Messages
3,781
if(!Npcs.newQuery().within(new Area.Circular(Players.getLocal().getPosition(), 8)).names("Monster name").results().isEmpty()){
..............
}
 
Same thing for players.
 
Joined
May 29, 2016
Messages
18
if(!Npcs.newQuery().within(new Area.Circular(Players.getLocal().getPosition(), 8)).names("Monster name").results().isEmpty()){
..............
}
 
Same thing for players.
I know that; but without my suggestion you would need to make a thread that runs this query let's say every 100ms, which seems resource intensive (I don't know the computational complexity of that chained query but it seems at least quad/cubic)

Working with triggers just feels more naturally than working with tasks that are validated every loop.
 
Last edited:
Top