[LIB] [1.7] Remote entities - Next generation NPC library [No support]

Discussion in 'Resources' started by kumpelblase2, Nov 10, 2012.

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

    IDragonfire

    Get the Location of the RemoteEntity ...
     
  2. Offline

    suckycomedian

    With a timer or something?

    I'm having a bunch of them go to locations to build something so I need to know when they get there so I can have them place a block then move to the next block
     
  3. Offline

    IDragonfire

    bukkitdev page created:
    http://dev.bukkit.org/server-mods/remoteentities/

    RemoteEntities is a library, maybe there is a method for that, but I think not (yet). What should the library do?
    What you trying sounds like very ressource-eating plugin. Atm I have no idea to improve your approach, because the desires make the same. They look if they should execute (https://github.com/kumpelblase2/Rem...2/remoteentities/api/thinking/Desire.java#L57) and if that is true, there are executed (https://github.com/kumpelblase2/Rem...2/remoteentities/api/thinking/Desire.java#L38). You can fire your own event (or call a method, ...) in stop Executing (https://github.com/kumpelblase2/Rem...2/remoteentities/api/thinking/Desire.java#L43) to avoid lazy waiting.
     
  4. Added PlayerMoveEvent for RemotePlayer on my todo list.



    v1.3 is only compatible with 1.4.5 . See latest snapshots for 1.4.6 compatibility.



    They're using a lot of NMS code because they should act exactly like the default ones.

    I'm gonna take a look at the attacking code for the desires.
     
  5. Offline

    Baba43

    I have downloaded the 1.3 that is linked in the start post.
    I don't know what I'm doing wrong.. still the same error.
    1.4.6-R0.3
     
  6. Offline

    IDragonfire

    Please read the post from kumpelblase2:

     
  7. Offline

    Baba43

    Okay and where to get those?
     
  8. Offline

    confuserr

    Use the snapshot repo with Maven.
     
  9. Offline

    Baba43

    Okay the lib is working and it's pretty cool!

    But I found a problem on my server that I don't understand: After a few minutes my remoteentity just disappears.

    Do you have any ideas what could cause this?
     
  10. Offline

    IDragonfire

    Can you please post your code?
     
  11. Offline

    Baba43

    Code:
            questNPC = new RemotePlayer(1337, "Beligon", entityManager);
            questNPC.getMind().addActionDesire(new DesireLookAtNearest(questNPC, EntityHuman.class, 8F), 1);
            questNPC.setPushable(false);
            questNPC.spawn(new Location(GeckoAPI.Worlds.City, 27, 59, 7, 180, 10));    
    
            HumanEntity e = (HumanEntity) questNPC.getBukkitEntity();
            e.setItemInHand(new ItemStack(Material.PAPER));
    
            questNPC.getMind().addBehaviour(new InteractBehavior(questNPC)
            {
                @Override
                public void onInteract(Player p)
                {
                        onQuestRequest(p);
                }
            });
    
     
  12. You shouldn't instantiate the player by yourself, this would completely destroy the idea of the manager. The manager is there to handle most of the stuff, including spawning and generally keeping track of the entities.
     
  13. Offline

    Baba43

    Okay but I could not figure out how to create a human NPC since no type enum contains a player.
    Do I have to create a LivingEntity for createRemoteEntityFromExisting ?

    /edit
    Okay I found it :x

    I changed my code to this but I still have the same issue:

    Code:
            questNPC = entityManager.createNamedEntity(RemoteEntityType.Human, new Location(GeckoAPI.Worlds.City, 27, 59, 7, 180, 10), "Beligon");
            questNPC.getMind().addActionDesire(new DesireLookAtNearest(questNPC, EntityHuman.class, 8F), 1);
            questNPC.setPushable(false);    
    
            HumanEntity e = (HumanEntity) questNPC.getBukkitEntity();
            e.setItemInHand(new ItemStack(Material.PAPER));
    
            questNPC.getMind().addBehaviour(new InteractBehavior(questNPC)
            {
                @Override
                public void onInteract(Player p)
                {
                        onQuestRequest(p);
                }
            });
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  14. Offline

    Fell

    Can someone please explain why this does not cause the NPC to attack the player near it? I've been at this for hours :/ Printing out the RemotePlayer's target does show that its target is the player that it's near to, but it just won't attack them

    Code:
        @EventHandler
        public void onMobSpawn(CreatureSpawnEvent e){
            if(!e.getSpawnReason().equals(SpawnReason.SPAWNER_EGG)){
                return;
            }
         
            e.getEntity().remove();
            final RemotePlayer p = new RemotePlayer(1, "Miner", manager);
            p.spawn(e.getLocation());
            p.getBukkitEntity().getEquipment().setItemInHand(new ItemStack(278, 1));
            //p.getMind().addMovementDesire(new DesireWanderAround(p), 100);
            p.getMind().addBehaviour(new EnterSightBehavior(p, 16, 16, 16){
                @Override
                public void onEnterSight(Player plyr) {
                    p.attack(plyr);
                    p.getMind().addActionDesire(new DesireAttackNearest(p, EntityHuman.class, 16, false, true, 0), 1);
                }
            });
     
  15. Offline

    Baba43

    Hey, I'm using remoteentities v1.4 and my NPCs disappear as soon as I reconnect.
     
  16. Well, I'm aware of the issues with the attacking desires. I have no idea why they don't do what they're supposed to do. I already check if I might've overlooked method changes but that doesn't seem to be true. I sadly haven't had the time in the last days to do much about it, nor do I expect to have enough time in the next days either, especially because I'm involved in some other projects which are a bit more important. I'm doing what I can, but if someone could at least help me out a bit, that would be really appreciated.
     
    Baba43 likes this.
  17. Offline

    Fell

    So, just to clarify, all methods of getting a mob to cause damage to a player/other mob are not currently working?
     
  18. Offline

    IDragonfire

    Yes, he does. If I had time, I try to investigate some time ...
     
  19. The desires to attack entities are broken, not the api methods themselves. But since the api methods rely on these desires, they don't work as well.
     
  20. Offline

    lenis0012

    is the entity.setYaw and entity.setPitch workign yet?
     
  21. Offline

    chasechocolate

    Good job! You should add a DesireSleep class to make the player NPC look like thy are sleeping.
     
  22. Offline

    IDragonfire

    kumpelblase2 and me found the bug
    (https://github.com/IDragonfire/Remote-Entities/commit/0980de205f3a44f5ff9fefcd825bf919f9f413d4)
    EntityHuman has his own damage method that differ from the creature/monster method ;)
    Please wait for an update.

    I created a new issue for that:
    https://github.com/kumpelblase2/Remote-Entities/issues/22



    I think: Yes
    https://github.com/kumpelblase2/Remote-Entities/commit/7e8f50cd5c07539e631dff9f417a1c8727df8656
     
  23. Offline

    AmoebaMan

    Is there any ETA on an update for this?
     
  24. Newest snapshot is up in the repo.
    There'll be jenkins server running in some time. I hope I can figure out to also publish the builds to the maven repo, that would be amazing.

    Update: Yes, the jenkins server will now automatically push updates to the maven repo. That means, when ever I make a commit/accept a pr or whatever, a build gets issued and a new snapshot will be available on the maven repo. These are awesome news for me because I don't have to do anything anymore. It's also great for you because you can always get the latest version.

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

    AmoebaMan

    kumpelblase2 The following line when used with the current 1.4 SNAPSHOT (as of 1-20-13) causes my server to freeze completely:

    Code:
    RemoteEntity npc = FatigueModule.npcManager.createNamedEntity(RemoteEntityType.Human, player.getBedSpawnLocation(), player.getName());
    No stack trace is generated, so I can't tell you what's going wrong. There must be an open loop somewhere in your code or something. No errors occur, the server simply freezes in place.
     
  26. AmoebaMan I didn't change anything when it comes to spawning, so there shouldn't be issues like an infinite loop or something like that. I'm gonna take a look at the when I have time to.
     
  27. Offline

    AmoebaMan

    kumpelblase2 Any progress? I'm trying to use this to make in-game equivalents of players who have logged out so they can be killed while offline (ultra-hardcore server).
     
  28. Not really, no. Have you tried different location (like +1 in the y coordinate) or does it happen no matter what you pass into the method?
     
  29. Offline

    IDragonfire

Thread Status:
Not open for further replies.

Share This Page