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

Discussion in 'Support' started by Xikini, Aug 13, 2018 at 2:16 AM.

  1. Xikini

    Xikini I whore myself out for likes

    Joined:
    Nov 17, 2010
    Messages:
    3,575
    Likes Received:
    1,830
    Best Answers:
    80
    Code (Lua):
    1. local a = getCreaturePosition(cid)
    2. local b = getCreaturePosition(target)
    3. 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?
     
  2. Best Answer:
    Post #2 by Erexo, Aug 14, 2018 at 9:07 PM
  3. Erexo

    Erexo Kage

    Joined:
    Mar 27, 2010
    Messages:
    635
    Likes Received:
    73
    Best Answers:
    2
    Best Answer
    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: Aug 14, 2018 at 9:50 PM
    Xikini likes this.

Share This Page

Loading...