Drawing spawn-points/patterns/coordinates, and convert it into a table?

ApprowApprow Member Posts: 703

For example you want to spawn an arrow made out of coins, you have to fill in each x and y coordinate which can be really confusing. But is there something out there where you can draw a pattern in a visual grid, and it converts all the drawn coordinates into a single table? Or maybe something similar to this?

Thanks

Comments

  • SummationSummation Member, PRO Posts: 476

    @Approw said:
    For example you want to spawn an arrow made out of coins, you have to fill in each x and y coordinate which can be really confusing. But is there something out there where you can draw a pattern in a visual grid, and it converts all the drawn coordinates into a single table? Or maybe something similar to this?

    Thanks

    Working on it.

  • ApprowApprow Member Posts: 703

    @Summation for real :smiley: ?

  • SummationSummation Member, PRO Posts: 476

    @Approw said:
    Summation for real :smiley: ?

    Yeah.

    It's complicated but my basic theory is to make a shape (like the arrow made of coins you mentioned) with 1's and 0's in an integer table, say 9 by 9.

    If the table is all zeros, you can put a 1 where the actor should spawn.

    For example:

    000010000
    000001000
    000000100
    000000010
    111111111
    000000010
    000000100
    000001000
    000010000

    You see how the 1's form the shape of an arrow?

    So, you take a start X and Y coordinate and have that equal row 1, col 1.
    From there, it's just adjusting the X and Y spawn point based on whatever row and column you're on.
    And it should only spawn if there's a 1 in the table cell value.

  • ApprowApprow Member Posts: 703

    @Summation Sounds like a good structure to me. Setting the grid size would also a very imported thing in order to create more precise spawn locations. I would love to see how this turns out;) Good luck

  • SummationSummation Member, PRO Posts: 476

    @Approw said:
    Summation Sounds like a good structure to me. Setting the grid size would also a very imported thing in order to create more precise spawn locations. I would love to see how this turns out;) Good luck

    Ok, check this out.
    It doesn't spawn instantly because of the Spawn behavior, but it does create the shape.
    Let me know what you think. :)

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    @Summation pretty neat :)
    It might be a little quicker by using TableSearch to check witch cells have the number 1 in it.
    But your method works too.

    Mental Donkey Games
    Website - Facebook - Twitter

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    Got curious and had a little experiment...
    Here is a very quick version using TableSearch.
    It´s a bit messy because i don´t have much time to fine tune it.
    You can add/remove as much rows and columns to the table as you want.

    Improvements that i need to make when i have time...
    -The last row of the table needs to be all zeros. (I already know how to fix this)
    -The spawning is upside down when compared to the table. (the table search needs to be reversed to fix this).

    It´s a little faster than the demo by @Summation

    I´ll improve this when i have time...

    Mental Donkey Games
    Website - Facebook - Twitter

  • ApprowApprow Member Posts: 703

    @Summation Pretty good stuff, I can work with this for now thanks:)! But I was actually asking if there was a standalone application out there that can export a CSV file (btw sorry if I confused you).

    So what if there was this so called application i'm talking about, where you can draw a shape on a grid or whatever, and every cell has its own X and Y values. This would be a much quicker way to create complicated shapes, paths, or even maps. Another good example: You're creating a top scroller RPG. It contains heaps of images/actors like: trees, walking paths, grass, you name it. If gamesalad needs to load a big-ass scene, you're going to wish you chose another engine. So what if you can spawn everything (or at least 60% or more) in the scene, you will end up with much faster loading times. On top of that, all the actors will be placed pixel perfect if you set the grid size correctly.

    Here is an example of a little town. The orange cells represent a walkable path, the red cells the houses, and the green ones the trees. I hope this makes sense to you.

    So if you can export an image like this into a CSV file, import it in gamesalad, make sure you set up a rule that spawns every given coordinate, and TADAAAA... A complete town build out of blocks. This is actually a very efficient way of using the new rendering engine since we have to work in 64x64 tiled grid.

    Its funny how i'm trying to explaining a piece of software that probably doesn't even exist.

  • ApprowApprow Member Posts: 703

    @NipaDidIt Very interesting, I'm always a bit lost when it comes to table search. thanks:)!

  • SummationSummation Member, PRO Posts: 476

    @Approw

    I understand what you're saying much better now and I haven't heard of a piece of software like that yet.
    I'm glad you like what I worked on and that it's useful, at least for now. :)

    It's beyond my skills, but I'm fairly certain you can tell GameSalad to look at an image like the one you posted of the little town and examine it "square by square" for specific color values using some @Socks level math.

    Then, for each square, it would translate that color into simple values to be put in a table.
    For example, if the color is white, make the value 0; green = 1; orange = 2; red = 3; etc.

    Once this is complete, you save the table, then spawn the town from the newly created table using a method similar to the one I posted -- theoretically you would only have to do this once since once the table is saved, you don't have to examine the image all over again to find the values.

    I hope this helps!

  • ApprowApprow Member Posts: 703

    @Summation Exactly, you got it:)! Or it exports every different color into different SCV files to avoid confusion. So the orange coordinates will get a seperate table that only contains the spawn locations for that specific actor, etc. I'm just saying something:)

    @DeepBlueApps isn't this something you guys could program? I think it's fairly simple if you know how to build these tiny tools. It's a bit similar to the "GS Picture Wave" since also works with grids. I suppose It will be useful for a lot of gamesalad users;)

Sign In or Register to comment.