Custom Turret Lua 
22 comments Well. Long story short. Normal turrets all have same type of ammo and I couldn't find a solution or a workaround to differentiate them. So I dropped my idea and decided to make something else.
A custom turret. Really, I tried to make it look as close to a normal turret as possible. I couldn't make smooth rotation when it's idle though. Sorry about that...
Anyways. I'm sure this can be used with construction mod but really I'm uploading this just for the sake of anyone needing this. The code isn't all that great. It's me after all... Still, it does the job and I couldn't care less about it.
Screenshots might not be so descriptive so I made a quick video (Ye I was THAT bored...)
Click this "Click This"
Some things I'd like to mention.
In the video, I can destroy my turret. It's not possible. It was possible merely to show the possibility of turret being destroyed. You or your teammates can't do it.
Thanks to
Pseudon for the sprites,
Yates for helping with hitzone,
EngiN33R for telling me about math.atan2 function as well as pointing out dumb mistakes.
Installation
Download > Put in Counter-Strike 2D Folder > Extract > Play
Enjoy ~~
A custom turret. Really, I tried to make it look as close to a normal turret as possible. I couldn't make smooth rotation when it's idle though. Sorry about that...
Anyways. I'm sure this can be used with construction mod but really I'm uploading this just for the sake of anyone needing this. The code isn't all that great. It's me after all... Still, it does the job and I couldn't care less about it.
Screenshots might not be so descriptive so I made a quick video (Ye I was THAT bored...)

Some things I'd like to mention.
In the video, I can destroy my turret. It's not possible. It was possible merely to show the possibility of turret being destroyed. You or your teammates can't do it.
Thanks to



Installation

Download > Put in Counter-Strike 2D Folder > Extract > Play
Enjoy ~~

Comments
22 commentsLog in!
You need to log in to be able to write comments!Log in
I'd probably agree but.
My script may not be as great as yours but our scripts are different. Really different actually. Your has all those variables and what not, but the concept is entirely different. I control mine remotely and I can get inside of it, whereas your turrets (I believe) are acting on their own. Even if they aren't, your script does not offer such a thing like entering a turret. If you really want to have me remove this, please upgrade your own script to match the abilities of mine and then I'll kindly keep my code to myself. I wasn't even sure whether to upload it cause I thought to have it privately, but then I decided not to, I'm sure at least few people will find this useful.
If a moderator or DC disagrees with what I said and believes that the scripts are the same, they can delete this and I will not argue about it.
My script may not be as great as yours but our scripts are different. Really different actually. Your has all those variables and what not, but the concept is entirely different. I control mine remotely and I can get inside of it, whereas your turrets (I believe) are acting on their own. Even if they aren't, your script does not offer such a thing like entering a turret. If you really want to have me remove this, please upgrade your own script to match the abilities of mine and then I'll kindly keep my code to myself. I wasn't even sure whether to upload it cause I thought to have it privately, but then I decided not to, I'm sure at least few people will find this useful.
If a moderator or DC disagrees with what I said and believes that the scripts are the same, they can delete this and I will not argue about it.
Then keep your code for yourself and read this:
CS2D File Archive Restrictions
DC has written:



All other CS2D scripts: Please make sure that they are really new or at least better than existing scripts! Otherwise they might get removed as well.
@
mafia_man: Ye it's cool. But I hate to use other's code. Well done though.

@
Avo: I'll consider that.
This was made to be implemented as an upgrade in a mod I'm making. A little bit more and I'll have done both mods that I'm currently making. Maybe then.

This was made to be implemented as an upgrade in a mod I'm making. A little bit more and I'll have done both mods that I'm currently making. Maybe then.
@
KimKart:,
massiveguy Ye I love it too. It's from Vsauce :3



@
Pseudon: That would lag, constantly. Testing it on new game will make it seem that it won't lag on an actual server, this is due to it requesting your data, and you are the server. If not then it will have to request client data (which can be manipulated) and then send it back to the server.
Awesome script, though! Keep it up!

Awesome script, though! Keep it up!
@
Pseudon: That's a great idea. I MIGHT make that. You see I would have to constantly request/receive my cursor position. I'm not exactly sure but it's possible that it would lag.
@
tek69: I'm afraid that would make me look inappropriate. You can always google the image and replace it to your liking (in your case, you like ****s so I guess you'll have to search for those...)
@Ohaz thanks.

@

@Ohaz thanks.

Awesome,still if you would make it rotate following the owner's cursor this script would be perfect. 4.5/5
@
Pagyra: Player enters the inside of turret so it should be drawn over him
For the imagehitzone thanks. Was my first time using imagehitzone so I was unsure how I could do everything.


For the imagehitzone thanks. Was my first time using imagehitzone so I was unsure how I could do everything.
imagehitzone 102 mode - wall effect + stop shot
For hull image - Mode 0: floor image (covered by players etc)
For turret image - Mode 201-232: draw over this player (id+200)
My variantion of skins for different weapon(rocket,rpg,grenadelauncher,laser)
For hull image - Mode 0: floor image (covered by players etc)
For turret image - Mode 201-232: draw over this player (id+200)
My variantion of skins for different weapon(rocket,rpg,grenadelauncher,laser)
edited 1×, last 05.02.14 09:25:50 am