dop2000's Forum Posts

  • Change in runtime? Use "Set color" effect. It will recolor the entire sprite. If you want to change color for individual pixels, you need to use Canvas plugin.

    construct.net/en/forum/extending-construct-2/addons-29/plugin-canvas-41782

  • There is in fact such plugin - Globals:

    construct.net/en/forum/extending-construct-2/addons-29/plugin-globals-120736

    It's basically just an empty object for storing instance variables. It was made as an alternative to global variables, but can also be used for making enum lists.

  • you could do MyEnum.Choice

    piranha305 Yes, that's what I thought. The dropdown list as on OPs screenshot will not work, as you can't enter expressions into it.

    So you type in "MyEnum." followed by dot into any parameter field in any dialog, and the list of values will drop down. This will be consistent with how other expressions work in C3.

    Also, what will happen if the result of the expression is an invalid number (not member of the enum list), or infinity/NaN/string etc.?

  • why in the world would you want a custom input on something that is an enum?

    It's not a custom input, it's a common use case.

    If you have a function "SpawnEnemy" with enum parameter enemy_type (list values: zombie, vampire, troll), how do you spawn a random enemy?

    Or let's say there is a function "SetHealthbarColor" with enum parameter color (red, green, blue etc.) You want to call this function and set color to (Player.health<20 ? red : Player.health<50 ? yellow : green).

    If expressions are not supported for enum parameters, then you'll have to do this:

    If Player.health<20 then Call "SetHealthbarColor", color:red
    Else If Player.health<50 then Call "SetHealthbarColor", color:yellow
    Else Call "SetHealthbarColor", color:green
    

    Three lines of code instead of one!

  • You are proposing enum type for functions because it will make them more organized, easier to use and refactor, and I agree with you. But there must be an option to use expressions with enum parameters. Are you saying that if I want to call my function with parameter choose(Linear,InElastic,InSinusoidal), I will not be able to do it, and will have to use string type parameter instead? This is a serious disadvantage and limitation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, so lets say you have a function "RunMyTween" with enum parameter easing_function. When you call this function, in the dialog you can select the value for easing_function parameter from the list, like this, right?

    But my question still remains - if you need to use an expression instead of selecting the fixed item from the list, how do you do it?

  • We're talking about a new parameter type, not integrating easing modes to functions???

    I'm not talking about it either. But since you used it as an example, you can have a function which is a wrapper for Tween behavior. It will expect easing mode as a parameter, and this parameter can be enum/list type.

  • It seems pretty clear with the image above

    Your image shows dialog window for Tween behavior, it has nothing to do with functions, that's why I found it confusing.

    Besides easing modes, what other lists do you want to have in function parameters, can you please give a few examples?

  • You probably need Destination Atop mode. Set it for a rectangular sprite with solid color, place on the same layer with the text. Don't forget to set "Force own texture" in layer properties.

    You can check Blend Modes template.

  • Where do I begin..

    By enemy you mean "inimigo1" sprite? It doesn't move because "ação" instance variable is empty. You need to set "direita" or "esquerda" value, and then it will start moving.

    You have some sprites facing left, some facing right. It's recommended to have all sprites facing right (0 degrees).

    And finally, your animations. They are insane! ini1Exp sprite alone is 13MB. Why not do the same effect with particles?! Each of 4 Player sprites have 300 frames for just walking animation! Your game is already using 2GB of memory for images and is very slow. You will soon not be able to run it if you continue like that. You need to reduce the amount of graphics significantly!

  • Are you talking about Function parameters?

    Do you mean predefined lists with fixed values (for example, color names, blend modes etc.)? Or custom lists, where you enter values yourself (for example enemy types)?

    I can see how custom lists may be useful in some cases. Say, when you are calling "SpawnEnemy" function, instead of typing "zombie" in function parameter, you can select "zombie" from the drop-down list. However, there is a serious problem - you will lose the ability to enter expressions in this field, for example choose("zombie", "vampire").

  • loopindex is an expression:

    construct.net/en/make-games/manuals/construct-3/project-primitives/events/expressions

    You can enter (type) expressions in any parameter dialog. For example, if you have a Text object, you add an action "Set text", there will be a dialog with an empty string, where you can type loopindex.

  • Change text box type to Textarea. But this will make it multi-line.

    Or you can try doing this with CSS:

    stackoverflow.com/questions/12355557/how-to-vertically-align-text-in-input-type-text

    construct.net/en/tutorials/css-your-buttons-and-textboxes-818

  • Set high values for acceleration, deceleration and rotate speed in Pathfinding properties.

  • You can only align by edges. If you need to align centers, simply set the same X coordinate for all selected objects, leaving Y empty.