Turrets
Turrets
Automatic turrets for Bukkit servers (cleverly disguised as minecarts!)
I moved the project into Beta as there have been more people downloading and, I'm assuming, testing it, with no major issues. There is a lot going on in this plugin, and little changes can have far reaching consequences, let alone big changes, so I still won't stake my name on saying it absolutely won't mess anything on your server up. Please report any problems you have!
Currently working on: DisguiseCraft support. Give me your ideas on what you'd want from this :)
Details: I'm hooked into DisguiseCraft, just need ideas for what kind of features are desirable!
Download
I'll try and keep this up-to-date. If all goes as planned, this version should be the same or newer than the one linked to this BukkitDev entry.
A Jenkins job has been created to house dev builds. You can access it here!
v0.2.3a - Manual turret control!
For those of you antsy about getting a version for 1.4.4, here's an unofficial 1.4.4 dev build.
Link Removed: http://www.mediafire.com/download.php?85saz80idpsafef
Building turrets is easy: Just place a fence post, then right click with a minecart on top. It's so easy, even a guest could do it! (That's why Turrets has permissions support.)
Make sure you attach an ammo chest to the turret (see command page) or set turrets to have unlimited ammo (see config page).
Breaking turrets is also easy: Just left-click it until it breaks, just like a minecart.
Features
- Turrets target hostile mobs
- Turrets will avoid shooting through walls
- Turrets use ammo chests (configurable).
- Turrets are upgradable!
- Upgrade a turret by replacing the block under its fence post: iron -> gold -> diamond
- Better turrets can shoot faster, farther, more accurately
- Firing speed, range, and accuracy can be changed in the configuration
- Turrets are breakable! (With permissions, of course)
Possible future features
Commands
Permission Nodes
Also, thanks to damnnicholas for his YouTube video explaining the plugin.
@wristdirect
It say to players "you have not permissions to do blablabla..."
@wristdirect
I'm glad you're a cool dev that knows good ideas when he sees them. Other devs would be like "Nah my way is better" or "Nah don't feel like it" when their plugins could have so much potential. You're like "Oh snap that's actually a good idea, I see wut you mean man, let me get on that" and then I don't have to wait weeks or months for changes to occur.
@n33dy1
Also, n33dy1, I've done most of the work to convert to your idea for the whitelist/blacklist. Still have to test it out, and there are a couple other things I need to add (some of the other things from your post ;) ), including support to use cobble and mossy cobble walls for turret posts :)
@scaccolatrice
All you have to do is add "- turrets.addturret" and "- turrets.destroyturret" to the group permissions for the "normal player" group, in the group.yml essentials file. Any player in that group should get those permissions.
I don't know what i have to write in my "permissions file" to let normal players to create turrets. I have Essentials, can you help me please ?
@n33dy1
1) Whoops. Yeah there should be no semicolon there. My bad!
2) Wow, I guess I was very hasty with that part of the changes >< It should be false. Both 1) and 2) will be fixed in the next release.
3) None taken. I know you wanted it a certain way, but others may have wanted just blacklists or just whitelists or w/e, so I decided to implement both, with a way things override with a global list etc. I can add /turrets pvp on and /turrets pvp off as well to make it so if you have /turrets pvp off, all the players turrets will ignore all players (aka not use lists).
Changing it to use only a whitelist or blacklist does seem like a better idea, but it will take some time to implement, as it in several ways is a big change in the code as well as the settings and configs. I'll look into changing it, because your method does seem better.
4) Couldn't you add them to the config yourself (I mean this nicely! :P)? I mean, I could add them as defaults, I just wanted to keep the default as arrows (with snowballs in there too to show entering multiple types). Potions are still a bit weird, as all the code checks for is if they are splash or not.
Also, I'll note here that playing with the code for firing stuff from the turret is ugly. It makes some calls to CraftBukkit code, which is all sorts of obscure. So it'll be hard to fix some stuff around there, but it's definitely doable (I think lol).
5) Not sure how that fell in the cracks. I'll be sure to add that next version.
6) Sounds good. I should have made a config option for which ammo usage turrets should spawn with. I'll do that in the next version too.
Thanks for all the feedback! :D
1) In the config.yml for the version you just released, it has "attackNonlistPlayers: true;" in there. Should that semi-colon be there?
2) Also, it is set to true by default. Changelog says it is false by default.
3) No offense but I don't really like how this was implemented. I think it might work better if you added /turrets PvP on and /turrets PvP off commands (off by default for all users) so users can define if their turrets attack any unlisted players or not.
You could get rid of attackNonlistPlayers completely, but keep the whitelist and blacklist. The users could have a whitelist and blacklist that they manage, but they can only use one of the two.
So a /turrets use whitelist and /turrets use blacklist could simplify things in that if they have their turrets PvP-enabled, it will attack everyone but those in the whitelist (if they have it set to use the whitelist), or it will attack nobody except those in the blacklist (if they have it set to use the blacklist).
The reason for this is because if I were to ever change the attackNonlistPlayers from true to false, or vice-versa, then my users would have to basically swap their whitelists with their blacklists or something.
EDIT: 4) Can you please add in more ammo types to the config file by default? Such as fireball, snowball, and even some potions (so we can see how that's done)?
5) I would still love to see a /turrets setAmmoType fireball all that changes the ammo type of all the turrets owned by the user that used the command.
6) If you added an option in the config.yml called allUserTurretsUnlimited: true which made it so my users didn't have to use ammo boxes or even learn to type /turrets setAmmousage unlimited all that would be useful.
Okee dokey, so here's Link Removed: http://www.mediafire.com/download.php?j8qbk7xfe7sxm39 . Took a while, as I live around the NEish of the US and Sandy did some damage (neighbor's giant oak fell over!), but I finally finished this version (hopefully with no bugs, there was almost 2 days of not working on it).
v0.2.1 has white and blacklists for players, which is explained in the change log for the version. Note that with a bit of effort, you can make this into a factions-type thing. I'll admit it's not totally "factions support", but it's the best I could think of for a general purpose way to incorporate attacking players as well.
As always, let me know if there's anything messed up! It's difficult to troubleshoot every possible problem :)
@Oliverbjor
Yep, I'm working on a whitelist/blacklist feature now. It's been slow going with IRL stuff happening as well (not to mention Hurricane Sandy making me lose power ><). The framework is there, just have to make commands for setting whitelists and blacklists in-game, plus permissions nodes. Shouldn't be too long now though :)
@n33dy1
I'll have to look into it. I feel there should probably be a way, though it might require some digging into the nasty CraftBukkit code (as opposed to the nice Bukkit API).
Can this shoot other players, if not can that be added later, I really need it to do so :) Can you also make it so you can choose which other players that get shot by it? Want it for PvP battles :)
Thanks
@wristdirect
Now it works, thanks. Still can't get 373:32756 to work for the splash potion of poison II though. Also, could you adjust the speed of the fireballs? Barely get to see them kill stuff they fly too fast.
Alright, so there were a few funky things that changed in the crazy CraftBukkit part of the code, but there were no sweeping changes that made things in Turrets not work. Here's v0.2.0, compiled for 1.4.2. Sorry if updates are slow for a little bit, moving into the new house :)
Link Removed: http://www.mediafire.com/?icr21l6ird4y21i
@n33dy1
Did you try adding fireball to the ammo type list in the config while your server was off, saving the file, then starting the server? If you try and modify the config.yml while the server is running, it won't actually change, and when the server stops it will overwrite your changes with what the config was when you started the server. I'm working on some commands to be able to change stuff in-game, but until then you have to stop the server, change the file(s), and restart the server ><
I wasn't able to get fireballs working. I even added "fireball,fire_ball,fire ball" into the config file trying to get it to work. It's funny because I'll put /turrets setAmmoType fireball and it tells me the usage example of the exact same thing... this was an issue before 1.4 btw.
Snowballs and arrows work. Also, can you explain how to get potions to work?
I have some splash poison ones I'd like to use on unlimited ammo. I can do /itemdb while holding it and get some numbers with a colon which I can use to /give myself more, but I was wondering if the item ID could be added as an argument for the ammo. So... I want to do /turrets setAmmoType 373:32756 all to set all my turrets to use Splash Potion of Poison II.
Welp, 1.4 broke a lot of shit in Turrets, so this should get interesting trying to fix this ><
@wristdirect
It's like I steal your ideas from your head and suggest them to you later to make myself look cool.
@n33dy1
Yep, that's how the ammo usage all command works, and I'll definitely implement the setAmmoType all thing right now. Surprised I didn't think to do that before ?_?
Please add /tur setAmmoType fireball all
I hope these only work on the turrets of the user using the command. :)
@n33dy1
Luckily this one was a really easy one to implement, and it's been promised since before I was even working on the project :P
I also fixed a few bugs and added the ability to modify some of the config options via command. (v0.1.9a actually makes sure you have permission to do this. Forgot to add that on 0.1.9 lols)
Could a maxTurretsPerPlayer option in the config file with a permission called turrets.ignoremaxturrets that ops get by default?
EDIT: Also, a command like /turrets setUnlimited on and /turrets setUnlimited off that each player can use to set all their (and only theirs) turrets to unlimited ammo automatically? It can come with a permission called turrets.setunlimited that ops get by default.