[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. I think I fixed it at some point when working on the persistence stuff. I can't say that for sure, but I just tested it out with my latest build from the persistence branch and I get no errors when calling the getBukkitEntity() method.

    "But when do you pull the persistence changes?" - Most likely in the next days (and no, not soon™). It's all working properly and stable for me, tested several times.
    For those who are interested in how it'll look later on:
    Show Spoiler

    Code:
    entities:
    - ==: de.kumpelblase2.remoteentities.persistence.EntityData
      id: 0
      stationary: false
      speed: 0.25
      location:
        yaw: -208.94829
        pitch: 11.850023
        z: 342
        y: 64
        world: world
        x: 196
      behaviors: []
      name: ''
      pushable: true
      movementDesires: []
      type: Skeleton
      actionDesires: []
    - ==: de.kumpelblase2.remoteentities.persistence.EntityData
      id: 2
      stationary: false
      speed: 0.27
      location:
        yaw: -208.94829
        pitch: 11.850023
        z: 341
        y: 64
        world: world
        x: 195
      behaviors:
      - parameters:
        - value: de.kumpelblase2.remoteentities.entities.RemoteZombie@12b7530
          special: entity
          type: de.kumpelblase2.remoteentities.api.RemoteEntity
          pos: 0
        type: de.kumpelblase2.remoteentitytest.TestBehavior
      name: ''
      pushable: true
      movementDesires: []
      type: Zombie
      actionDesires: []
    - ==: de.kumpelblase2.remoteentities.persistence.EntityData
      id: 1
      stationary: false
      speed: 0.25
      location:
        yaw: -208.94829
        pitch: 11.850023
        z: 342
        y: 64
        world: world
        x: 196
      behaviors: []
      name: ''
      pushable: true
      movementDesires: []
      type: Skeleton
      actionDesires: []
    - ==: de.kumpelblase2.remoteentities.persistence.EntityData
      id: 3
      stationary: false
      speed: 0.25
      location:
        yaw: -208.94829
        pitch: 11.850023
        z: 342
        y: 64
        world: world
        x: 196
      behaviors: []
      name: ''
      pushable: true
      movementDesires: []
      type: Skeleton
      actionDesires: []
    
    this is the yml serializer, but there's also a json serliazier available if you wish. Also, you can build on top of them or create your own if you want to.


    Also, it would be kinda nice when you have issues that you go to the irc first. It's always faster and it's easier for me, thus you get a faster and more in depth reply as well.
     
  2. Offline

    confuserr

    Which irc channel? Would it be possible for you to post the jar of the latest persistence build for me to test with?
     
  3. I'm gonna let the jenkins server build it really quick. Should be up in a minute or so. EDIT: done. Since it's been built by the jenkins, it's also on the maven repo.
     
    confuserr likes this.
  4. Alright, it'll definitely gonna get released on friday. I have fixed the last remaining issues and I haven't gotten any problems within latest tests. The reason I don't release it now is that I don't really have enough time to properly do a general check on it to see if the rest of the stuff is working still fine. Moreover this also gives me a buffer for issues that pop up out of nowhere.
     
  5. Screw my planning, just pushed out 1.4 ! It's already accessible over maven repo and on the jenkins server.
    Changelog:
    Code:
    * Added an api for implementing persistence
    * getActionDesires() and getMovementDesires() now returns a list of desire items so you can also get the priority
    * Fixed npe when settings using custom max health in createentitycontext
    * Fixed issues with copyInventory
    * Changed desire constructors to also accept bukkit classes. You won't notice this right away because it will still work like the way it used to but with the addition that you can also pass in common bukkit classes.
    * Enhanced entity spawning and respawning while loading/unloading chunks.
    * Fixed createEntityFromExisting not setting up default desires
    * Updated with (craft)bukkit
    (see first post for dl)

    How you can use persistence?
    Code:
    EntityManager manager = <your manager>;
    //We set the serializer to a yml serializer. You can also use a json serializer
    //The serialiezer will save the entities in a file located at /plugins/RemoteEntities/<your plugin>/entities.yml
    manager.setEntitySerializer(new YMLSertializer(<plugin_instance>));
    //Save all currently available entities
    manager.saveEntities();
    //...
    //Load all saved entities
    manager.loadEntities();
     
  6. Offline

    XSilver_FalconX

    kumpelblase2
    I'm getting an error that it's not enabled, why is this?
     
  7. Offline

    Fell

    I still cannot reach 1.4 at the Maven repo you defined, nor the FTP repo from the Github pom. 1.4-SNAPSHOT I can find fine, now, but it seems to be lacking.
     
  8. Well, works for me. I just checked the ftp and it's there as well as my online repo browser (here). I also checked if the repository might haven gotten messed up but it looks completely fine. If you can only access the snapshot, are you sure, you're using the release repo?
     
  9. Offline

    Fell

    http://pastie.org/6373045
     
  10. Fell That is just the url from maven where it has to upload it and it shouldn't be used by anyone. You should use the one I showed in the first post
    Code:
    http://repo.infinityblade.de/remoteentities/releases
     
  11. Offline

    Fell

    I tried that one originally, but to no avail

    EDIT: It now works? Oh well, thanks!

    Also, how does your plugin compare to the new Citizens API?
     
  12. Well, Citizens has been around for a long time. They know what they're doing. I haven't looked at it in great detail, but for some parts I quickly looked over theirs and checked how they made that specific thing in theory. Probably the biggest difference is that, since it is included in Citizens2, a lot more users have it already compared to the probably not many RemoteEntity users. Another striking difference I found so far is the customizability of entities. From what I've seen so far, you can't directly change the NMS entity when your using Citizens and only have some ways to modify the bukkit entity for it. Whereas in RemoteEntities, you can, if you want to, change the complete nms and bukkit entity and not only for your own plugin, but for all plugins using RemoteEntities (+the posibility to create your own ones).
    What would be something to look at is the extendability and usability, especially of persistence, and also controllability of entities. Like I said, I haven't look at it in great detail, so I can't say anything about it yet.
     
  13. Offline

    Fell

    Alright, well thanks for the reply. Personally, I will continue to use RemoteEntities, as I see no distinct advantage to using Citizens. One more question, though, if you don't mind: How is attacking done now? Like the act of making an NPC attack a player, and what not?
     
  14. Offline

    LazyLemons

    Is there any way to check if a human NPC exists with a given name?
    Maybe a boolean like isAlive(String name) ?
     
  15. Well, the name is not unique, that's why there's no such method yet. You couldn't be sure if the entity that got checked is actually the entity which you wanted. However, I'll at least create a method for getting all the entities with a given name (check latest snapshot).

    It's done by desires to give you the ability to change the type of attack or movement towards the target. The desire for melee attacks and movement is DesireAttackOnCollide (will probably get renamed in the near future) and for ranged it's DesireMoveToTarget (movement) and DesireRangedAttack (attack). Those also can be changed through their constructor and don't need direct modification (e.g. you could increase the shooting range of a skeleton by just recreating the desire).
     
  16. Offline

    Lolmewn Retired Staff

    Is there a Desire to attack a specific entity?
     
  17. Nope. Since there are more than one desire that is capable of attacking, there's not one specific. Moreover, what would happen with the desire when it succeeded in killing the entity?
    I'll be working on something sort of that, no worries.

    Latest snapshot(s) changed a small part. ActionDesires are now called TargetingDesires to be more descriptive of what they actually do. Thus all the methods connected with them also changed (addTargetingDesire(), getTargetingDesires(), ...) so keep that in mind.

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

    Crawford

    I can't get it...

    Code:
    Could not load 'plugins/NPCTest.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: de.kumpelblase2.remoteentities.exceptions.PluginNotEnabledException: RemoteEntities needs to be enable in order to use this operation
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:182)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
        at org.bukkit.craftbukkit.v1_4_R1.CraftServer.loadPlugins(CraftServer.java:239)
        at org.bukkit.craftbukkit.v1_4_R1.CraftServer.reload(CraftServer.java:594)
        at org.bukkit.Bukkit.reload(Bukkit.java:184)
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:186)
        at org.bukkit.craftbukkit.v1_4_R1.CraftServer.dispatchCommand(CraftServer.java:514)
        at org.bukkit.craftbukkit.v1_4_R1.CraftServer.dispatchServerCommand(CraftServer.java:506)
        at net.minecraft.server.v1_4_R1.DedicatedServer.al(DedicatedServer.java:260)
        at net.minecraft.server.v1_4_R1.DedicatedServer.r(DedicatedServer.java:225)
        at net.minecraft.server.v1_4_R1.MinecraftServer.q(MinecraftServer.java:494)
        at net.minecraft.server.v1_4_R1.MinecraftServer.run(MinecraftServer.java:427)
        at net.minecraft.server.v1_4_R1.ThreadServerApplication.run(SourceFile:849)
    Caused by: de.kumpelblase2.remoteentities.exceptions.PluginNotEnabledException: RemoteEntities needs to be enable in order to use this operation
        at de.kumpelblase2.remoteentities.RemoteEntities.createManager(RemoteEntities.java:43)
        at ch.vtxnet.julian.sch.NPCTest.NPCTest.<init>(NPCTest.java:10)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:178)
        ... 14 more
    My "plugin.yml":
    Code:
    name: NPCTest
    main: ch.vtxnet.julian.sch.NPCTest.NPCTest
    version: 1.0
    depend: [RemoteEntities]
    commands:
      spawn:
          description: Spawn a Human NPC.
          usage: /<command>
     
  19. Crawford You can't use RemoteEntities before the onEnable(). Since you use it when declaring your variables, it's before the onEnable() -> doesn't work.
     
  20. How would I make my Human entity follow a specific player? Right now they find the nearest player and attack them.
     
  21. BurnBlader Just add a DesireFollowSpecific to the human which should follow the player.
     
  22. Offline

    iWareWolf

    kumpelblase2
    I just copied the onEnable() from your explanation and I'm gettin several errors about non existing classes. Please update the OF
     
  23. iWareWolf If you're referring to the example in the first post, then there's nothing for me to update. It is meant to be just the onEnable() and just that. Every IDE can add the imports for you. Also, I don't want to make it whole class, it should just be an example of how it COULD look like.
     
  24. Offline

    iWareWolf

    kumpelblase2
    Yep, when I put it in onEnable() its gives missing class errors.
     
  25. iWareWolf
    Like I said, it is just an example and nothing more. It is not aimed at being used directly, thus I won't change anything there. If you still want to use, just add the necessary imports, as easy as that.
     
  26. First snapshot with MC 1.5 compatibility is up!
     
    bobacadodl, confuserr and mncat77 like this.
  27. Offline

    Fell

    Would you mind keeping the OP up to date, or at least put the Jenkins there? Also, when will you be pushing the 1.5 Snapshot to the Maven repo? Tomorow I'm releasing my new server and it has plugins that heavily depend on RemoteEntities.
     
  28. Offline

    bobacadodl

    Thank you so much for keeping this updated! I really appreciate this AMAZING lib.
     
  29. It should already be there at least jenkins uploaded it there. And yes I'll add the jenkins link to the op.
     
  30. Offline

    Fell

    What is the ID? I can never reach your new builds in the maven repo.
     
Thread Status:
Not open for further replies.

Share This Page