Football Bukkit Pluggin Suggestions Plz????

Discussion in 'Plugin Development' started by IamJJJ, Jan 17, 2012.

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

    IamJJJ

    I was just wondering if this kind of plugin was possible...

    It would have:
    - 2 teams of a minimum of 2 players
    - a ball of some sort
    - a way to pass the ball to your teamate
    - a certain area that would be labled as a touchdown
    - and a way to tackle... (kill maybe?)

    I'm not sure if this would be possible but i would greatly appreciate any advise u could offer for this plugin. I will use the advise and attempt to make the plugin myself. I have never made a plugin like this before so im kinda lost 0.o

    Like i said i need a jumpstart to get moving so if u can help me anyway!!!!!! Please post here!!!!
     
  2. Offline

    randomman159

    Basically everything you do when making a plugin cannot actually *Change* anything client side. You can't add a ball without an extra plugin such as Spout. Unless you do something like an item drop with a set velocity (could be good for chucking the ball).

    So basically:
    - Teams yes
    - A ball (will need spout or just a drop with velocity)
    - A way to pass a ball (just check for right clicking, and drop the item and give it velocity (or have a custom spout item that does it))
    - Touchdown area yes
    - tackling? You can code things such as knocking players to the side, etc. You can also control health, you could do things that make a fist do 3 hearts of damage in the "field" area, and if a player gets down below 3.5 hearts say, they are tackled. Whatever you want.


    So my advice:

    Try getting team commands in. Once you learn how to make commands this is pretty easy. Don't overcomplicate it to start, simply make it so you can create, join and leave a team. You can add features such as a captain, kicking from team, etc. later.

    Try creating a ball which you can chuck around. If you want to use spout just google it, though it may be pretty complicated. Otherwise check for an event of right clicking. Check if the item is some test item, a slimeball say. If so, force the player to drop the slime, and give the drop velocity in the direction the player is facing. That should let you start chucking a ball around. Adjust til it's a throw you like.

    For touchdown areas, you could try letting the player type in 2 coordinates (x,y,z)1 and (x,y,z)2. Or you could try letting the player select such areas with a stick say (right clicking and left clicking blocks). Then try adding a command that lets the player add a touchdown (to an hashmap?) with the name of the touchdown area.

    Now back to the throwing code, check if the player is in a touchdown zone before you throw... If they are, then they could win, otherwise they throw it still.

    Of course you could add a zone like the touchdowns, for the whole field, to make sure players don't leave etc. Or start adding enforced-by-the-plugin rules, or you could just leave it to the players to play their own style. Both ways would be nice (or maybe implement both with a casual game and a strict game?) This lets players muck around a bit, as well as play proper games.

    Finally if you add a captain to a team (just store the playername in some variable), you could then add a command (which only works for captains) that challenges another team to a game of football. Upon accepting, everyone's chat (in the two teams) could be spammed with a countdown, to which the game begins.



    Sorry i couldn't show any code, no access to any of mine right now and dead tired... But it really is a matter of how much you know of the language and your creativity. If you don't know how to do something above (say checking if a player has right clicked a block), just google it (Bukkit Check if player right click block).


    Good luck, sorry it was so long :|
     
    IamJJJ likes this.
  3. Offline

    Father Of Time

    Absolutely, this can be done utilizing collections.

    As stated before, this depends on whether you want to have a new graphic or not. If you don’t mind repurposing an existing item (like wool) then you are good to go, otherwise you will need to utilize spout as it’s the only way to add custom items to minecraft servers at this time (without client mods).

    Absolutely, I would look into projectiles; they have a ton of functionality that you could tap into to help your goal, such as telling who they hit, or if they missed where they landed, who threw the ball, etc. You could make it so if you throw it (like a snow ball) and it strikes a player the item will be added to the players inventory, or “caught”; however if the item misses your target and hits the ground you can simply move it to the world to be picked up. I would note that you will need some way to “mark” the carrier so that other players know they have the “ball”

    This too is doable, however probably the most tricky part of your proposal. This would require cuboids and player movement handlers. You would simple need to continually check a players location on movement, and if they move into the specified cuboid region execute an action. I would advise looking at world guard to see how they handle cuboid entry/exit.

    my vote would be a knockback probability. Make it so X amount of the time you punch someone you just bitch slap them, but every so many attempts results in a “tackle” (knockback) which sends the enemy team player flying and drops the ball at the strike spot.

    Sorry I'm at work and have to run, good luck!
     
    IamJJJ likes this.
  4. Offline

    IamJJJ

    Thank you much this really inspired me!!!! But i dont think i will use a custom ball... maybe brown wool or something im not sure yet but thanks for getting me started.

    BTW, anyone help tell me how to make a cuboid for a touchdown area???

    And any suggestions still welcomed :)

    Thank you too Father Of time
     
  5. Offline

    Don Redhorse

    slimeball (?) implements a soccer game... and is using a slime ball..
     
  6. Offline

    IamJJJ

    I was wondering how i would enable the plugin to start??? Could it start when a player warped to a certain area PLAYER_WARP?????? <----- is that even a real event? Or is there a Player event for when they use a command? say they typed ./fb join (blah blah blah) would that be PLAYER_COMMAND? Or would it be public boolean onCommand?

    Edit: or can u create a class for whatever event you want? If so.... im okay.

    I've programmed java before just plugin developing is a little hard so dont think im a noob please ^^

    i rly need some help with coding atm

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 23, 2016
  7. Offline

    Father Of Time

    Well I can't say what is "best" but I can tell you what I have done in the past that worked for me. Basically what you want to do is make this "event" a class, something that you can create instances of. Then what I did was manually designed/created arenas that the events take place in, configure their cuboids and register the arena with your plugin.

    On server start up the plugin will be loaded, but no events will be happening. Then you make a command that players can use to "register" a match. Basically all you do is look at your list of registered arenas, find one that isn't in use, and then create an instance of your "event" and register it to that arena. Once the players have completed the match the "event" instance is destroyed and the arena is set back to "available"

    Whats fun about doing it this way is that players are randomly teleported to different arenas each time they start the event, adding a level of surprise to each game. Also, because the arenas are pre-defined you can turn these arena sites into a "site seeing" point, creating a network of teleporters to the different arenas to allow bored players to roam around and watch other people challenge one another.

    My best advice is to think of the arenas and events as two seperate items. Arenas are static, the world only has X arenas that need to be registered and released; however, the events are instances of a class and therefore you can create as many "events" as you want, as long as an arena is available to host it, and if not simply send them an "all arenas are full" message until one becomes available.

    Also, in regards to this comment:
    I had to get to know a lot about cuboids due to a PvP driven region protection plug-in I made for my server. I personally found the information here at bukkit to be limited, but I did manage to get all the answers I needed from the source code of WorldGuard at GitHub:
    https://github.com/sk89q/worldguard

    more specifically the ProtectedRegion.java
    https://github.com/sk89q/worldguard...guard/protection/regions/ProtectedRegion.java

    It's a TON to take in and can seem overwhelming, but try to just focus on one function at a time to help make it more manageable.

    I hope this helps, GL!
     
  8. Offline

    IamJJJ

    wow thanks a bunch this really helped im finally starting to get the hang of this!

    The only question from me would be: what would i put in the class then???
     
Thread Status:
Not open for further replies.

Share This Page