R0J0hound's Recent Forum Activity

  • You can do it by selecting events in the event sheet, right clicking and selecting "replace object". With it you can replace an object with another of the same plugin type.

  • Hi,

    I like the event setup in your first version. So I edited that slightly to get it working.

    https://dl.dropboxusercontent.com/u/5426011/fixed/sargas_hexzones.capx

    All I added was parameters for the functions. Functions don't keep track of what was picked when it's called, it only knows what was passed to it.

  • I imagine restarting C2 would fix it, but as something less drastic have you tried closing that layout tab and then re-opening it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The "for each element" condition doesn't set the loopindex. Instead use Array.CurX, Array.CurY or Array.CurZ.

  • Well, if for instance you only wanted dirt after the 5th row, then add a system compare condition to the bottom of event 2:

    Tile_Array.CurY > 5

  • So, your events were like this?

    keyboard: on down arrow pressed
    mainmenu_items: animation frame=0
    ---> mainmenu_items: set animation frame=1
    
    keyboard: on down arrow pressed
    mainmenu_items: animation frame=1
    ---> mainmenu_items: set animation frame=2
    
    keyboard: on down arrow pressed
    mainmenu_items: animation frame=2
    ---> mainmenu_items: set animation frame=0

    Adding the wait works well as you delay the frame from getting set right away so the 2nd and 3rd events won't be true and run. On a side note you should be able to do "wait 0" as it will just delay till the end of the event sheet.

    Another approach I like to take in a situation like this is to also use the modulus operator to simplify the logic. eg:

    keyboard: on down arrow pressed
    ---> mainmenu_items: set animation frame= (mainmenu_items.AnimationFrame+1)%3
    
    keyboard: on up arrow pressed
    ---> mainmenu_items: set animation frame= (3+mainmenu_items.AnimationFrame-1)%3
  • It's fairly simple to do but will take a little work. Basically all you do is add a sprite to the layout and give it the same behaviors that the Block object has. Then go to the event sheet and go one by one through all the events and change anything that says block to sprite. Then after that you can safely delete the block type from the project.

  • Edit* Something screams out as very wrong when you are better off downloading from the forums than the main page.

    I think it's along the same lines as C2's beta/stable releases. It seems to be pretty common practice with a lot of free software, and especially open source.

  • Niiccs

    My bet is the crash is caused by the "OR" condition. It often works fine until a layout restarts. The solution is to not use it at all in Construct Classic. Other than that I can't think of any other cause. If that doesn't fix it pm me the cap and I'd be happy to take a look.

  • Another alternative to a function is to use the system condition "pick all". So your event could look like this:

    spriteShot: On Colision with spriteEnemy

    system: pick all spriteEnemy

    ---> spriteEnemy Destroy

  • Instead of using "overlaps at offset" use an array to store the grid for a quick lookup. So if your blocks are 32x32 and have a top/left hotspot, and your layout is 640x480 then your array size will be 640/32 x 480/32 or 20x15. Then fill your array with 0 for empty and 1 for filled if a block is there. Your initial event will look like this:

    Start of layout

    for each block

    --- set array at int(block.x/32), int(block.y/32) to 1

    Then later on for the simple case of instantly growing grass you can see if it's empty above the block like this:

    for each block

    array at int(block.x/32), int(block.y/32)-1 = 0

    --- grow grass

    Anyway regardless, I still think the second part of my last post will work for the situation of the grass growing from the left to right, one per time frame.

    I whipped up an example and I think I found an alternate method that would work better. Basically have the grass grow next to another grass every 0.5 second, but on every 2 seconds make a random sprite grow grass instead. That would solve the issue of needing an initial grass to grow from.

    https://dl.dropboxusercontent.com/u/5426011/examples19/grass%20grow%202.capx

  • Relevant topic:

    http://www.scirra.com/forum/virus-on-r148_topic78484.html

    It's a false positive.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound