linkman2004's Forum Posts

  • This will work where your angle is coming from the angle expression. Where X is your angle and -180 <= X <= 180, using a conditional expression.

    NiceAngle = X > 0 ? X : 360 + X[/code:3d1hpa1g]
    Which translates equivalently to the statement(not usable, this is just for demonstration purposes):
    
    [code:3d1hpa1g]NiceAngle = X if X > 0 else (360 + X)[/code:3d1hpa1g]
  • Unless I'm mistaken the event search feature only searches the active event sheet, which makes it less than useful when following code organization practices such as including multiple event sheets.

    Granted, but I was suggesting it as more of a helpful tool -- it's still preferable to looking through event sheets manually for references to objects.

  • Unfortunately, reliably finding unused code(Construct or otherwise) is a difficult problem without a general solution, as to catch everything you would have to test all possible input combinations, which is unfeasible.

    What I suggest is to adopt solid code organization practices. For example, making extensive use of the function object. This allows for code reuse and good logical encapsulation. In addition, it's much easier to find if code in a function is being executed, as you merely have to check if the function is being called from anywhere -- there's no automatic way(as far as I'm aware) to check this, but it's much easier to check manually than without the use of functions.

    Additionally, making smart use of groups is an excellent way to group code that is logically related. By keeping related code together physically, it's much easier to see if a piece code has been replaced, made redundant, etc. Strewing logically related components through a large event sheet is going to lead to confusion and make the project harder to extend in general.

    As for checking for unused objects, the pay version of Construct 2 has an event search feature which you could use to search for references to objects, which would greatly help in determining which objects are being used.

  • I whipped up a quick example showing how to achieve this type of scrolling. It's implemented in a generic manner to make it easy to change how much padding you want on any of the four sides of the character.

    [attachment=0:1u81g0w6][/attachment:1u81g0w6]

    EDIT: Note that this only shows how to do active area scrolling - there may be additional work required to get this playing well with zone scrolling.

  • I'll take it this capx isn't your own and is just illustrating what you want to achieve? You need to set Unbounded scrolling to Yes in your layout properties.

  • Check the length of the text in the text box, and truncate it if over 20. Example:

    Compare two values: len(TextBox.Text) > 20          TextBox Set text to left(TextBox.Text, 20)[/code:29l9bkyk]
    [i]left(s, x)[/i] returns a string containing [i]x[/i] characters starting from the left side of the string [i]s[/i].
    
    EDIT: Ah, got beaten to it, but there it is.
  • Try updating your graphics drivers - this is more than likely caused by your specific system configuration.

  • You can do it like this:

    Compare two values:
    
    foo = "foobar" | foo = "footaro" | foo = "fooji"
    
    equal to
    
    1(True)[/code:qddidw3o]
  • Use For each(ordered) to loop through the objects in your family, set the expression to Family.Y(Replace Family with whatever your family name is), order by ascending, and then add an action to send the current family object to the front. This will send each of your family objects to the front in turn, starting from the object with the lowest Y value, resulting in the ordering you want.

  • Are you using any third party plugins? Was it working before, and if so, what did you do right before it stopped working? It would be best if you posted your project file so someone can take a look. If you don't want to do that, you could try backing up your project, then deleting objects or events until it runs again so you can discover the problem through a process of elimination.

  • I whipped up an example for you right quick to show one solution to the problem. Essentially, you have to assign colors to sprites in turn, then check each successive sprites new color against all of the previously assigned ones for uniqueness. If it's not unique, you assign a new color to that one and do the check again. Theoretically it could get stuck in this assign/check cycle forever, but unless you have an unrealistically large amount of objects you're assigning unique colors to, there shouldn't be any issues.

    [attachment=0:2stpva0z][/attachment:2stpva0z]

    EDIT: Accidentally uploaded an old version.

  • Please post a capx so we can see what you're doing. It will be easier to help that way.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You'll need to turn your event into an 'Or' block. Move your other conditions -- the overlapping check, value compare, what have you -- into a subevent of the keyboard event. Add your touch condition to the keyboard event, then, right click the event and click Make 'Or' block, and your event will now check if either the keyboard or the touch condition is true. Move your actions into the subevent where you check your other conditions and you're good.

    EDIT: Here's an example I pulled together real quick.

    [attachment=0:1dwmdud1][/attachment:1dwmdud1]

  • XylarRaylyne, this thread is over five years old and is talking about Construct Classic, not Construct 2. I found this example for you through Google, but in the future, please check thread dates and relevance before posting on a topic -- if necessary, create a new topic in the appropriate forum.

  • Please post the CAPX exhibiting this behavior, or one replicating the problem. Your problem is almost surely related to your specific setup, so we can't help unless we can see your events.