Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Ultimate Isometric Toolkit Script help

Discussion in 'Scripting' started by BearSheriff, Jun 23, 2015.

  1. BearSheriff

    BearSheriff

    Joined:
    May 14, 2015
    Posts:
    20
    Hey guys, I am building an Isometric turn based game in the vein of the older Xcoms and I have some questions about the Ultimate Isometric Toolkit that can be purchased on the asset store. So in the GridMap class the creator of the asset creates a gridmap made up of an extremely large one dimensional array, I want to make it a three dimensional array, because it'll make more sense and work with the rest of the project better. How do I do that?



    Just to reiterate I want Tiles to be a three dimensional array, but I keep on running into issues.
     
    Last edited: Jun 24, 2015
  2. eisenpony

    eisenpony

    Joined:
    May 8, 2015
    Posts:
    974
    His code is good; the design decision was driven by a shortcoming of Unity. The code uses encapsulation to shield you from the fact that the underlying data is stored in a one dimensional array. You are able to get and set tiles using a 3d abstraction.

    I don't understand why you would want to undo his good work. Can you explain more about your comment:
    Like I said, you can get and set tiles using a 3d abstraction, so what more do you want?

    One other comment. You should probably not post code that otherwise costs money to use.
     
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    Aaaand Copyright Infriiiingement!

    The flattened array serializes nicely, so it's a much better idea to just use the implementation out of the box. You can even index it with 3 coordinates, so I can't really see why you'd need the 3D implementation.
     
  4. BearSheriff

    BearSheriff

    Joined:
    May 14, 2015
    Posts:
    20
    Oh man, I din't actually think about that, I guess I'll have to take this down.
     
  5. BearSheriff

    BearSheriff

    Joined:
    May 14, 2015
    Posts:
    20
    Oh thanks, I didn't realize that Unity worked that way. I guess this code works fine then, I was just being stupid. Thanks for the help.
     
  6. eisenpony

    eisenpony

    Joined:
    May 8, 2015
    Posts:
    974
    I hope you don't really feel that way. The forum is supposed to be a place to learn. It's good you are asking about this and I apologize if I came across too strong.

    I really don't understand what you are asking for though since his code provided access to the map information in a 3 dimensional way despite it being stored in a one dimensional array "under the covers."
     
  7. BearSheriff

    BearSheriff

    Joined:
    May 14, 2015
    Posts:
    20
    It just presented certain issues with code my partner and I had written ourselves, we didn't know about the shortcomings of Unity in regards to multi-dimensional arrays. In some of our other code we had assumed the map info was stored in a 3D array and that seemed to make more sense than storing it in a single array, but it appears the original author had no choice in that matter.
     
  8. codebeans

    codebeans

    Joined:
    Apr 7, 2014
    Posts:
    79
    Hi.
    I'm the dev of the ultimate isometric toolkit. As eisenpony said it uses a 1d flattened-3d Array but gives you 3d access via [x,y,z] because Unity can not serialize multidimensional arrays.

    About posting source code: there are key components such as the whole IsoObject class or the whole easing concept along with the controllers that really make up the "value" of my asset. These scripts are stuff that I'd really like not to see posted in a forum. But I do know that this risk comes with giving people source code access (which is a must, to ensure people not only use but also learn certain techniques).

    I even find my stuff on most torrents. As a dev there is very little you can do about it. I'd rather invest my time in making cool new stuff then. In the end people seem to buy the asset because they get the asset+support+updates.

    Long story short: I am ok to see small parts of my code posted here in the forum if they are a minimum to understand a question and do not make use of my asset available to the public. (Still have to bring food on the plate :))

    Oh and the upcoming new asset will be awesome. Small appetizer video will be uploaded shorty.:cool:

    I hope to see something about your project too.
    Cheers!
     
    eisenpony likes this.