dop2000's Forum Posts

  • I know I sound like a broken record, repeating this in every post, but you should never use "Trigger once" condition with objects that have multiple instances! And don't use it in loops.

    If there is no parent event for the events on your screenshot, then the second line runs on every tick, changing the value of newColor variable 60+ times per second. So the color will be unpredictable when it's time to spawn a new molecule.

    Also, using "Pick last created" inside of "For each" loop doesn't make sense. And "Every tick" inside of "Every 5 seconds" is meaningless too.

    Basically, the way you organize events is wrong. The whole thing should be done in a single event or function.

  • Yes. And the filter with either of those tags works.

  • Are you using any addons? Could be due to a different version of one of the addons. Compare addon versions, or try saving the project with bundled addons (in project properties).

  • "tag1 tag2" works for me.

  • I'm not sure about spritefont performance, memory consumption and optimization with it. When I used spritefont before, it could constantly shift position, could be displayed incorrectly

    It's actually the other way around! Spritefont is much faster than text objects, uses less memory, and is always displayed accurately and consistently on all platforms. Webfonts, even when added to the project, are rendered differently on different devices, may shift up and down, may look fuzzy etc.

  • Create an instance variable on the Ally sprite. Then use "Ally Set value" action.

  • See my previous comment, I edited it

  • Not sure I understand your question.

    The parent "On Timer" event will trigger for an Ally instance and will pick it.

    Then the nested "Ally has LineOfSight to Enemy" condition will pick all enemies in the range. And then you find the nearest enemy instance among those that are in range.

    I forgot that On Timer can sometimes trigger for multiple instances, so it's better to add For Each loop:

    Ally On Timer "find_new_target"
    System For Each Ally
    
     Ally has LineOfSightClose to Enemy
     Enemy pick nearest to Ally
     ----> Ally set enemyUID to Enemy.UID
     ----> Ally set state to "attack"
    
     Else
     Ally has LineOfSightFar to Enemy
     Enemy pick nearest to Ally
     ----> Ally find path to Enemy
     ----> Ally set state to "chase"
    

    You can save the selected target UID in the enemyUID instance, in case you need to pick the same enemy in other events, for example to fire a bullet at it.

  • Use Timer and LineOfSight behaviors. You can have multiple LineOfSight behaviors with different settings - for example one for long range, where the unit needs to move to the target, and another for close range where it can start shooting at the target.

    Use instance variables for states. And NEVER use "Trigger once" condition in state machine code!

    Here is a very simplified example, just to demonstrate the idea:

    On Start of layout
     ----> Ally Start recurring Timer "find_new_target" every 2 seconds
    
    
    Ally On Timer "find_new_target"
    
     Ally has LineOfSightClose to Enemy
     Enemy pick nearest to Ally
     ----> Ally set enemyUID to Enemy.UID
     ----> Ally set state to "attack" 
    
     Else
     Ally has LineOfSightFar to Enemy
     Enemy pick nearest to Ally
     ----> Ally find path to Enemy
     ----> Ally set state to "chase" 
    
  • In C2 you can make a similar chain with Pin behavior.

    dropbox.com/scl/fi/4o8syo1lzrehoefq46ocs/PinChain3.c3p

    It's a popular question - search the forum, there should be more examples.

  • This is C3 forum. You should've mentioned that you use Construct 2. I spent time making that demo..

  • You can try Follow behavior:

    dropbox.com/scl/fi/7cg90t64mgbzicjcr6ost/FollowSnake.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you use a SpriteFont? It would be the easiest solution.

    construct.net/en/forum/game-development/tools-and-resources-27/sprite-font-generator-v3-64038

    Another option is effects, but they don't always work well with text objects.

    construct.net/en/make-games/addons/449/better-outline

  • could it be a construct update?

    This is easy to test - open the project in previous versions of Construct.