Hunger Games Style Spawning System

Discussion in 'Plugin Development' started by TCGDNoku, Aug 29, 2013.

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

    TCGDNoku

    Hello,
    I am wondering how to make it so when a player joins it teleports them to a certain block.
     
  2. Offline

    TCGDNoku

    CaptainBern I know but every one would spawn on the same block
     
  3. Offline

    xTrollxDudex

    TCGDNoku
    Have a number. Increase it as people join. Teleport to that position in a list of locations.
     
    Assult likes this.
  4. TCGDNoku Then loop trough the players and spawn each to a random/diffrent block?
     
  5. Offline

    TCGDNoku

    xTrollxDudex Ok Cool! I will try that :)

    CaptainBern Randoms wont be up for the job :p

    xTrollxDudex It didn't work for some reason

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  6. Offline

    Awesomeman2

    xTrollxDudex Maybe you should show him some code, I would but i have no idea how to do this.
     
  7. Offline

    xTrollxDudex

    TCGDNoku
    PHP:
    int count 0;
    List<
    Locationspawns = new ArrayList<Location>();
     
    //add player method
    player.teleport(spawns.get(count));
    count++;
     
  8. Offline

    ZeusAllMighty11

  9. Offline

    BajanAmerican

    I was looking at your code you put up, what's a .map file and how is a regular world used to generate that .map file? Sorry, I saw that and it caught my eye, hoping you can shed some light on this :)
     
  10. Offline

    xTrollxDudex

    BajanAmerican
    You could've made your own post instead of bumping a 3 month old thread ;)

    If you notice the GameMap field on line 24 in that class, it's not initialized. This field is initialized on line 46-48 in that class, it chooses a random map off a transferred array of GameMap's from HG#getMaps() on line 91 and 623 in HG.java
     
    ZeusAllMighty11 likes this.
  11. Offline

    ZeusAllMighty11

    BajanAmerican

    I still use similar code, but instead of making the object serializable (because it's a waste of bytes and time), I just store all podiums in a single file.

    Any extensions in the source you don't recognize, I probably made up.
     
  12. Offline

    BajanAmerican

    xTrollxDudex ZeusAllMighty11
    Yeah, sorry about bumping a 3 month old thread, but I saw this portion and asked how it worked, sorry about that. Now, I understand that you are storing your object podium in a local file that consists of data; however, on your "addspawn" command, wouldn't there be a NPE because there is no GameMap? If you're in a world and run that command, there is no .map file for that world yet for it's podiums, so I can't see why it would not give off an NPE. Sorry, just having a little curiosity to this code, that's all :p
     
  13. Offline

    ZeusAllMighty11

    BajanAmerican

    You're supposed to configure the maps and then it would create the file, so there should be no NPEs
     
  14. Offline

    xTrollxDudex

    BajanAmerican
    Or tell the player that there are no maps if the size of the map is 0 and ban them.
     
Thread Status:
Not open for further replies.

Share This Page