dop2000's Recent Forum Activity

  • Sorry, try this one:

    (Overheat / 6) * (max(WeaponLevel,100) - 100) ^(1.5 * ((max(WeaponLevel,100) - 100) / 10) /2)

  • Try this:

    Save TextBox.TextHeight to a variable.

    Temporarily increase textbox height (for example to 1000px) and save TextBox.TextHeight to another variable, then revert textbox to its original height.

    Compare two variables. If their values are the same, then the text fits. If the second value is bigger, it means the text doesn't fit.

  • Try this:

    (Overheat / 6) * (max(WeaponLevel,100) - 100) ^(1.5 * ((max(WeaponLevel,100) - 100) / 10) /2) ,1, 100)

    .

    If it fixes the problem, it will mean that sometimes WeaponLevel can be <100

  • If you are doing it just to hide collision polygons in the layout editor, then of course, it not worth spending hours turning collisions for each tile in each tilemap. It's much easier to move grass and trees tilemaps to another layer and toggle its visibility.

    If you feel confident editing raw project files, you can modify objectTypes/tilemap.json - disable collisions for a couple of tiles, save the project, open that file in Notepad++ and you'll see what to do. However, if you really have 150K tiles, this change will probably add many MBytes to your project size.

  • The methods you mentioned should work - disable a group of events, or check that the layer is visible. They are inconvenient, especially if you have lots of objects and layers, but there are no other solutions.

    Unfortunately, Construct doesn't provide any way to block touch/mouse events for a certain layer. This idea was posted in several variations on the suggestions platform, but got no reaction from the developers.

  • It must be like "goto" or something where maybe people frown upon using it?

    No, ternary operator is perfectly valid and can often be really handy. Unless you start nesting lots of them and the code becomes difficult to understand.

  • Here "recursion" is a fancy way to say that the function calls itself :)

    Actually, for the code to work you need to make variable i global. When it's local, it will reset to 0 every time the function is called. Or pass this value as a function parameter.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What exactly are you trying to do?

    If you want to change the opacity of sprites one by one with 0.2s delay, remove "For each" and add recursive function call as the last action in the function (after "Add 1 to i").

    The function will call itself until there are no more objects with id=i.

  • I would suggest using a separator, for example "mango_5". This way you can have prices with several digits. Use int(tokenat(var, 1, "_")) to extract the price.

  • Yeah, it's a condensed if-then-else statement.

    (A ? B : C)

    If A is true, then the result will be B, otherwise it will be C.

    And you can use nested statements: (A ? B : (K ? L : M))

    The full expression in your case may look like this:

    (int(appleVar)>int(pearVar) & int(appleVar)>int(mangoVar)) ? appleVar : 
    (int(pearVar)>int(appleVar) & int(pearVar)>int(mangoVar)) ? pearVar : mangoVar
    

    It may not work correctly if two numbers are the same.

    EDIT: Just realized that int("abc123") does not extract the number, you'll have to use right()

  • With variables it's quite difficult. If there are only 2-4 of them, you can get away with an expression like (int(appleVar)>int(pearVar) & int(appleVar)>int(mangoVar)) ? appleVar : (int(pearVar)>int(appleVar) & int(pearVar)>int(mangoVar)) ? pearVar : .....

    But if there are more values, you should probably use an array or dictionary. Loop through all values, extract the integer part and compare it with the previous biggest number.

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