dop2000's Forum Posts

  • Set correct "First layout" in project properties.

  • Browser object has several expressions you can use - vendor, version, platform etc.

  • Have you tried my demo? I posted it here a few times:

    dropbox.com/s/p40ibb75m9g8z8j/ZoomTouch.capx

    Run in Chrome, it may not work very well in Firefox due to some bug with touches getting "stuck".

  • Your code needs to be optimized for such a big number of objects. And it's not only the ZombieAI, CivilianAI event sheet is just as bad...

    You should avoid using "For each" loops on every tick for a big number of instances. First, pick suitable instances, then loop through them with For each. And don't run it on every tick.

    So, replace this:

    For each Zombie
    Zombie timer "follow" is not running
    Zombit is not eating
     -> do a whole bunch of stuff
    

    With this:

    Every random(1,2) seconds
    Zombie is not eating
    Zombie timer "follow" is not running
    For each Zombie
     -> do a whole bunch of stuff
    

    Avoid using pathfinder too often for too many objects, avoid regenerating obstacle map too often. Consider making pathfinding cells bigger.

    Also, your "While" loops have no emergency exit, so they can get into an infinite loop, or simply run for too long. Add another condition "Loopindex<10" to them to avoid this.

    Try disabling big blocks of code to find what's affecting performance the most. Try to decrease the number of collision checks per tick (it's currently too high).

    Add debug output into your events to see if they work as expected. For example, if you add Browser log "failed" into Civilian On Failed to find path event, you'll see that after a few seconds this event starts running hundreds of times on every second! Which means there is some problem with civilians pathfinding.

    You may need to compromise many things to improve performance..

  • Have you tried searching the forum? This is a very popular question, here are two posts I found:

    construct.net/forum/construct-2/how-do-i-18/how-do-i-draw-lines-68949

    construct.net/forum/construct-2/how-do-i-18/how-do-i-create-a-line-while-d-128365

  • You can set "Unbounded scrolling=Yes" and scroll outside of layout borders.

  • You can convert individual R,G and B channels into one number using rgb() expression, but as far as I know, there is no easy way to "extract" channels from the full rgb color. You can do this with these formulas:

    b=(color % 256)

    g=int(color/256) % 256

    r=int(color/65536)

    Also, check this plugin:

    construct.net/forum/construct-classic/completed-addons-40/plugin-bitwise-operations-41684

  • Lol, I know the feeling. I've been using C2 for almost 3 years and still discovering things like this.

    Most events in Construct pick instances. If at least 1 instance was picked, the event is considered to be true. If no instances were picked, then the event is false, and the "Else" condition is triggered.

  • Yeah, comparing count and picked count should work.

    Here is another way to check if all sprites have their variable set to 1:

    Sprite variable not equal to 1 -> (no actions here)
    Else -> (put your actions here)
    
    (else event will only be triggered if there are no instances with variable not equal to 1)
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't think this is possible. The only solution is to keep the same value in a variable.

    EDIT: It's possible with scriping. For example, to get "Outline" effect parameter from an object by UID

    var i = runtime.getInstanceByUid(localVars.objUID);
    i.effects.forEach(function (e) {
    
    if (e.name=="Outline") {
     localVars.result = e.getParameter(localVars.parameterIndex);
    }
    });
    
    
  • Yeah, "pick all" event should should be nested under "path found" event, as it's done on sizcoz's screenshot above. I tried to show it in my first comment, but the new forum kills code formatting...

  • You do not have permission to view this post

  • No, just some number. You should probably randomly change the wind speed and direction every moment, and display it on the screen, so that players could adjust their aim.

  • Then use overlapping at offset (-windSpeed).

  • Can you post your capx, or a screenshot of the event sheet?