dop2000's Recent Forum Activity

  • You can use the same approach for string variables. If you want to compare a part of the string, use expressions like find(), left(), right(), lowercase() etc.

    But then you will need to pick instances using System events, for example:

    System Pick Workers by evaluating Left(Worker.name,4)="John"

  • I assume the workers are instances of the same sprite?

    I strongly suggest using number variables instead of boolean - they are much easier to work with in Construct. Just assign 0 for false and 1 for true.

    For example, to count the number of workers who have plague, you can use this code

    Local variable n
    Local variable percentage
    
    For each Worker
    Worker hasPlaque=1 : Add 1 to n
    
    Set percentage to int((n/Worker.count)*100)
    

    Another method without the loop:

    Worker hasPlaque=1 : Set percentage to int((Worker.pickedCount/Worker.count)*100)
    

    Basically pick instances by comparing instance variables and count them. When multiple instances are picked, you can use Object.pickedCount expression. For total number of instances use Object.count expression.

  • Another option is to use Permutation Table feature of the Advanced Random plugin.

    dropbox.com/s/tdusbon5jofn4py/TilemapPermutation.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It will be much easier to use MoveTo behavior here - you can give it waypoints for the entire path.

    If you need to use Tween, I would suggest giving tags to tweens. Move them all into a function. Instead of using "Repeat 10 times" loop, run the function once. When the last tween ends (use "On Tween Finished" trigger), run the function again.

  • I think it's the 0,0 position (which 0 is somehow being stored in the array and thus picked as a position to animate)

    Are you resetting the array size to 0 before filling it? Set width to 0, height and depth to 1.

  • Not really...

  • System Save action saves absolutely everything (except for objects with NoSave behavior). It may work for many games, but sometimes you don't want to load some data. For example, you have a volume setting in your game and you reduced volume to 5%. But loading an old save will also load old volume value which was 100% when it was saved. Avoiding things like these is quite difficult. That's why sometimes it's better to make your own save system, where you can control what data is saved or not.

  • In C2 you can pass function parameters when calling a function, in this case pass EnemyMask.UID

    Inside the function use Function.Param(0) to access this parameter value.

  • You can use instance variables and Timer behavior. For example, create "seq" instance variable, pick 5 random circles, assign them seq values from 1 to 5.

    Start a Timer for these picked circles for (2.5+Circle.seq*0.5) seconds.

    This means that the timer for the first circle will trigger in 3 seconds, the timer for the second circle in 3.5 seconds and so on.

    Check out official examples in C3 to learn how to use Timer and other features.

  • If "CodeTextBox" text is: W84FJ3JK then:

    Wait for "CodeButton" to be pressed

    When "CodeButton" pressed then:

    Add "1200" to "Coins"

    It's always recommended to use triggered events when possible. This way your code would only run once when the button is pressed, and not on every tick.

    On CodeButton Pressed <<-- this is a triggered event
    CodeTextBox Compare Text = W84FJ3JK <<-- second condition in the same event
    .. Add 1200 to "Coins"
    .. etc.
    
  • It isn't hard with lerp function: lerp(x1, x2, 0.5), lerp(y1, y2, 0.5) is the middle point between two coordinates.

  • I am not sure if replacing lots of numbers in a large JSON and then loading this JSON back into the tilemap will be any better for performance.

    I too have animated tilemaps in my project and I'm only updating the tiles which are inside the visible area, in my case this is about ~1000 tiles. Updating them every 0.16s only costs a couple of %% in CPU utilization.

    Let's say there are 5 animated tiles in the tilemap - from 10 to 14. After tile 14 the animation restarts from tile 10 again. Then the code can be something like this:

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 followers

Connect with dop2000

Trophy Case

  • 10-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
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies