Just need a start of a minigames framework

Discussion in 'Plugin Development' started by VortexGmer, Apr 25, 2015.

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

    VortexGmer

    I want to make a minigame. Believe me that I am experienced with bukkit after a few months ;) But all I need is a little help to make this:
    1. When a player joins the server if the server has 6 players already the player gets kicked (Finished)
    2. The players are separated into teams of 3.
    3. There is a countdown and the countdown will not start until 6 players have joind, The countdown is 30 seconds long.
    4. The game "Ends" when all people from one team die.
    5. When a player dies he/she becomes a spectator.
    I know how to do many of these things. The thing is that I can seriously not figure my way around the game is ended or countdown. Thanks for any help. Remember, I am not asking for code. I am just asking for help to make code!:)
     
  2. Offline

    MajorSkillage

    My suggestion is just make a quick little minigame API to go with this then compare values in it to match your requirements.
     
  3. Offline

    VortexGmer

    No There are no minigame apis that I need, I want it to be a server takeover minigame. THe minigames I found were making arenas and all
     
  4. Offline

    xDeeKay

    I'm doing a similar thing with queues, here's how I'm doing it:

    When a player joins the queue with a command, check how many people are already in the queue. If there's the required amount of players in the queue, start the timer. The timer is simply a .runTaskLater runnable with a certain delay in ticks.

    Now depending on what your minigame is, the way your game ends is going to be different. For my example I'll use spleef. My game ends when all but 1 player is left, and all other players have fallen into the 'pit'. I use a player move listener to check for this, so I can then run other checks to see how many players are left in the game, and if there's only 1 player left, I know the game has ended, and can then run the necessary code to reset the game etc.

    Hope this helps!
     
  5. Offline

    VortexGmer

    Yes but I don't exactly get your 'Timer' runtaskdelay thing
     
  6. Offline

    xDeeKay

    @VortexGmer What don't you get? I'll be happy to explain.
     
  7. Offline

    VortexGmer

    how do you use runtask delay? what about repeating task?
     
  8. Offline

    MaTaMoR_

    You shouldn't use a runnable for queue or things like that, if you're going to use a runnable it must be just for the game timer, all other things can be done without a runnable.
     
  9. Offline

    xDeeKay

    Well something needs to happen after the timer, runnables can be useful for the things that tend to repeat themselves such a a queue based system.
     
  10. Offline

    bwfcwalshy Retired Staff

    1. Finished already
    2. Get the teams, loop through the players and add to the teams.
    3. if players >= 6 then BukkitRunnable for 30*20 or 600
    4. No idea what your end method is but check PlayerDeathEvent and then check their arena/team and see if the players is equal to 0 if so run the end method.
    5. Again, PlayerDeathEvent, set a potion and set fly to true.
     
  11. Offline

    VortexGmer

    Ok thanks for that, How do I cancel the player interacting with other players once they are a spectator?
    Also how do I make kits?
     
  12. Offline

    xTrollxDudex

    You need to cancel all the interaction events involving another player if the interaction is made by a spectator, ie damaging, projectile hit for arrows, and world interactions such as lever flicking (interact event).

    Give items in the kit to the player?
     
  13. Offline

    caderape

    @VortexGmer The gamemode spectator for 1.8 already do that i think
     
  14. Offline

    VortexGmer

    N
    I am so dumb...
    A little more help with the timer
     
  15. Offline

    caderape

    @VortexGmer You shouldn't use repeating task. A runTaskTimer is easiest to manage. #bukkit.getscheduler().runtasktimer(plugin, new runnable(), 20L, 20L);
    When the game start, create one. And check if one of the team is empty, then cancel it and finish the game.

    You can assigne a bukkitTask to this. then cancel easily.

    bukkitTask = scheduler;
    bukkittask.cancel();
     
Thread Status:
Not open for further replies.

Share This Page