dop2000's Recent Forum Activity

  • If you can reproduce this issue, you should file a bug report:

    github.com/Scirra/Construct-bugs/issues

  • I really don't like "Trigger once" condition and rarely use it. It seems innocent and convenient, but in reality it often causes nothing but troubles.

    I suggest using a boolean variable instead.

  • Something like this:

    SelectIcon is overlapping Family
    .. Canvas set position to (Family.BBoxLeft, Family.BBoxTop)
    .. Canvas set size to (Family.width, Family.height)
    .. Canvas paste object Family
    

    Note that pasting is not instant, you need to wait a tick or two before removing the sprite or the canvas.

  • I don't know your game, so I don't understand what's going on in that gif..

    Did you try the things I suggested in my previous comment? If you draw something else on the canvas, can you see the canvas object?

  • Because Repeat calls the function every tick, if I understand correctly, and the loops overlap each other.

    Yes, any condition runs on every tick, unless you put it inside some triggered event or a function.

    I assumed you would use my code inside "Enemy on created" event or something like that.

    The code in your last screenshot is too complicated and possibly buggy, especially with multiple enemies.. You should either create all waypoints for the full path in one go, or use "On arrived" trigger to move to the next point. I also suggest using Timer behavior instead of "Every x seconds" and "Waits" - it gives you much more control and you can run different timers for each enemy instance.

    For example, if you you need an enemy to move to point A, wait 1 second, move to point B, wait 3 seconds, then you should use this sequence of events (in pseudocode):

    On created: Move to A
    On arrived to A: Start timer "moveToB" for 1 second
    On Timer "moveToB": Move to B
    On arrived to B: Start timer "patrol" for 3 second
    
  • I can agree with #1 and to some extend with #2, but #3 is definitely unrealistic and will not be compatible with the current expression structure.

    I would suggest posting 3 different ideas, to allow people voting for each idea separately. Ashley has repeatedly asked not to put multiple suggestions in a single post.

    XHXIAIEIN Large images - no, large layouts - yes. But I don't see how this can explain the random nature of the problem. I can be working with events for an hour without any lags, and it would suddenly freeze for 20 seconds when I enter a new action or edit a comment.

    1StepCloser I can try, but my other laptop is very old and low spec. It will probably be just constantly slow.

    Asmodean Thanks, I didn't know about the task manager in Chrome. It doesn't show anything useful though. During the freezes the CPU value for Construct 3 tab jumps to 100-150. But nothing else changes.

    Windows Task manager only shows a small increase in CPU usage for Chrome - from ~3% to 6-7%. There are no spikes for other apps or services.

    Jase00 I managed to force Chrome to use my Nvidia GPU. The editor did feel a bit faster overall. But it didn't fix the occasional freezes unfortunately.

  • Never use "Trigger once" with multiple object instances, it will not work correctly! If you want to execute some code for an Enemy instance once, you should use state variables, for example create isReloading instance variable.

    There is another issue - once you picked an enemy with no ammo, you can't pick another instance (its teammate) in the same event. A common solution is to use a family. Add Enemy sprite to EnemiesFamily and then you should be able to do something like this:

    Enemy Ammo<=0
    Enemy isReloading=0
    . EnemiesFamily Pick nearest to (Enemy.X, Enemy.Y)
    .. Enemy Set isReloading to 1
    .. Enemy Pathfinding Stop
    .. Enemy Find path to (EnemiesFamily.X, EnemiesFamily.Y) 
    

    I also recommend running this code in the same event where the enemy fires a bullet. This way you will be saving resources because it will not be running on every tick, and it will only execute for a single enemy instance.

    When reloading is finished, set isReloading to 0.

    There may be other complications. For example you probably don't want two enemies with no ammo to run to each other. So you might need to move isReloading instance variable to the family level. And when picking a teammate check that it's not reloading.

    Also, the available teammate may be too far away, or there may not be a clear path to it - you should consider these things too in your code.

  • So when you set to wait 4 seconds before deleting the sprite - was the sprite visible for 4 second? Then disappeared, but there was nothing on canvas?

    Can you try drawing something on the canvas before pasting? For example fill it with red color, draw a blue circle. Then paste the sprite, wait a few seconds, move the sprite 100px to the side.

    This way you would at least know if the pasting action doesn't work, or if the issue is with something else. Perhaps the canvas is not created, or it's invisible or it's in a different place, or the size is wrong etc.

    Oh, and also add "Wait 0" before pasting, maybe this will help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • With MoveTo you can do something like this:

    Repeat 10 times
     Sprite MoveTo position (startX, startY+loopindex*100) (add waypoint)
     Sprite MoveTo position (startX+50, startY+loopindex*100+50) (add waypoint)
    

    In your screenshot you left tween tags empty "". Just give them descriptive tags like "move_left", "new_cycle" etc. Then you will be able to track the progress of every tween using events like "Tween is playing", "Tween finished".

  • You can test in an old C3 version - if it still works there and doesn't work in the latest version, then it may be a bug, and you can report it.

    I know pasting on Canvas was working in my Android game, but I haven't updated it in almost two years.

    Thanks. In my case the laptop is always plugged in. And the power management profile is always set to "High performance".

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 257 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies