R0J0hound's Recent Forum Activity

  • Good job implementing it with events. The best way to speed it up would be to write it in js. However there is an existing plugin to do simplex noise, as well as perlin.

  • The layout and the properties aren't useful. A capx or a picture of events is.

    I thought there was an example floating around the forum but I couldn't find one, so here's my take.

    https://dl.dropboxusercontent.com/u/542 ... _push.capx

    I used the 8direction behavior to move the player. I also added CustomMovement and solid to both the player and the boxes. CustomMovement is used for it's "push out of solid" actions and "solid" is used to specify the solids which I toggle on and off.

    The general idea is to

    1. if player overlaps a box then push the box

    2. if the pushed box is then overlapping any other boxes then we need to push back by

    a. push the box backwards out of the other boxes

    b. push the player backwards out of the boxes.

    The only major equation used is to round an angle to the nearest 90, so we get a correct angle to push. Solid is enabled and disabled throughout. The idea is to only enable a solid if we want to push out of it, otherwise it's disabled.

  • narFsnw

    Ah, I thought there was only one. You need to add "g" to the third parameter I think? In the capx it's just "".

  • Ashley

    You can't control what a user does outside of a program. Locking the files may help, but yeah, it's more of a user misunderstanding about the use of the temp folder.

    sorbias

    Ashley answered that above you.

  • narFsnw

    The fix makes the files so they won't get bigger.

    You can clean the user's saves yourself using a regex expression. Here's a test of such an expression.

    https://dl.dropboxusercontent.com/u/542 ... eaner.capx

    Basically doing this should clean the save. After that load again with the "load state from json" action.

    RegexReplace(SaveStateJSON, """collmemory"":\{.*?\}", "", """collmemory"":{}")[/code:285hm3p4]
    Basically it will remove everything in the collmemory section.
  • The duplicate serial possibility is solved by keeping your own list of the generated serials along with the buyer info. Then when generating the serials just check if it's in the list first before adding it.

    You could also require a name with the serial and use the hash of the name along with the numbers. The txt file works mainly because it contains personal info of the buyer so they wouldn't wish to share it. Likely what c2 does is check the hash of the file to see if it's valid.

  • You can get that effect by creating a sprite at the object every frame and give them the fade behavior. To improve the framerate you could could do every 0.1 seconds instead. The drawback to that or moving the sprite fast is it starts to look like steps instead of continuously smooth, but it may be good enough.

  • To get the launch speed you can do the following. Be sure to set deceleration to 0.

    Vector x = (x1-x0)/t

    Vector y = (y1-y0)/t-0.5*gravity*t

    X1,y1 is the destination

    X0, y0 is the start

    Gravity is whatever the behavior's Gravity is

    T is how long you want the jump to take in seconds.

    Overall the math should be the same as in that example you're referring to. The actual path will vary a bit due to the variable delta time but it should be pretty consistent.

  • When you're comparing the variables, each object is comparing with itself.

    To compare values of two different instances of the same object you either:

    1 put the object type in a family so you can pick two separate instances independently. Ex:

    For each sprite

    For each family1

    Sprite.value < family1.value

    2 pick one object, save its value to a variable and then "pick all" and pick the other instance.

    3 use the sprite(0).value expression where 0 is the instance number. That way you can access separate instances from the same expression. You will need to loop over each pair of instances though.

    What I usually opt to do for sorting like you're doing is just to use a "for each ordered" condition which will do the sorting for you.

    For each sprite ordered by sprite.z acending

    --- sprite: move to front

  • Try inverting an "is overlapping" condition.

  • That's good to know. It makes sense since capx files need to be unzipped somewhere to be editable. I have a suspicion that may be the main cause of capx corruption. :/

    One workaround for the future could be to use a project folder save instead of capx files.

    Ashley

    Just curious if it would be feasible to have c2 extract capx files to another location other than the temp folder when editing? Or I wonder if there's a way to block them from being deleted while the project is open.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can't seed c2's random(). You'll need to use a third party plugin like the random plus or noise plugins.