Yann's Recent Forum Activity

  • global variable count=0
    +on something
      -> System: set count to 0
      +Array: Foreach elements
        -> System: add Array.CurValue to count
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • +System: TowerSmall.X-Basket.X <= 300
    +BuildingFamily: Number = TowerSmall.Number
      -> BuildingFamily: Fade: start fade

    Maybe...

  • probably related to the Array Bug mentionned

  • here's a capx as example

    containerBug.capx

    I don't know if it's a bug or has designed.

    But I was expecting that I could access siblings of an object (in a container) when I create the object.

    Could be usefull for default placement and pinning.

  • When I pass a local variable as argument

    And only within a loop (for/while/repeat)

    the default value of the variable is passed even if I change it before.

    test capx: function&loops.capx

    (note that even when the condition is toggled off, the bug is present)

  • -> set vector X to knockback
    -> set maxSpeed to knockback
    -> wait knocbackTime
    -> set maxSpeed to defaultMaxSpeed

    that's usually how I do a knockback

  • cool thanks (:

  • Indeed, I think the bug I reported here has the same root problem.

    As soon as a function call contains a global/local variable in its parameters, it crashes.

  • You can do the achieve the same expected result with

    set text to Sprite.count-1

  • Hi,

    I've been playing around with recursion to test the new function feature.

    Building a simple factorial function works fine

    +Function: On "factorial"
        + Function: parameter 0 > 1
            -> return Function.Param(0)*Function.Call("factorial",Function.Param(0)-1)
        + Else
            -> return 1[/code:2kjajkjt]
    
    But then I wanted to test a recursive backtrack for generating a 2D maze.
    And there's a js bug.
    
    So here's the capx (it's the dig() function)
    [url=https://app.box.com/s/ygapi1fe12hvikra6ql2]maze.capx[/url]
    
    Also, when you change global/local variable names, the parameters in the function call don't get updated, I ended up with a crash and an invalid capx at some point.
    
    Also, parameter 0 > 1  feels weird somehow, maybe parameter[0] or parameter(0) would be betterYann2012-11-09 19:41:38
  • I wrote one in C this week.

    And I used recursivity at some point.

    For now, since functions aren't yet implemented, you probably can't do recursive algorithms.

    The cool thing with recursivity, is that you get some kind of tree of resolution for free.

    Without recursivity, you need to save in some way each iteration you are making so if you end up with an impossible solution, you can backtrack and try other values.

    Some month ago, I implemented a backtracking algorithm to create a maze, so I think it's possible in C2... but yeah just slightly harder and uglier.

Yann's avatar

Yann

Member since 31 Dec, 2010

Twitter
Yann has 5 followers

Connect with Yann