Spider_hip's Forum Posts

  • Hi all.

    Let's say we have apple, pear, banana, watermelon variables. And they have random values.

    How can I get which one has the biggest value ? And If there are 2 or 3 varibles which have same biggest values, then learn that ?

    This is a very long way if there are more than 4 varibles;

    if apple > pear and apple > banana and apple > watermelon

    if pear > apple etc ect.

    Also if there are 2 variables which have same biggest values if condition goes bigger :(

    Is there any easier way ? Thank you very much.

  • egos

    Can you please share other ways to make revenue. This is important for developers.

    I think 2000 plays = 4 dollars not so bad at all. If you can make an addictive game such as penguin learn to fly game. It has been 1,5 years and It has played 17,000,000 times. Which makes 36.000 dollars in a 1,5 year. And This is just a one way to make revenue. Omg, I bet they made close revenue with other 3-4 sites at least. Which makes around 130K dollars I guess. Not bad at all for a one game. :)

  • I'm sorry about first .capx I get it it was a bit silly.

    I just realized that array.front doesn't mean current(X)+1. It means first x point.

    So I changed my related code part with, Array.At(Array.CurX+1,Array.CurY)

    Now the problem is just above that part. It's,

    if currentX+1 's value is 0 or 1 or 2 ( I wrote this beceause if it's last column there won't be a (x+1,y)point. So there won't be a value. So I wanted to leave last column as it is.) But It doesn't do anything.

    The funny and weird part is that code was

    if currentX+1'value => than 0 and

    if currentX+1'value =< than 2 then do smth.

    When do code was like it was doing smth(not as I expected)

    Lol I'm confused that both codes should be same right ?

    Here is my latest capx file. Thank you for any help.

    dl.dropbox.com/u/56268958/test-procedural2.capx

  • Wow thank you for your great explanations.

    Now I get it.

    Finally I just want to ask one more thing. Already everything wrotes at comments at this example.

    dl.dropbox.com/u/56268958/test-procedural2.capx

    Thank you very much.

  • Thank you for your quick reply.

    So actually at first, latest column(11th) and latest row(11th) didn't get any values beceause there is not 11th elements at array.

    So if I do like as you said, width-1 or if I start for from 1 to array.width does the same job right ?

  • Hi all.

    array.width = 10

    array.height = 10

    I created an array with

    -for x from 0 to array width

    --for y from 0 to array height

    *create object sprite at(loopIndex("x")*17,loopIndex("y")*17)

    *array.set value at(loopIndex("x"),loopIndex("y")) to random(3)

    *sprite.set animation frame to array.value

    <img src="https://www.dropbox.com/s/mqlv5zmtzcub2wm/first.jpg" border="0" />

    so far so good It creates randomly framed 11 to 11 sprites.

    weirdness starts from now on

    -button on click

    --for each sprite

    *delete.sprite

    --array. for each xy element

    *create object sprite at((TwoDimensionalArray.CurX)*17,(TwoDimensionalArray.CurY)*17)

    <img src="https://www.dropbox.com/s/o81ezt8qq4bsx37/duo.jpg" border="0" />

    It creates 10 to 10 sprites ?!?

    Why not 11 ?

  • Hi, I'm confused about creating a simple but procedural 2d map.

    First of all I think I should use neighbor technique such as;

    if (0,0) = 1 then (1,0) is more likely equals to 1

    or maybe more advanced but I don't know if it's efficent we can use;

    Array Map:

    2 3 1

    1 X 3

    1 2 1

    Sum = sum of neighbor tiles values. In this example its 1(there are four pieces 1, two pieces 2 and two pieces 3)

    X value is more likely to neighbor sum value.

    To understand basics. First I randomly created an 2d array with random(3) to their values.

    Then with a button click, I wanted to activate my procedur but it works differently. I looked

    for each xy element,

    if current array's value is different with array.front value then

    randomize50(2)

    if randomize50 = 1 then set current value as array.fronts value

    if randomize50 = 0 then it's still at same value.

    But it seems it chooses a value, and equals all arrays to that value as I click to button.

    -------------------------------

    I don't know how can I reach to all neighbors ? Maybe with array.at(cur.x-1,cury) and so on.

    Maybe you already recognised, when I click to button, it doesn't create tiles at final x and y lines. How Can I prevent it to count if there is no array (-1,0) or (0,-1) or (array.width+1) I think reason of that problem is about that.

    -------------------------------

    Finally if I can resolve these problems, I may probably solve this but anyway I want to ask, how can I prevent array to create same value in range of X. For example if there is value 3 at (5,5) then if there are more value 3 at range of 2 (6,6)(7,7)(6,7)(7,6) and so on, then randomize that array till there aren't any 2 value at range.

    Here is my cap file.

    dl.dropbox.com/u/56268958/test-procedural.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm completely confused.

    I just tried to make my Procedural tile map generation. there is a tile object with 3 frames.

    for x from 0 to 10

    for y from 0 to 10

    create tile to loopindex(x), loopindex(y)

    stop animation

    tile.frame = random(3)

    set animation frame to tile.frame

    It creates random framed map.

    Now I want to make

    (Neither I can't get chess.chess.UID's sub properties nor loopindex(x)-1. sub properties)

    compare loopindex(x)-1.tile.frame not equal loopindex(x).tile frame then

    global.randomize50 = random(1)

    if global.randomize50 = 1 then

    loopindex(x).set animation frame = loopindex(x)-1.tile.frame

    Which I try to do is if a tile is frame 1 then %50 chanse for tile which is on right is also frame 1.

    Maybe I don't have enough english to explain my self. Sorry about that.

    I just tried to make smth like perlin. Like stones pile up somewhere, irons pile up somewhere else (with high probability)

    ----------------------------------

    I know I really have to learn math. I unfortunately **** at math.

    my second problem is, Is there anyway to do smth like

    if there is tile.frame = 2 then

    for 5 squares range there is not another tile.frame = 2

    maybe this is not the place to ask these questions. I wish if there was a way to get object's property's with for example

    Chess.Chess.DIR2UID(2,0).private variable

    But I can't access to exact tiles while on for condition.

    Sorry to disturb.

    Thanks for any advice

  • Hi rexrainbow.

    Is there a way to implement something like perlin noise with your plugin to generate a random but good looking logical maps ?

    Thank you

  • LogicDistance , to get logic distance between two chess by uid.

    wow , I think this one comes for me. Thank you very much ^^

  • Thank you rexrainbow.. You're great :)

    If we sum all of your plugins and behaviours, It almost equals to strategy maker in c2 :) It's like dream in a dream :)

  • First of all thank you for this great plugins and behavior.

    I created 2 chess objects one for player, and one as a npc.(chess,chess2)

    I used board and squareTX. Board is bigger then window size.

    Player directs chess object with arrow keys. When there isn't chess2 object. Camera automove with chess object. ( I don't know where autocamera came from. Maybe It's part of board plugin)

    If I create chess2 as npc. And give it wander. If chess(player) moves 1 square global turn is turn++. And if global npc value is lesser then global turn. Wander. (I just trid to create turn based movement system as I can)

    But then camera wants to move also with chess2 object as it wander. So If both objects gets far away from each other, camera centers them and looses both objects. I just want camera to follow chess object. :) Where do I do wrong or what do I have to do. Thank you very much.

    oh by the way. Is there a way with your plugins to easily "if player is 3 squares near to npc object then pick that npc object and do smth with it (make chase player).

    I bet even if I can do it with your plugin I can't count if npc see player then follow it. If there is solid object between them, then you can't see player, so don't try to follow him :D

  • Hi all. I need help about arrays. I couldn't still learn to use arrays :'(.

    When it becomes just little 2 dimensional array, my brain shuts down. And if I choose to go with private variables, then I can't pick proper ones and can't use proper functions. Sorry for long introduction.

    Here is my project;

    I have an sprite to use as an excel like cell. I want to spread it to window(maybe later to a proper area). So I used

    for x from 0 to round(displaywidth/sprite.width)

    for y from 0 to round(displayheight/sprite.height)

    add 1 to sprite.count

    So all of the sprites has different private value than each other.(but I think this is not enough to handle) After that things get complicated.

    Here is my problem;

    If I drag a text onto one of sprites, I equal sprite's width to text's witdh. But if text's witdh greater then sprite's witdh so it overlaps with other sprite, just the opposite, if it's lower then there becomes a space.

    Here is my question;

    For example on (3,4) cell, if I put a wider text. How can I push cells which overlaps to right(4,4)(5,4)(6,4) And if last cell on that row goes out of screen, than it should go down row's head. And of course other cells should do same basics.

    And also what if I delete one of the cells. So I guess (3,4) should be (2,4) and the rest same. What if I want to add between one of them. :(

    I think this is very hard to do with private variables. I should learn to use 2d arrays. Then with some maybe mathematical functions this can be done. But as I mentioned before I can't think that wide.

    I had seen an example before which was a complete space shooter game with enemy ai done with only arrays and functions. Omg it was amazing. But I couldn't learn to use arrays even with those examples.

    Sorry for long post. I can send my cap :) but there is nothing more then tons of private variables and a sprite and text. :)

  • Hi, I know It has been a year, but there may be people who also interested like me about this topic.

    First of all I'd like to thank you for this nice example. Than I'd like to ask a question. What if I have 32*32 but also double sized 64*64 (tree)objects. What should I do than ? Do I have to split my sprite to 4 pieces ? But what if another player wants to use this map editor. Is there anyway , if I choose 64*64 object from editor, turn tiles to 64*64 , than if I choose 32 again, turn back to 32 tiles.. If I did it on map editor as theory. What should I do on save and load ?

    Thank you

  • On multiple objects to specify to construct which one you want to work on, you should use that object on event.

    Like, if you use smth "on collision between something and snowman => jump snowman" than your action works. But if you use like " on collision between a and b => jump c" than construct jumps your all c objects. Beceause there is nothing to specify any c object.