R0J0hound's Forum Posts

  • 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.

  • Try Construct 3

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

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

  • You can't seed c2's random(). You'll need to use a third party plugin like the random plus or noise plugins.

  • One way is to use a variable.

    global number target= -1
    
    on right clicked on enemy
    --- set target to enemy.uid
    
    Player.selected = 1
    pick enemy by uid target
    every 0.1 seconds
    --- rotate 20*dt derees towards (enemy.x, enemy.y)[/code:1wh115d3]
  • Wouldn't it be simpler to keep the origin as the center and have another sprite for the death animation?

    Or leave it as is and when you change to the death animation just move the sprite?

    You can use a little math to rotate a sprite around any point if you wish to do that instead.

    https://www.siggraph.org/education/mate ... 2drota.htm

    global number centerx= 100

    global number centery= 100

    global number ang= 10

    every tick

    --- sprite: rotate ang degrees clockwise

    ---- sprite: set position to ( (self.x-centerx)*cos(ang)-(self.y-centery)*sin(ang)+centerx, (self.x-centerx)*sin(ang)+(self.y-centery)*cos(ang)+centery )

  • No, it just means you need to access properties with foo["bar"] instead of foo.bar.

  • Or you could even do this if variable1 starts as 3 or 6.

    variable1 = 9-variable1

  • One way could be to create ring sprites at the boat that grow and fade to transparent.

  • Effects could probably do some of the pixel effects. The collisions would still need the pixels read from the image, effects are of no use for that. You can read the pixels now using the canvas. It's kind of slow as it is but if you read it ahead of time into arrays (this doesn't even need to be done in game) and just compare all overlapping pixels from the arrays.