dop2000's Forum Posts

  • Yeah, I really wish dragging events would be improved. Sometimes it’s impossible to place an event inside another one without creating an empty sub-event first.

  • You can try making the iframe object global - then it will not be destroyed when switching to another layout. You should be careful though not to create duplicate iframes when returning to the first layout.

  • Pics would definitely help to understand your question. You can upload them to any service like imgur and post links here.

  • Why do you use Browser.execJS? All these operations can be done with the Date plugin.

    Also, your 4th event on the screenshot will run AJAX request on every tick while the condition is true - the server may not like it and will ban your IP address.

    Can you show the AJAX response - JSON contents?

    To convert the current time to minutes use these expressions:

    // Minutes since midnight (UTC time)
    int((Date.now % 86400000) / 60000)
    
    // Minutes since midnight (local time)
    Date.GetHours(Date.Now)*60+Date.GetMinutes(Date.Now)
    
    // Minutes since the start of the current hour (local time)
    Date.GetMinutes(Date.Now)
    
    
  • Ok, so modify the code a little:

    + Array: For each XY element
    + Array: Current value = 1
    ----+ Sprite: X = Array.CurX×64+832
    ----+ Sprite: Y = Array.CurY×64+64
    -----> Sprite: Set visibility Visible
    
  • You can add instance variables to the sprite — indexX and indexY — and fill them with values: indexX from 0 to 4, and indexY from 0 to 9.

    Then you’ll be able to pick the sprite instance corresponding to any array element.

    Another option is to pick the sprites based on their position. Assuming your first sprite's position is (0,0), you can do this:

    + Array: For each XY element
    + Array: Current value = 1
    ----+ Sprite: X = Array.CurX×64
    ----+ Sprite: Y = Array.CurY×64
    -----> Sprite: Set visibility Visible
    
  • As I explained in your other post, you need to pick the enemy instance. Picking is very important in Construct. If you don't pick the correct instance or instances, the event applies to all instances.

  • In the second event, you need to pick the enemy instance which each Pikmin is pinned to.

    For each Pikmin
    System Pick Enemy By Evaluate Enemy.UID=Pikmin.Pin.PinnedUID
    

    That's why I suggested using the hierarchy - it's a lot easier because you can use "pick children" and "pick parent" conditions.

  • I can't read a word but it sure seems like somebody went through a lot of effort to tease out a lot of the engine quirks.

    That's WilsonPercival (Igor in RL), he's a brilliant programmer, started with Construct Classic. He has submitted over 800 bug reports! So yeah, he probably understands the engine better than any of us.

  • There was a similar thing my friend done (its in russian though), with some insights he managed to dig from a lot of testing and digging the internals.

    Hey, you are friends with WilsonPercival too! He has done a lot for C3, but you should take some his findings and suggestions with a grain of salt, though. For instance, I really don't like his idea of using "Wait for previous action to complete" instead of "Wait 0". Just because it works doesn't mean it's correct.

    I agree that a community-driven list of Best Practices would be a great idea, but ideally we'd need Scirra's involvement (for moderation and guidance) to keep it accurate and prevent risky guesswork.

  • I managed to have the "on path found" work, but no more than 2 butterflies can move at a time, and I need ALL of them to be moving

    Can you show your updated events?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Please study a few examples on how to use the Pathfinding behavior. It's not a good idea to use "find path" action on every tick. And you need to wait for the "On path found" event before moving along the path.

  • These expressions were replaced by scripting and the Date plugin a long time ago.

    If you used them in old projects, they should still be available there.

  • The second-to-last event in your screenshot makes the projectile follow the player every tick - that’s why it doesn’t stay on the enemy.

    Also, why are you using so many movement behaviors? Follow, MoveTo, and Bullet all conflict with each other.

    Instead of the Follow behavior, you can just attach the sprite using the hierarchy. The logic would look like this:

    On start of layout: 
     Add Projectile as a child to the Player (sync X and Y)
    
    On click
    Player Pick child Projectile: 
     Projectile set bullet enabled and launch in mouse direction
    
    Projectile on collision with Enemy: 
     Projectile set position to Enemy
     Enemy add Projectile as a child
    
    
    Every 1 second
    Enemy Pick child Projectile: 
     Enemy subtract from Health
    
  • C2 and C3 are quite different, you should always mention which version are you using when posting on the forum. You did, my bad.

    However, in this case, you can open my example in the free version of C3 and copy/replicate the events in C2.