How difficult is it to make this plugin?

Discussion in 'Plugin Development' started by DirtyStarfish, Aug 18, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    DirtyStarfish

    Hey!

    I've never made a Bukkit plugin before, but for the server me and a friend are trying to create, it would be very useful. I did a module on Java last year at university, so I know the basics.

    I want to create a plugin that will allow players to create 'shrines'. When certain blocks are placed in a particular position a 'shrine' will be created. The more of them that are placed on the map, the more 'power' that faction will have. I want to also incorporate this into permissions so that players of certain ranks will be able to build bigger 'shrines' and therefore accumulate more power for their faction.

    There will need to be other factors such as when they can be placed (night and day), and how often a player or faction can create one.

    When a member of an enemy faction destroys the shrine the other faction will lose power.

    So, my question is, how difficult is it to create such a plugin?

    Any advice is much appreciated

    Thanks,
     
    DrAgonmoray likes this.
  2. Offline

    Musaddict

    Multi-faction, block design recognition, permissions, time restrictions, buffs with more shrines, that's not entry level stuff :p
     
  3. Offline

    DirtyStarfish

    Well, there will be 3 factions, which I can handle using Permissions. Then each player would choose which faction to join by typing a command. This would purely be for determining which 'shrine' they can place and when. I can live without buffs, its mainly a way to keep some kind of scoreboard of which faction is most powerful.

    So really, block design recognition aside, its only about displaying how many shrines are placed at one time.

    Meaning the hard part is this block recognition stuff.

    Thanks for the reply!
     
  4. Offline

    Randy Schouten

    I do not know how block structure recognition works, I would help you if I did know that.

    The rest should be possible.
    Maybe if you can't get your own factions to work, maybe take a look at the plugin Factions, see if has an API to work with.
     
  5. Offline

    EdTheLoon

    All I'm going to say is that would be quite difficult. You'd need a good knowledge of Java and the Bukkit API first. Then you would probably be best to actually DESIGN the plugin before moving on to code as it really does help. Most developers here just jump straight into coding.
     
  6. Offline

    Taco

    I agree that you should plan out the project before diving in. I'm not sure what pace your university teaches Java at, but all the college level classes I've taken in Java were extremely basic, and aren't nearly enough to be able to dive straight into code. I'd recommend writing down what needs to be done for this to happen and how you plan to accomplish each of the tasks.

    As a start, you need:
    • Structure recognition
    • File/database reading and writing. (I'd recommend files over a database, it's more universal and efficient)
    • Proper storage of the structures. This goes back to file writing, but you need a way to know where they are through reboots.
    • Support for some sort of factions (More that needs to be written to files)
    • Some way of keeping track of time. Bukkit doesn't provide an event for when it goes from night to day.
    • How the "power" system will work and what advantages/disadvantages are involved.
    I'm probably missing something here, but you get the idea.

    TL;DR: As a first plugin, not a great idea. It would be very difficult.
     
  7. Offline

    Musaddict

    First off I'll say that I am a plugin developer, but less a coder and more of a designer. I and a friend are working on some code for our own plugin at the moment. From what we've done so far, may I suggest some simpler alterations;
    • Neutral OP creates neutral "altar"
    • Altar can be captured from separate factions, but only at different times
    • Number of altars captured = number of buffs for the faction
    • To help reduce the chance of over-buffed factions guarding all altars, buffs are reduced/canceled near the altar.
    • Shrines are upgradeable with permissions (at a cost).
    Some ideas for you.
     
  8. Offline

    DirtyStarfish

    Thanks for all the feedback! Its really helpful!

    I know for sure that I am going to struggle with this block recognition stuff, I'm hoping that if I can't find any resources on how I might do it, then I'll see if I can contact someone how has used it in one of their plugins.

    As this is purely for my own server, Im thinking I'll leave out the factions part, and use Permission groups and a a chat plugin to show the "faction" of the player.

    Block recognition aside, it will be something like:

    Shrine placed
    Chat: "Shrine has been created, 1 power to faction"
    Add 1 to relevant factions power

    Shrine is destroyed
    Chat: "Shrine has been destroyed, 1 power lost"
    Subtract 1 from relevant factions power.

    And then,

    Command: /shrine status
    Chat: "Faction1 has x shrines and y power" - repeated for all factions.

    I think that should be fairly simple, thats the core of the plugin. I can try to add other features later.

    If anyone knows of a plugin that uses block design recognition, please tell me, so I can have a little look!

    Thanks!
     
  9. Offline

    EdTheLoon

    Using a command before/after you've built the shrine is way easier and a lot more efficient in regards to memory.
    For example (typing /shrine before creation):
    • Player types /shrine create <ShrineName>
    • Boolean creatingShrine is set to false
    • Player places block, blockListener first checks whether creatingShrine is true before continuing.
    • blockListener adds the Block to a list of some sort
    • Player places another block, again it checks that creatingShrine is true and then adds the block to the list
    • Once player is done he types /shrine finish, creatingShrine get's set to false
    • Shrine is saved to file/database or however you plan to do it
    This would allow you to create custom shrines! You could also make it so that blocks have to be a certain material and there must be a certain amount of them.
     
  10. Offline

    RPFeltz

    I'm working on my first plugin now, where you perform rituals to use magic.
    They require specific structures.
    Basically, when a block is placed, check what kind of block it is and check what blocks are relative from it, and if they match certain things, then do some magic stuff.
     
  11. Offline

    CptSausage

    Hey just an idea for creating the shrines.

    There should be a final 'core' block which has to be placed as the last block in the shrine.
    Could be a diamond block for the one fraction, gold for the other, ...
    Than check if the blocks related to this final block are right.

    This would give you the opportunity to enable 'shrine stealing'. If someone destroys the 'core' block of the opponent fraction they will lose the shrine and the other fractions would be able to place their 'core' into the shrine.

    Make sure you control the item creation as well. Ppl should not be able to create or disassemble those core blocks. Spout (or even the normal api?!) will give you control over this.

    Now you could to use the bukkit scheduler to give the players a core item every XX ticks.



    PS: Different sized shrines would be fun. Some need more core blocks than other. But yeah, you can add that later.
    I think this project could be a lot of fun. Just do it! Learning by doing! Building a large project is much more fun than writing stupid small plugins over and over again.

    (Just one more tip. Make kind of schematic object classes, so you can easily add more shrines later.)
     
Thread Status:
Not open for further replies.

Share This Page