• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Why are summons using onThink to obey commands/follow instead of movement/onattack from master?

Tufte

Member
Joined
Nov 19, 2007
Messages
652
Reaction score
24
Location
Norway
I feel summons could be much more responsive if they were commanded to move/attack directly instead of using onthink. It feels really unresponsive because the summons always use like 0.5-1sec to respond.

Thoughts?
 
but that generates more lag :( in my opinion its really bad design you shouldnt use onthink unless you actually have to. its such an easy fix too, idk why even rl tibia does it this way.
 
to make it responsive you'd have to reduce the interval to something like 100ms, and still it wouldnt be the same giving it commands directly through movement and attack. idk most people probably dont care because summons are not used very much, but it could have been done better and for custom servers using summoner vocations its actually a big deal :p maybe i'll work on it myself if i get time
 
to make it responsive you'd have to reduce the interval to something like 100ms, and still it wouldnt be the same giving it commands directly through movement and attack. idk most people probably dont care because summons are not used very much, but it could have been done better and for custom servers using summoner vocations its actually a big deal :p maybe i'll work on it myself if i get time

I agree don't get me wrong I'm just making the point that it's not that simple it requires much more source editing to do it the way you're thinking, and onThink is constantly checking so it's probably easier to work out bugs with onThink
 
yeah its probably easier, but when you think about it, all you need to do is to take the code from onthink (which is only like 30-50 lines long i've read it) and use it whenever someone attack or change position. I believe someone already made the code for onMove here, and onattack already exists.
 
yeah its probably easier, but when you think about it, all you need to do is to take the code from onthink (which is only like 30-50 lines long i've read it) and use it whenever someone attack or change position. I believe someone already made the code for onMove here, and onattack already exists.
Yes Mock made the code for onMove.
Try it out and post here your results and if there's any issues I'm sure we can help you expand from it.
 
well i did it, but it seems like the main problem is the follow function, because even though im updating the new pos to the summons immidietly, it still uses 0.5seconds to actually start following. Idk why it is like this, because when a player follows a creature there is no delay.
 
nope, ive done it! :D there was another onthink for creatures (not players) to update goToFollow(). I removed it for summons and put it in movements, so now, the summons respond lightning fast! I've also moved the attack command from onthink directly to setAttackedCreature and onAttacking. my only problem is, there is no delay when you change target. so if you change between 2 targets your summons will attack instantly, which can be abused.

EDIT: nvm, im stupid. everything works, creatures obey commands immidietly on masters movement and on masters targeting and they attack just fine.
 
Last edited:
Back
Top