Zathan's Forum Posts

  • So.. I have an 'static' object just spinning (I will call it earth for better understanding), and other that goes on its direction (comet).

    I have this math that almost do what I want:

    When the comet hits earth:

    Set X to CenterX + cos(angle) * dist

    Set Y to CenterY + sin(angle) * dist

    But with this method, the comet don't start to rotate around earth from the impact point, but it teleports to the angle that earth is facing...

    How can I make it work properly?

  • Ok here is how I would do it. Remember there are may ways to implement it.

    Basically, you have a variable that you keep appending text to to keep track of what keys are pressed. You'll use expressions to check if the last x characters in this variable match your cheat code then do something.

    I'll add in an event to delete the leftmost character after the variable is x length, so it doesn't keep growing forever.

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

    That's exactly what I need! hehe

    Thank you very much!

  • Well first you would have to decide how you want the cheat code entered. Is there somewhere a player can type like a text box? Or if they enter the correct sequence any time it will trigger during gameplay? Is there a chat system you already have in place, or maybe a console the player can bring up to enter a code?

    It would be the "classic style", where you just have to enter the correct sequence os keys, without any text box. hehe

  • What is the best way to make possible to enter a cheat code, that would be a word, during gameplay (or in pause menu, where the gameplay is stopped, if it's more simple)?

  • fisholith

    Wow, that's an awesome explanation! hehehe

    Guys, thank you very much for all the help! It's propably the best forum ever..

    People who know what they're doing and want to help.

    Again, thank you!

  • Problem Description

    If an object in a layer with the option "transparent' set to yes is set with the overlay effect and I put whatever effect on the layer, like blur, the object disappear.

    Attach a Capx

    https://onedrive.live.com/redir?resid=3 ... ile%2ccapx

    Description of Capx

    Example of the 'problem' with effects. An object with overlay blend mode and the layer with blur.

    Steps to Reproduce Bug

    • Just open the capx and test it. It will be normal.
    • Now, put an overlay in the sprite.
    • See it disappear.

    Observed Result

    The object disappear.

    Expected Result

    Don't disappear.

    Operating System and Service Pack

    Windows 10 PRO

    Construct 2 Version ID

    C2 r227

  • Zathan

    If it's become invisible with Overlay blend then we can continue the test like this ;

    if (back.r<0.1 && back.g<0.1 && back.b<0.1 ) {front.r=1.0;front.g=1.0;front.b=1.0;} // set to white

    http://gigatron3k.free.fr/html5/C2/FX/cblend2

    Hehe awesome!

    how did you do it? Can't be done by events, right?

  • The HSL effects should work fine if everything is opaque. Dealing with alpha in HSL mode can be very tricky but if you're not using that then the results should be correct. If you think anything is wrong please file a bug report. There is nothing in this thread I can investigate, and last I checked it worked OK.

    Hmm... ok Ashley, thank you very much for the answer!

    Gigatron

    Here is a capx to better demonstrate the effect I want.

    https://onedrive.live.com/redir?resid=3 ... ile%2ccapx

    As you can see, when the sprite with the blend is on front of a black one, it disappear, instead of 'turn' white, like the image I attached on the post. As I said, coreldraw have a blend mode called 'lightness', that does exactly what I want.. but seems like C2 don't.

    I was trying to find a way to achieve this with blend modes, with no need for sprite duplications.. but seems like that will be the way hehe

    By the way, thank you for the example you made! how exactly did you get this result?

  • Zathan

    An effect can do it. I'm just saying there is an existing effect that is supposed to do it, but it appears to be bugged.

    Ah, ok! sorry hehe

    Ashley,

    sorry for bother you, but can you help me here? Seems like some effects aren't working properly.. but I don't know exactly if it's a bug or not, so I'm not posting anything in the bugs section yet.

    And I have done another test now too, and I think there is another possible bug with effects... I don't know if it's made to be like that, but if an object in, for example, layer 1, is set with the overlay effect and I put whatever effect on his layer, like blur, the object disappear.

    What do you think? is better make a post on bugs section for all of this?

  • From what I found here:

    http://www.zetaprints.com/help/coreldra ... perations/

    The "lightness" blend keeps the hue and saturation of the back and keeps the lightness of the front.

    The "luminosity" effect in c2 matches that description, but doesn't seem to give the same results. Perhaps it's a bug in it somehow since a fair of math is involved.

    The basic logic is to convert the back and front from rgb to hsl, then take the hue and saturation from the back and the lightness from the front to make a new hsl, finally that is converted back into rgb.

    That's the logic needed to make an effect, or the info needed to debug the luminosity effect if someone is curious and has the time.

    Well... so there is no way to achieve what I want in C2? :\</p>

  • Try blend mode additive.

    Probably there is no blend mode in C2 to achieve the effect.. in coreldraw there is the lightness blend mode, that do exactly what I need.

    So.. I'm looking for, maybe, some workaround.

  • This might be possible with one of the effects, like Multiply or Overlay. It's the same stuff Photoshop uses, so this list can be handy: http://www.myphotocentral.com/wp-conten ... -modes.jpg

    Hehe thank you for the help, but, as I said "with the "overlay" effect it got close, but is invisible in black backgrounds". <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad">

    the effect must work like the image that I attached.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would think that you could just set the z order of the white box to a lower number than the gradient box, then set the opacity of the gradient box to lower than 100 (say, 70). I'm not sure a blend mode is required.

    I can't do this, 'cause the gradient is the background of the level. It need to be as colorful as it can be.

  • I really need that effetct in my game:

    https://onedrive.live.com/redir?resid=3 ... hoto%2cjpg

    But I couldn't achieve this.. with the "overlay" effect it got close, but is invisible in black backgrounds...

    Can someone help me? <img src="{SMILIES_PATH}/icon_e_confused.gif" alt=":?" title="Confused">

  • Hehe thank you for the answer!

    But I would prefer something more "dynamic".. like an effect or something like this.