Sumyjkl's Forum Posts

  • What is the 'hpMissle' variable for, what other events change that?

    Otherwise, try adding a for each. I doubt it would work for something like this, but it might if your 'Hurtables' have different hp values.

  • I was more considering that like I have done in my project, you make the third family contain all the relevant behaviors. You would still need to differentiate between them though, but it's the cleanest way I have found so far.

    Also, you could use A or B to then select the same object in the third family, using a similar method:

    pick family3.UID = familyA.UID - - > action

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you mean differentiating between two families you can do that by picking the UID of the object that is equal to the UID of the other family.

    E.g.

    Pick familyA.UID = familyB.UID - - > [action]

    Not sure that's what you're trying to do though.

    Having the same variable for both families could be achieved by having another family dedicated to all the variables shared by the objects, but that's not the best and certainly not the most efficient way of doing that I suppose.

    Transferring the variable to the other family could get really messy by the way.

    Edit: Also, the above method would mean needing to do this differentiation condition every time you wanted to change the variable in an event for only one family.

  • 65.2 hp per heart. You could use a tiled background and set the size to (hp/65.2*[heartwidth]), and then round up to the heartwidth.

    Edit: To round up to 16: width = int(Sprite.HP/65.2)*16

    [attachment=0:3ex93ms4][/attachment:3ex93ms4]

    To change the amount to round to you can change the multiplier, e.g. for half hearts, use int(Sprite.HP/65.2*2)*8.

  • What are you trying to do? Is this similar to some retro space shooters? Are you walking on a platform or suspended in the air? Do the objects follow you only after a certain point?

    If this is suspended in the air, that's easier than above. You have them spawn, they drop automatically, you dodge them.

    Also, if Sargas is right, then you just have your physics or whatever apply forces / move towards the player.

  • You should probably just figure this out but...

    You spawn the object (physics / platformer whatever you're looking for) at the top of the screen (for example at Y = -10 X = random(windowwidth) ) and have another event on collision with the ground, which sets a (boolean) variable that describes whether it is "activated". When it is activated: if X < player.x move right else move left.

    That's if you have a flat game world, otherwise I wish you luck with your AI.

  • Ah, thanks guys, I'll give that a try shinkan.

    Edit: Worked for the cursor, but since I have objects on other layers that I drag and drop, it seems to conflict there giving the same result as before. I might have to just set a global variable for mouse/touch position. I'll mess around with it a little more first though.

    Solved: I used mouse("layer") on a layer that was scaled and it worked fine.

  • Hi there.

    I'm trying to make zoom capability, but one of my layers seems to scale incorrectly, and I'm not sure why.

    I have a UI layer and above that a cursor layer, which has my cursor sprites on it. The sprite has its position set to the mouse.x and mouse.y coordinates every tick.

    But when I change the layout scale, the mouse position and the sprite are in different places. At the middle of the screen it doesn't do this as much. I tried setting the layer scale rate to 0 but to no effect.

    Edit:

    Looked at the mouse coordinates, looks like they change based on the layout scale. Made the sprite set to the mouse position though, using cursor x = (mouse.x - (mouse.x - scrollx) / 2) and the same for y.

  • Hah, doge.

    Use physics behavior and just apply force or impulse, whichever is more appropriate for what you're doing, towards the player's X and Y coordinates.

  • Windwalker

    Well, a massive scale - no, infinite - universe destroyer god game might be interesting!

    Hmm. Not a bad idea actually, might be my next project.

    newt

    I suppose it would be pretty easy to make this into a boid. All you would have to do is apply some varying forces instead of setting position.

  • Pretty much not a whole lot, though it could be useful in making a game set in space that had a lot of moving objects over a long period of time, in order for the actual objects to not move too far away from the origin point or more accurately to move the origin point to wherever. The actual xorigin and yorigin coordinates could be useful in calculation for spawns and such, e.g. distance away from the center (which would have the highest density of objects) determines the chance to spawn something, such as a black hole.

    It works with scroll too I believe, but I'll have to try that one out. Right now it's practically useless though, since there's no real need for it in anything I'm thinking of working on.

    This is mainly just a proof of concept for some metaphysics. Well if ever I create a space RPG it'll be useful though! =P

  • moymoymoy

    Well damn. Good luck, and ramones right, same thing with image points.

    I guess if the animation changed just after it collided it could think that it was not overlapping and thus able to collide again. Also, you really should add a text box for debug so you can work out what is happening. Something like append "collided " to it when it collides. If it shows "collided collided " then you know it was the animations problem like ramones suggested, otherwise... Good luck!

    Also I really don't know why your character is falling through platforms, that should be completely separate from the Forest Cow events, so unless you had that for each for everything in the project I'm not sure what's going on there, but I'm pretty sure it's not the for each.

  • Just wondering, jayderyu, if you know of an equation that could give a smooth non-revolvey movement?

    I've been using this formula...

    ((distance(Objects.X,Objects.Y,Cursor.X,Cursor.Y)^2 / 500 + 10) + Objects.Physics2.LinearDamping * sqrt(sqrt(sqrt(distance(Objects.X,Objects.Y,Cursor.X,Cursor.Y))))) * Objects.Physics2.Mass / 100 + sqrt(distance(Objects.X,Objects.Y,Cursor.X,Cursor.Y))

    But I think that's probably a bit overkill, and it can most likely be factorised / simplified as well.

    Edit: You'd be surprised how well it works though =P

  • Ah, now you mention it try putting a system>for each at the top like hornet suggested, and have all the "Forest Cow Movement" events under it. I tried the original one with two objects just then and it did something similar to yours. It seems else has problems with instances.

    Example:

    [attachment=0:1t7ohwjm][/attachment:1t7ohwjm]

  • By reading that it seems the program is reading it like this: shake = 1 so set shake to 2, now shake = 2 so set shake to 1. Thus it will just stay as shake = 1.

    Try using an else, incorporated into the second event, that should ensure it doesn't do both events.

    Example capx:

    [attachment=0:2yba4cz1][/attachment:2yba4cz1]