• 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!

Lua 0.3.7 Checking time for distance effect to reach it's intended destination

Xikini

I whore myself out for likes
Senator
Premium User
Joined
Nov 17, 2010
Messages
6,788
Solutions
581
Reaction score
5,354
Lua:
local a = getCreaturePosition(cid)
local b = getCreaturePosition(target)
doSendDistanceShoot(a, b, CONST_ANI_CAKE)
A to B could be 5 tiles, or it can be 100 tiles

There is definitely a time difference depending on the distance traveled.

How do I calculate the time required to traverse the distance?
or
Is there some sort of 'trigger' I can use to tell me when the effect has reached it's destination?
 
Solution
Engine itself doesn't give a damn about the distance, it is not calculated there, this is the client job.
Try to follow that doSendDistanceShoot effect in the TFS, you'll probably end at the protocolgame sending the opcode, coordinates and effect id.
Client will receive that info and parse it accordingly, so no, per se you are unable to get notification about missle reaching its destination. Unless you program client to send such notification to the server (or calculate the time needed for projectile to reach desired tile inside engine).
Engine itself doesn't give a damn about the distance, it is not calculated there, this is the client job.
Try to follow that doSendDistanceShoot effect in the TFS, you'll probably end at the protocolgame sending the opcode, coordinates and effect id.
Client will receive that info and parse it accordingly, so no, per se you are unable to get notification about missle reaching its destination. Unless you program client to send such notification to the server (or calculate the time needed for projectile to reach desired tile inside engine).
 
Last edited:
Solution
Back
Top