We have detected that cookies are not enabled on your browser. Please enable cookies to ensure the proper experience.
Results 1 to 3 of 3
  1. #1

    Getting Entities

    Probably yet another "Turbine doesn't let you do that" scenario.

    I'm trying to get entities other than the localPlayer. Specifically, I want to test if something heard (say or emote) has been generated by a player or a NPC. Easy enough once I get the object - using IsA to test what sort of actor it is.

    I see how to get the localPlayer, and how to follow that to get related entites (e.g. party members). Plus the undocumented GetTarget() command [does that still work?]

    But what about other entities?

    Sometimes it's possible to pick up the ID of an actor using a chat monitor, since the 'popups' are encoded in that data. (<select...> commands which gives the ID of the actor). I would think that, given the id, it should be possible to get the object, but I'm not seeing any command to do that in the API docs.

    Is this another SOL situation?


  2. #2
    Join Date
    Mar 2007
    Unfortunately, you can only get an Entity from an Entity so you have to follow the chain from LocalPlayer through Party or Target. FWIW, GetTarget is documented as a method of the Turbine.Gameplay.Actor object in the latest docs. The TargetChanged event is also documented in the latest docs.

  3. #3

    follow up questions

    A pity.

    Playing around with this, I see that GetTarget() returns an Actor, not a Player. Even type-casting (so to speak) the return as a Player doesn't work - so I assume the routines only pull an "actor's" worth of information from the server - that, on the local machine, player-level information simply isn't there for the target, yes?

    I see, too, that that temporary structure is a volatile copy which (if I'm right) is automatically destroyed (unloaded?) when the target is un-selected! Any way to override this?

    Parsing that returned structure, I get { ["__implementation"] = Type(userdata)} rather than an actual table. I assume this is some sort of 'packaging' done by Turbine lua routines. Is there any way to unwrap that packaging, or are we entirely dependent on the provided methods to pull data from it? Of course, the latter would be better coding on their part... but the former would be more fun for us!

    Not that any of this is immediately relevant to my current project, but it's an entertaining distraction... heh.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

This form's session has expired. You need to reload the page.