[B2] Player Trails (1.5) 
24 comments [CS2D] Player Trails (Lua)
By BCG2000
Description: Real player trails, made possible by the new sprite capabilities of CS2D images.
Version: 1.5 (September 30th, 2016)
Copyright © 2016, BCG2000
[INSTRUCTIONS]
- Just extract the file on your CS2D folder.
- You can change the amount of trails by changing the "B2PT_MaxTrails" variable in the script.
- You can enable/disable the trails by saying "!pt" in the chat (you must be logged in the RCon).
PS: Because of the Lua memory leaks in this game (as of the time I made this script), I did things like setting locals to nil and using timers instead of hooks like "always". Otherwise, the code would be a bit more clean.
[RULES]
You can use this script on your server.
You are allowed to edit the script and/or build on top of it and you can also link it to your own scripts, but if you do so then give me credit.
You are NOT allowed to claim this script as your own.
By BCG2000
Description: Real player trails, made possible by the new sprite capabilities of CS2D images.
Version: 1.5 (September 30th, 2016)
Copyright © 2016, BCG2000
[INSTRUCTIONS]
- Just extract the file on your CS2D folder.
- You can change the amount of trails by changing the "B2PT_MaxTrails" variable in the script.
- You can enable/disable the trails by saying "!pt" in the chat (you must be logged in the RCon).
PS: Because of the Lua memory leaks in this game (as of the time I made this script), I did things like setting locals to nil and using timers instead of hooks like "always". Otherwise, the code would be a bit more clean.
[RULES]



edited 1×, last 10.11.16 03:12:55 am

Comments
24 commentsLog in!
You need to log in to be able to write comments!Log in

@
BCG2000: Whatever, i tried to leave it many times but everytime back and some friends too.
Anyway, good luck and have a good time

Anyway, good luck and have a good time

@
Mora: As said in the instructions section, you can already enable/disable the trails by saying "!pt" in the chat.
It's not possible to detect when it will cause lag because that depends on the connection speed of who is playing on the server. Some players may be able to handle 3 or 4 trails for example, but that will make players with slow connection speed lag out very easily. Like I said before, I already left max trails as 2 by default, because that is the optimal setting for everyone.
There is no command to set max trails ingame because that would mess with the array allocation (but it's possible to make it so that there is a minimum and max trails amount). But I don't think it's necessary and/or worth it, it's fine the way it is, just change the value in the script.
If you need any additional features on the script then you can extend it yourself, I won't update it anymore because I left this game. However, it's the final version of the script, so it's already optimized and bugs were fixed.

It's not possible to detect when it will cause lag because that depends on the connection speed of who is playing on the server. Some players may be able to handle 3 or 4 trails for example, but that will make players with slow connection speed lag out very easily. Like I said before, I already left max trails as 2 by default, because that is the optimal setting for everyone.
There is no command to set max trails ingame because that would mess with the array allocation (but it's possible to make it so that there is a minimum and max trails amount). But I don't think it's necessary and/or worth it, it's fine the way it is, just change the value in the script.
If you need any additional features on the script then you can extend it yourself, I won't update it anymore because I left this game. However, it's the final version of the script, so it's already optimized and bugs were fixed.
edited 1×, last 11.11.16 05:54:16 am
@
VADemon: The only config I put is max trails, but you can easily edit it to use other images and extend it, the code is organized and commented.
@
kerker: In the code comments I say:
"Only active weapons and items (that are held in the player's hands) are put here. Passive items like defuse kit and armor are not included, they could be included but it would make the script more potentially laggy than it already is."
This includes silencers as well, and the fact that they don't appear is not a bug, but an intended feature or more precisely said, an optimization. I already left the script in an optimal state, like max trails being 2. More images or a higher trail count will easily cause lag if not controlled.

@

"Only active weapons and items (that are held in the player's hands) are put here. Passive items like defuse kit and armor are not included, they could be included but it would make the script more potentially laggy than it already is."
This includes silencers as well, and the fact that they don't appear is not a bug, but an intended feature or more precisely said, an optimization. I already left the script in an optimal state, like max trails being 2. More images or a higher trail count will easily cause lag if not controlled.

Okay, though a special place for the script is not found, the script is done pretty well. 4/5
Off-Top:
Off-Top:

Hm, interesting, more trails - better. It's okay when you are alone in sv.
And what about silenced weapons?(there's two only(as i know)):
And what about silenced weapons?(there's two only(as i know)):

Sick idea, I like it!
You will get an extra point if it's easy to repurpose the script to use another image & if longer tails are possible. (Sorry, I don't have time to look at the script right now)

You will get an extra point if it's easy to repurpose the script to use another image & if longer tails are possible. (Sorry, I don't have time to look at the script right now)

@
Jite: So what's wrong then
? This is like hats. They're useless but a great addition to make "fun" servers more enjoyable.


@
Rainoth: Sure I thought about a possible usage, but only the prophunt usage seems to be useful, anything else I can't imagine how it should be good. Well, sorry for posting here again..


Well,
BCG2000 maybe you're right. Thank you for taking the time to leave a comment.
But the feeling, like playing on the old grandmother's computer.It would be possible to add this effect only when you press the "Shift" that the standard slows down the player.
I do not change my rating yet. 2/5

But the feeling, like playing on the old grandmother's computer.It would be possible to add this effect only when you press the "Shift" that the standard slows down the player.
I do not change my rating yet. 2/5

Just posting negative comments, that's very useful. Good job guys!
I think this script is a good idea maybe someone can add it to fun scripts or other scripts.

I think this script is a good idea maybe someone can add it to fun scripts or other scripts.
@
kerker:
- Hide and Seek or Prop Hunt with FOW enabled (anyone who moves will leave trails that are visible through the FOW, thus being easily spotted).
- As a visual effect for a power-up like increased damage or focus effect.
- Could also be a power-up to make it harder to hit the user.
- Can be edited to further enhance it, like making a colored rainbow trail.
- Can also be used to represent a "lag effect".
There are several uses, you just have to think of them. I also never saw any player trails visual effect like this before.

- Hide and Seek or Prop Hunt with FOW enabled (anyone who moves will leave trails that are visible through the FOW, thus being easily spotted).
- As a visual effect for a power-up like increased damage or focus effect.
- Could also be a power-up to make it harder to hit the user.
- Can be edited to further enhance it, like making a colored rainbow trail.
- Can also be used to represent a "lag effect".
There are several uses, you just have to think of them. I also never saw any player trails visual effect like this before.