fodev.net

FOnline Development => Questions and Answers => Topic started by: Zinthos on April 07, 2018, 10:56:33 am

Title: How to create bullet tracers?
Post by: Zinthos on April 07, 2018, 10:56:33 am
Like on fonline requiem (from vid by vvish):

https://i.imgur.com/Ind21le.mp4


i suppose its DrawPrimitive, but i have no idea how to assign a delay for disappearing and such.
Title: Re: How to create bullet tracers?
Post by: Wipe on April 11, 2018, 08:22:22 am
i suppose its DrawPrimitive, but i have no idea how to assign a delay for disappearing and such.

Easiest will be to prepare array where you can hold data for DrawPrimitive() and a timestamp when effect is supposed to disappear. On each render_iface() call, iterate thru that array and simply draw a line from cached data. After that, check if current time >= timestamp; if it is, remove element from array.

As for creating line data, simply collect GetHexPos() for attacker and target; it's drawn for very short time in your example, so you won't need corrections in case of attacker/target movement. I guess render time shouldn't be longer than attack/damage animation time, whichever is shorter.