brunopalermo's Forum Posts

  • Glad to help!

  • Hi. Thanks for the info. If i want to extract the last 3 characters of a string at once, how i do this?

    Making right(text, 3) right(text, 2) right(text, 1), making right(text, 3)? or other thing?

    If i want to extract (counting from right to left) character 3 and 4 at once?

    Note that right(text, n) gets n characters starting at the last character of the string and going backwards, like left(text, n) gets n characters starting at the begining of the string and going forward.

    If you need to get a certain amount of characters in the middle of a string you should use mid(text, start, n), which will return n characters starting at start and going forward.

    Thus, if you need to return the 3rd to last followed by the 4th to last you would need to use mid(0 twice and join the characters toghether:

    Examples

    To get the last 3 characters, "ium" in the example below, you must do the following:

    myString = "Avengium";
    myCharacters = right(myString, 3)
    [/code:28xs41ez]
    
    To get the 3rd and 4th to the last, "ig" in the example below, you must do the following:
    [code:28xs41ez]
    myString = "Avengium";
    myCharacters = mid(myString, len(myString) - 3, 1) & mid(myString, len(myString) - 4, 1)
    [/code:28xs41ez]
  • As far as I know, I don't think it would cause any other problems. Maybe Ashley could help us.

    But people at Scirra will usually tell you not to tweak these things...

  • I understand. It's a pity this conflict between both effects.

    Maybe you could achieve the shader effect using another effect or plugin? Or maybe another pixelate effect or plugin... There must be something out there.

    Sorry for not being able to actually fix the problem and good luck on your search.

  • Hey work3!

    Let's go step-by-step...

    1. Rotation/Opacity Issue

    Yeah. This seems to be a bug. Is it THAT bad if you set the opacity to 99%, instead of 100%? I noticed that if you do that it will pixelate as it should, so it may be an acceptable workaround.

    2. Pixel Shader Edge

    It seems to me this is a bug in how the shader is dealing with transparency in the foreground objects. Note that, when the opacity is set to 100%, no edge is shown. Can't think of a way to solve this.

    So... Apparently you'll have to pick one: shader on the background or pixelate effect. Unfortunately.

  • Hey FabianB!

    By your screenshot, I don't know how the attack animation is playing at all, since it would be stuck on the first frame and never end, because of the Set animation action while Attack is true.

    If you could share the capx, I could thry it and see the actual problem hapenning...

    Cheers!

  • Nice example, dop2000!

  • Hey Badmiracle!

    I'm not sure I get what you need, but it may be something like this example I've posted in the forum some years ago:

    https://www.dropbox.com/s/jives77kcpmus ... .capx?dl=0

    Hope this helps. Cheers!

  • Hey SamLarsen97!

    You could create a bigger layout and center the camera On start of layout like in this capx:

    https://www.dropbox.com/s/hx6igo0di7gtu ... .capx?dl=0

    In this example I marked the center of the layout with the yellow square and the spawn points (outside of the view) with blue ones. You may use the arrows to navigate around and see how everything is positioned.

    Help this helps. Cheers!

  • Glad to help! Cheers!

  • There are several things that may be causing this... It's hard to tell you how to solve without seeing the actual code/capx.

  • You just check the collision with the small object. Can't see what's the problem here.

  • I haven't seem the capx, so it's hard to tell exactly what is the problem. But, it seems to me you are changing the speed directly according to the situation and I believe it would be a better practice, and less prone to errors, if you implemented it as a state machine, in whch the conditions would set the states and the states would affect the attributes (like speed).

    In a state machine only ONE state is active at any given time and each state has some conditions that tell the machine to change to other states, thus, overlapping conditions would not occur a states would alternate. What I think is happening in your implementation is that overlapping concurrent conditions are trying to change the attributes simultaneously.

    Here's an example of a very simple state machine that you certainly know:

    Current State	Input	Next State	Output
       Locked       coin    Unlocked    Unlocks the turnstile so that the customer can push through.
                    push     Locked     None
      Unlocked      coin    Unlocked    None
                    push     Locked     When the customer has pushed through, locks the turnstile.
    [/code:b6bspk3l]
    
    Source: Wikipedia.
    
    Sorry if I don't show any code, but it's hard to when I don't know your capx.
    
    Hope this help. Cheers.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's efficient as long as you are not going to this layout during runtime. The objects in the other assets layout are never loaded and don't affect memory usage. Only the images in the current layout are loaded. You can put every image you are going to use in the game into one unused layout, it won't affect the game or use memory. If you are bothered about temporary freezing or a stutter when it tries to load in an image that does not exist in the layout then you can have it in the current layout but destroy it at the start of the game, this allows it to be preloaded.

    That's what I thought... Thanks for confirming!

  • I think you're mixing things up. Layouts are one thing, Event sheets are another. In layout you'll have objects (sprites, texts, etc), while in event sheets you'll have code (events, actions, conditions, etc).

    The assets layout is there just to guarantee that anything you'll need to create dynamically is available, since Construct requires that at least one instance of an object exists in order to create it dynamically (by using the "Create object" or "Spawn another object" events). This layout has no event sheet associated to it. I'm not sure this is the most efficient way and I can't tell if all objects are loaded or only the ones you create (I think it's the second option).

    You can also have separate event sheets with code you'll reuse and just include then at the layouts for each level. But I'm not sure having enemy specific event sheets that you include only in layouts that have those enemies is worth it. In my understanding, if you have code that is never triggered it just won't do a thing. Of course it WILL be loaded, but, again, I don't believe this will affect significantly the loading times and cpu use.

    Maybe Ashley could help us all on this...