Dunkelseele's Recent Forum Activity

  • Thanks, SullyTheStrange... that was a perfect guess. I forgot to set the animation not be looped. That easy. Works perfect now.

    Thanks also chrisbrobs, very good to see that I was doing it right, basically (comparing with your event-list). I want to create all FX and visuals myself though...

    Best regards,

    Noel

  • Hello!

    I recently dug up Construct because the urge to create a top-down zombie game that would be better than Zombie Horde 3 was too much for me to bear.

    I quickly ran into a problem tough... how do you create decent muzzle-flash? Currently I have a animated (2 frames) sprite, which I create together with each bullet fired from the player-sprite. But how do I delete the sprite afterwards, because at the moment it just stays there indefinitely... I tried to destroy it after the animation has ended, but that didn't impress it a bit.

    I'm sort of stuck here, any help ... please?

    Best regards,

    Noel

  • Okay, that's my current problem:

    I want to draw him a column of tiles. I do this via:

    FOR EACH entry in array "Array" {
     IF:
     value at Array.CurrentX, Array.CurrentY 
        THEN:
        create object "GenericTile" at (LayoutWidth / 2) + (Array.CurrentX * Global('tileoffset_x')), 20 + (Array.CurrentX * Global('tileoffset_y'))
        add 1 to global variable 'x_counter'
    [/code:2hl03ttl]
    
    Fine. He should have drawn a number of tiles now ... but if he doesnt stop, he will draw the next few rows also at the same position. So at the end, no matter how many columns I wanted, I will have only one column with all other columns stacked over it. So I want him to stop after the first column is done, correct the offset and continue.
    
    [code:2hl03ttl]
      IF:
      'x_counter' equal to 'number_of_columns' 
        THEN:
        substract 'substractor_x' from 'tileoffset_x
        substract 'substractor_y' from 'tileoffset_y
        add 1 to global variable 'number_of_columns'
    }
    [/code:2hl03ttl]
    
    So the next column will be set off by the value of the substractor (usually the width of the tile). I continue this behaviour as often as needed till all columns are done. Is this wrong? It has to be, because it doesn't work.
    
    Suggestions please?
    BTW: Today is a rainy grey day. -.-
  • Epic. Using frames with zero animation speed is a clever thing. But I think this doesn't really helps me with the placing of my tiles. Besides the problem would then be, to change the animation frame of every tile according to numbers in an array.

  • That's a whole other box of worms since every other row/column is offset by a tile size.

    If it makes things easier you can make a grid manually in the editor, and then load all your images into one sprite, then simply change the frames at runtime.

    I don't fully understand that. I can toggle on a visual grid to help manual placement, but that's not what you meant, right?

    And how (and why) should I want to put all tiles into one sprite? Im utterly confused

    Thing is your still going to have to figure a way to get the offset, as well as pick that particular instance.

    'm out, maybe we talk about different things? At the moment the x/y positions of tile placement are defined as: (LayoutWidth / 2) + (Array.CurrentX * Global('tile_offset_x')), (20 + (Array.CurrentX * Global('tile_offset_y')) whereas the half-tileset-variable is used to offset the tiles, and is after every complete vertical row reduced by a full tilesize (50, 26). So I should start with a row as long as the arrays Y-value and continue to the left with new rows Array-x-length times...

    My problem at the moment is, that the condition at which it should jump into the new row (by changing the offset) to place it, is too true. My current event sheet in shortform:

    Fill Array with random numbers,
    go into for each loop {
      if Array.CurrentX, Array.CurrentY is 1 - place Desert sprite at (see formulae above) and add 1 to variable x_counter.
      if above condition is true and the variable x_counter is greater or equal than the Arrays X size - substract 50 from tile_offset_x and substract 26 from tile_offset_y
    
     the same thing above again with the only difference that, if Array.CurrentX, Array.CurrentY is 2, a grass tile will be placed.
    [/code:1bngpcsa]
    
    I'm aware that at the moment, it would only produce two correct aligned rows... and probably all other rows over the second one after that. But even this don't work. Because every loop he substracts again from tile_offset_y and x which leads to abysmal values like -4029 and greater. I need this substraction only once, for now.
    
    
    

    One thing I'll suggest is pick your tile sizes now, and make sure they work for both height and width... and divisible into the map. 48 x 23 doesn't work too well.

    Yep, I did that after finding out I need to offset each next tile by half the tilesize, and 23 really isn't that great for dividing. So the new tilesize is 50x26px which divides nicely into 25x16 offsets.

    I just tried iso sprites with rts behavior with no issue (except sorting, of course, but that's better solved with the filmation algorithm... it gets easier if everything is ground-based)

    You're not telling me my effort was pointless because I could used an built in behaviour which does everything I am trying to do manually, are you? I can't even seem to find that RTS-behaviour-thingy in Constructor...

    Beautiful concept pixel art btw. Really, kudos.

    Thanks, wait till you see the real deal ingame, and in (modest) motion.

  • Thanks to you two, I now understand another concept: referencing others objects values as variables in objects. I'm now near solving the problem that my map would need to be looking diamond-shaped while the map from your example, Citnarf, was a angular. box shape. You get it.

    I'll probably upload a first version of the generator with some eye-candy tomorrow, so you can see all your effort in helping didn't went down the drain.

  • Okay, so far a few new questions have arisen.

    What does the "For each element" condition do exactly? I guess it is a loop?

    As far as I understand: You are filling the array with random data (I didn't noticed at first) from the range between 1 and 2. What does the "+1" after the "Random(2)" do? Does "Random()" start indexing at 0? So you add 1 afterwards to prevent a 0 showing up in the array?

    What is "Array.CurrentX" exactly? I mean, it refers to the X-row of the two-dimensional array named "Array", I can see that. But what does it include, if it is a variable? As far as I understand it is a counter...?

    Another miracle: Where exactly do you say how big the array should be?

    So many questions. I hope some will be answered.

  • You sir, are being very helpful!

    Your example is perfectly what I wanted to do. I hope by studying your event structure I can learn a thing or two. Thanks alot!

    Next thing would be the random creation of the array data, or maybe a second pass of drawing to place buildings, landmarks, vegetation and so on. Im very excited!

    I'll keep you posted about my progress.

  • While i can't really help you with the random generation, i can help with placing sprites according to values in an array.

    http://dl.dropbox.com/u/6660860/array.cap

    I didn't comment it, if you need any help met me know.

    EDIT: Just realized you seem to be doing this in python, my .cap is evented.

    Thanks for your example... that will certainly help me! And I'm not yet sure if I will do this in Python (as that would include learning it first ), but I thought my explanations would be much more readable if written in plain C, as that is something most people can read and understand.

    EDIT: I can't open it. It says it was created with a newer version. Check updates reports my version as the newest one. I'm confused. You using a Nightly or Beta-build?

    I'd suggest you take a look at the Perlin Noise plug.

    Thanks! I certainly will take a look ...

    Also, yeah isometric and the RTS behavior won't mix well at all i don't imagine, not to mention how hard isometric can be to work with.

    Well, most 2D RTS games use isometric perspectives, or am I horribly mistaken?

    Age of Empires I+II, Sudden Strike I+II, each and every clone of those... and was C&C not isometric too? Of course I neither can or want going anywhere even near the greatness of those games...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks! I will ask him to have a look at this thread right now.

  • Hi!

    I am planning to do a little sandbox to play around with pattern creation, random landscape generation and so on, kind of an RTS-type sandbox-game (maybe it will evolve into a full game over time).

    For that reason I want to create a tiled landscape (isometric angle of view). Something that looks not exactly but alot like this in the end (I made it to visualize the style) :

    <img src="http://www.strongground.de/bunker/images/diorama.png">

    My idea is to use an array, where the data for the level is stored (and later randomly generated before being stored into the array). My first step would be the generation of a terrain with an array like this:

    int terrain[4][4]={{1, 2, 1, 1},
    	  		       {2, 2, 2, 1},
    			         {1, 2, 1, 1},
    			         {1, 1, 2, 1}};[/code:1z5h00kl]
    In this small example, it would be a tiny map with 4x4 tiles, of which tiles with identifier 1 are desert-tiles, and 2 are grass-tiles. Like these: <img src="http://www.strongground.de/bunker/images/tile_desert.png"><img src="http://www.strongground.de/bunker/images/tile_grass.png">
    Then, according to the array, different sprites would be placed, another problem because I don't exactly know how to dynamically place sprites yet. I managed to "create" an object instance at an exact location derivated from a sprite object when clicking on a button. Which is, in a way, pathetic. I would like to use a variable instead of fixed per-pixel locations, which then will be counted up after each tile-placement. That will do for a row. How to manage multiple rows this way, I'm not so sure. Another variable counting up after every x-dimension placements?
    
    [code:1z5h00kl]
    (Assuming the dimensions of the array are w=4 and h=4)
    int max_x = w
    int max_y = h
    int i1
    int i2
    
    for (i1 < max_y;) {
      for(i2 < max_x;) {
        // Here the tiles would be placed
      }
    }  
    [/code:1z5h00kl]
    
    Something along this lines... But how to do it in Construct?
    
    So much for my first few questions (although sometimes not directly asked). You think you can help me getting this to work? : )
    
    Best regards,
    No�l
Dunkelseele's avatar

Dunkelseele

Member since 22 Sep, 2010

None one is following Dunkelseele yet!

Trophy Case

  • 14-Year Club

Progress

14/44
How to earn trophies