Automatic Arenas

Discussion in 'Plugin Development' started by kieronwiltshire, Apr 28, 2013.

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

    kieronwiltshire

    Hey well ive created a basic TDM plugin where you can create arenas, join teams etc...
    I just ran into a problem though.

    How would i make the arenas automatic?
    So for example it scrolls through the arenas in the config file (team spawns also save in config file)
    I just don't know where to start.

    Also how would i make it so they can modify blocks in the arena but after the game ends, the arena resets and it moves to the next arena?

    Config looks like this:
    Code:
    Config:
      Options:
        spawn:
          x: 193
          y: 71
          z: 297
          yaw: 266.24997
          pitch: 40.95001
    Arenas:
      test:
        Options:
          TeamGreen:
            Spawn:
              X: 210
              Y: 71
              Z: 301
              Yaw: 158.59991
              Pitch: 4.4500203
          TeamOrange:
            Spawn:
              X: 203
              Y: 73
              Z: 279
              Yaw: -5.500085
              Pitch: 27.4
    
     
  2. Have a look at my fully automated minigame/arena system I made for a friend here: https://www.github.com/storm345/ac - feel free to use any of the code if needed! Hope this helps :)
     
  3. Offline

    kieronwiltshire

    bump, Still need help :/
     
  4. Offline

    ase34

    You can save the arena to a file (.schematic) and after the game ends, you can then import the arena.
     
  5. Offline

    kieronwiltshire

    Thanks, but this isn't what I want, I want it so it gets the arenas listed in the config file, and will then play through the arenas like a list of games.
     
  6. Offline

    ase34

    Ok but with the .schematic files you can reset your arenas. :)
     
  7. Offline

    kieronwiltshire

    oh yeah! thanks mate!
     
  8. Offline

    skipperguy12

  9. Offline

    kieronwiltshire

  10. Offline

    skipperguy12

    kieronwiltshire
    Get all the maps as a list, get a random number from the random number generator, generate it from 0 to the list's size. * Then do list.get(RANDOMNUMBER) and you'll have your arena

    Where the star is, insert a check to see if it's equal to the last arena incase you don't want back to back arenas being played.
     
  11. Offline

    kieronwiltshire

    Yeah but thats the thing I can't get the maps from the config, I don't know how. I need an example, The config is shown above.
    skipperguy12
     
  12. ConfigurationSecction.getKeys(false)?
     
  13. Offline

    devilquak

    kieronwiltshire

    Create your own Arena object with all the properties you want, and then add the arenas from the config into a HashMap on startup and when you want to reload.
     
  14. Offline

    kieronwiltshire

    Everyone still isn't listening I need an example! I don't understand how I would do it. I know how, just don't understand what to use and how to use it.
     
  15. Ok ill will make a pastebin explaining https://www.github.com/storm345/ac later! (As you requested in the email)
     
  16. Offline

    devilquak

    If you're still here, and you'd still like help, tag me again and I'll show you how to do it.
     
  17. Offline

    Tirelessly

    I don't blame you, that guy does not know how to organize code.
     
Thread Status:
Not open for further replies.

Share This Page