+ Reply to Thread
Results 1 to 5 of 5

Thread: Coordinate Change Event

  1. #1
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default Coordinate Change Event

    When the event for a coord change comes in, it seems to carry three separate tables mapping units to the new value, one each for x, y and z. This confused me for a bit, as I was expecting a single table along the lines of:

    { unitId -> {x,y,z} , ... }

    But instead it's:

    { unitId -> x , ... } { unitId -> y , ... } { unitId -> z , ... }

    ... if that makes sense

    Anyway, my question is, would there ever be a case where a unit ID could exist in one of the tables, but not all three?

    Thanks,

    DS

    Gadgets: Unit Frames and Other Stuff for RIFT

  2. #2
    Rift Chaser NerfedWar's Avatar
    Join Date
    Dec 2010
    Posts
    377

    Default

    Quote Originally Posted by DoomSprout View Post
    When the event for a coord change comes in, it seems to carry three separate tables mapping units to the new value, one each for x, y and z. This confused me for a bit, as I was expecting a single table along the lines of:

    { unitId -> {x,y,z} , ... }

    But instead it's:

    { unitId -> x , ... } { unitId -> y , ... } { unitId -> z , ... }

    ... if that makes sense

    Anyway, my question is, would there ever be a case where a unit ID could exist in one of the tables, but not all three?

    Thanks,

    DS
    Hey Zorba, that's just too strange! lol
    ...the internet treats censorship as damage, and routes around it...
    NerfedWar Addons and Tutorials
    * Note: tutorials are currently being ported to the new site.

  3. #3
    Plane Walker Imhothar's Avatar
    Join Date
    Feb 2012
    Posts
    439

    Default

    That representation is actually more GC friendly.
    Instead of creating one tiny table per unit it's always exactly 3 tables.

  4. #4
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    Quote Originally Posted by Imhothar View Post
    That representation is actually more GC friendly.
    Instead of creating one tiny table per unit it's always exactly 3 tables.
    Good point.

    The layout doesn't really matter, it's easy enough to work with either. The only reason for the question is that I need to know which units are included in the coord change event. If I can rely on any one of these three tables being a definitive list of units, I don't have to mess around working out the union of the three.

    Purely an efficiency thing.

    Gadgets: Unit Frames and Other Stuff for RIFT

  5. #5
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    You could probably do

    y[unit] or 0

    but it'd be cheaper if you didn't have to.
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

+ Reply to Thread

Bookmarks

Posting Permissions

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