R0J0hound's Forum Posts

  • Kyatric

    Actually all my plugins should work fine on any exported platform as they only use features that c2 already uses internally.

    Plugins in general should work on all exports, although exports like cacoonjs has no support for window controls like buttons or dropdown boxes. And things like file system access is only available on node webkit exports.

  • 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?

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Well, mode7 can be done with an effect for the visual portion.

    http://www.scirra.com/forum/effect-mode7_topic61959.html

    adtodeg(arctan2(vec1.y - vec2.y, vec2.x - vec1.x));

    The calculation to find the angle from one point to another is made simple with the angle() function in c2. So to get the angle from the player to the enemy the expression would be:

    angle(player.x, player.y, enemy.x, enemy.y)

    I take it you want a "knockback" like collision response. With a quick search I found:

    http://www.scirra.com/forum/how-to-make-a-simple-sprite-knockback-in-8-dir_topic53242.html

    In my opinion it's not necessary to utilize the SDK unless there is something that you can't do with events. One typical situation that comes to mind is the need to interface with an outside library of some kind. Another reason could be to assist in some graphic effect that you can't do with existing plugins. However outside of that you can do pretty much anything in events.

  • This topic could be useful:

    http://www.scirra.com/forum/sprite-movement-8-dir-troubles_topic47201.html

    Anyway discard all your events and i'll show you how to get it working with just two events.

    You can get the direction the sprite is moving with the expression:

    Link.8Direction.MovingAngle

    You can then convert the angle into a number from 0-3 where

    0 right

    1 down

    2 left

    3 up

    Here is the formula. it's explained somewhat in the link.

    int(((self.8Direction.MovingAngle+360+45) %360)/90)

    One more bit. The numbers 0-3 can be converted to the direction names with this: where "dir" is a integer from 0 to 3.

    tokenat("right,down,left,up", dir, ",")

    OK,down to business, add an instance variable to Link and call it "dir". Then make these two events:

    Link| 8Direction is moving

    --- Link| set dir to int(((self.8Direction.MovingAngle+360+45) %360)/90)

    --- Link| set animation to "walk" & tokenat("right,down,left,up", self.dir, ",")

    System| Else

    --- Link| set animation to "idle" & tokenat("right,down,left,up", self.dir, ",")