R0J0hound's Forum Posts

  • That doesn't make sense. What in particular are you looking to solve with that diagram?

    Is P0 the player and P1 the enemy and you want to find p3?

  • lolpaca

    Look here for a visual of what they are. You can ignore the math.

    https://en.wikipedia.org/wiki/B%C3%A9zier_curve

    The curves made of 3 points are the "quadratic curves" and 4 points are the "bezier curves".

    The first and last points are the end points and the points in between are control points.

  • If the pixelate effect is getting broken on export then, yes report just that. Don't include the outline effect in the report, since third party stuff can't be in bug reports. If it gets fixed then the outline effect will likely be fixed as well.

  • Oh wait, I had the logic reversed. You want it to loop as long as either of the variables is 0, and my example only stops when one of them is zero. Add an "else" to fix it.

    +--------------+
    | while        |
    +--------------+
       +-----------+
       | trueA = 0 | set trueA to 1
       |   -or-    | set trueB to 1
       | trueB = 0 |
       +-----------+
       +-----------+
       | else      | stop loop
       +-----------+[/code:2lvl4d64]
  • The version this was changed:

    https://www.scirra.com/construct2/releases/r102

    A discussion about it with input from ashley:

    r102-breaking-change-questions_t73647

  • Here's a way you can structure it. Basically make the while and infinite loop and use the "stop loop" action to stop it.

    +--------------+
    | while        |
    +--------------+
    |  +-----------+
    |  | trueA = 0 | set trueA to 1
    +--|   -or-    | set trueB to 1
       | trueB = 0 | stop loop
       +-----------+[/code:n47tyopg]
  • Mithrill

    That has been mentioned before I think. I think it's related to export in general, but I can't test on my machine since I can't use webgl. Best I can tell the pixelwidth/pixelheight variables that C2 provides to shaders is giving different values on export.

    Try the same test you did with this effect on the pixelate effect since it also uses those variables. If the results are different then that would make a good bug report since it involves only vanilla C2. If the results are the same then the problem is with how I used the variables in this shader, but I don't see the issue.

  • alextro

    Haha, thanks for pointing that out. I typed that too fast and spellcheck let me down.

  • There are three lists internally:

    Instance list

    New list

    Sol list

    By default the sol list will be the instance list, which you then filter. When you create an object it's added to the new list and the sol is set to it. The pick all sets the sol to the instance list and since the new list isn't added yet those objects aren't picked. Then at the next "top level" event the new list is merged into the instance list.

    You can search the forum for "top level" for some more discussions/explanations of this. In one of the change logs had a fix where before "pick all" would pick the new ones too. This was fixed to prevent cases of infinite loops.

    Alternatively the pick by uid can pick objects from the new list. It's the exception to the rule.

  • They'll be put in the SOL before the next tick. It can be picked in the next top level event.

  • That function is run when a top level event is reached, so the objects get destroyed and new objects added to the instance lists then. Without the hack can you access new objects by iid immediately after? If that works then something else is done behind the scenes to make that possible. Maybe instead of that second loop use "type.stale_iids = true;", so new iids are generated by the runtime instead. Untested but it seems to do that with families.

  • You can use an effect on a layer, and here's how to convert from hsl to rgb:

    http://www.niwa.nu/2013/05/math-behind- ... s-rgb-hsl/

    There may be a plugin that does this for you but I didn't look.

  • [quote:3ib8m7r5]There are no benefits

    There are pros and cons to any change, so I disagree about there being no benefits. Long time users in my opinion have the privelege of requesting such advanced things because they already use the existing way to do it and see things to improve. Newer users are often directed to the manual or tutorials instead to get them aware of the common way to do things.

    Prominent

    You can test your idea by finding the "ClearDeathRow" function in preview.js and replace the two places "push" is used with "unshift". It will break the logic of any other capx that relies on the normal order of iids though.

    ...but why stop there, we can hack a toggle using a global javascript variable.

    change the line "type.instances.push(inst);" to

    if( window["createAtFront"])
       type.instances.unshift(inst);
    else
       type.instances.push(inst);[/code:3ib8m7r5]
    and do the same for the other push in that function.
    
    So by default new instances will be created at the end, but if you use the execute javascript action of the browser object with "window.createAtFront=true;" then that sets it to create from the front.  It should work even when minifying.
    
    You'll have to add the change every time you update c2, and you'll probably need to use an unmodified install whenever you encounter bugs in C2 because unofficial changes can't be supported by scirra.
  • You probably could do it with a plugin to manipulate the instance list. In the edittime.js make an action that takes an object type as a parameter. Next in runtime.js you can get the instance list and manipulate that. Here's a reference of what you can do with arrays in javascript:

    http://www.tutorialspoint.com/javascrip ... object.htm

    Actually after writing that out I realized it's more complex than that since new objects aren't added to that list till a toplevel event. So the action wouldn't work on newly created objects. It's probably a non-trivial change in c2's engine as well because of that, or even because of other deep engine reasons. Not to mention it's a unique requirement so it may not be readily added.

    Anyways, in cases like this I like to use an array that I store uids into as I create the objects, that way I have full control of their order. Maybe also using a function and a variable to make the expressions look less busy.

    As to the op you can change the iids of an objects by destroying them and recreating them in the order you want, at the expense of losing their uids.

    Maybe a more nifty feature request would be to use -1 instead of object.count-1 to pick the last instance. It currently doesn't work with the "pick nth instance" condition. It does work in expressions though: Sprite(-1).width

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If it's an attack formation then you'd want one that provides for a maximum attacking at once so the skirmish ends quickly and friendly causalities are minimal. 5 for hand to hand combat since they can attack from all sides, and 3 for projectiles (arrow, bullets, rocks) because crossfire is reduced.

    1 would make the attack progressively more intense but I think it causes needless casualties of the initial ranks.

    4 is if we want it to be a fair fight, quite the favorite in video games for boss fights. This tests the endurance of the enemy.

    2 is just a harder version of 4.