t4u's Recent Forum Activity

  • Ty. Strange indeed.

  • Then it means the end of Construct for me. Shame as I just understood how it works and wanted to spend long time with it. Guess it's better to break up with Construct after 100 events than after 1000 :/

  • Am I really limit to 100 events in free edition?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • RamPackWobble:

    It does the trick if you add trigger once.

    Magistross:

    What do you mean by "on the top level condition"? Where is the problem in my thinking. I am creating array before I call For each, so why newly created arrays are not counted?

    blackhornet:

    I am aware of the fact that you can use Array.Count. This topic is spawn child of another problem. I planned to use "for each object" for selecting instances as the construct logic for picking up instances is strange for me. Btw adding things on layout is noobish + I will need my object to do "On created events".

  • Part II:

    Blue ball is your digging ship. Green numbers are ids for each tile. Red frame means how much player sees (window). Red number says which pic is it(time) 1- first, 2- second, 3- rd.

    You are moving your ship down(First pic). As you "move down" instead of moving your ship down you move all the visible tiles up.(2). At some point tile with id 2 will fully overlap tile with id 1. In this moment all tiles return to their original positions(From pic 1) but you change animation for tile with id 1 to animation of tile with id 2 (On pic it was brown now you change its color to gold).

    The most bottom tile "asks" The terrain array what material animation should it take (1 - mud , 2 - iron, 3- gold) . I have left 0 as special number(empty). It means you must generate additional rows to your terrain array as you did in part I.

    I have no idea how to write this in construct but im pretty sure its possible.

  • Theory:

    Part I

    Generate the world.

    You will have Width: W and Depth: D(number of tiles in width and in depth). W and D size don't need to cover entire map. You will be generating new "tiles array entries" as player will go deeper.

    You have 3(as example) materials: A, B, C (mud, iron, gold [1,2,3 - in array]).

    You create "terrain" array sized WxD

    You start at terrain(0,0). For this tile generate random number(100)=R.

    Single Tile generation:

    You create 3 sets <0,a>; <a,b>; <b,100> + if-avaible array at given depth.

    a and b will regulate how often material of given type appears at current depth. If-avaible tells if at current depth it is possible to encounter current material (0 for no 1 for yes).

    If 0=<R<= a

    Material_code= 1

    If a= R <= b

    Material_code = 2

    If b=R<= 500

    Material_code = 3

    Before setting every value you check if-avaible array

    index 0 1 2 3

    material is available at given depth 0 1 1 0 [At depth = 0 it is impossible to encounter gold(3) but you can encounter mud(1) and iron(2)]

    You check if if-avaible_array(Material_code,)= 1

    If yes: (0,0)= Material_code

    If no: generate random number R(100) again.

    You do this for Terrain_array from (0,0) to (W,0)

    Update of probability:

    Once you fill (W,0) You will move to (0,1). Before you do it:

    update a, b - in order to show how probability changes with depth (with "a" getting smaller there will be less mud and more iron)

    update if-avaible array in order to show if player has reached depth at which he is able to find new minerals.

    Fill the row as you did before.

    Part II will tell how to do "moving".

  • To the original question(with pics): Any idea why variable_1=1 and not 3?

    About the logic I truly hate it. I know what I want to write but the use of it is so difficult. Maybe I will get used to it but for now <angry face>. It would be nice if there was set of 10-20 code-logic pictures along with Statement it checks.

  • (Pic has been cut Right click to see full)

    Additional questions:

    1. How do I write

    Example 1:

    If (condition 1)

    {

    do 1

    If(condition 2)

    {

    do 2

    }

    }

    Example 2: (This is what happening and I want the logic to work as Example 1)

    If (condition 1)

    {

    If(condition 2)

    {

    do 2

    }

    do 1

    }

    2. How can I see code "written" in Construct in text editor?

  • Do you mean Height and Width? It's set on 20

  • I have variable_1 = 0. On start of layout I create 2 arrays. From on start of layout there is a subevent: For each object(array) do variable_1=variable_1+1. Debug says I have 3 arrays, why value of variable_1=1 and not 3? The same happens when instead of subevent I call function after creating arrays. Function has on call - subevent(For each array do variable_1=variable_1+1).

  • I got 2 arryas.

    First array has (0,0)=0

    Second array has (0,0)=1

    The thing is I want to do one set of action for the first array and other set of action (setting 13 on (1,1)) for the second array.

  • pl.tinypic.com/view.php?pic=149vx35&s=8#.UwvaqbQixdo

    I have 2 arrays. Value at (0,0) works as Id: it is = 0 for one array =1 for the second array. At the beginning of the layout I call function array_start.

    The problem is that for the Second array([0,0]=1) I don't have (1,1)=13. What am I doing wrong?

    ............

    Function add_ar is setting value at [X,Y] with size control so it's not source of problem.

t4u's avatar

t4u

Member since 17 Feb, 2014

None one is following t4u yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies