R0J0hound's Recent Forum Activity

  • Here's one way to do it, although it isn't exactly like c2's editor.

  • narFsnw

    I only know enough to get by and even then I usually reference this:

    https://developer.mozilla.org/en-US/doc ... xpressions

  • It wouldn't trigger if the same random number is used twice in a row. A possible solution that would require minimal modification to your events would be to set the number to 0 and the set it to a random number from there.

    Global variable = NumbersVar
    
    On start of layout ------ System set NumbersVar to 0
    
    NumbersVar = 0
    Trigger once -------- System set NumbersVar to floor(random(1,52))
    
    NumbersVar = 1
    Trigger once -------- create object A
    
    NumbersVar = 2
    Trigger once -------- create object B
    
    Etc...
    
    Objects family on destroyed ----- System set NumbersVar to 0
    [/code:2hlxs7ca]
  • 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 "".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound