Psynaptik's Recent Forum Activity

  • Glad it got sorted!

    If you really want only 4 way movement, then you can restrict that on the 8 way movement behaviour.

    Good luck with the rest of your project!

  • Unfortunately I can't reproduce the problem. It's acting as I would expect it to. Your character's collision polygon hits the scenery collision polygon, and works as I would expect.

  • Your example works fine. Your character walks around and detects collision properly.

    You've drawn collision separate to the graphics, yes? Presumably to make it look like the character is walking behind the objects?

    'Fundo' is one big sprite with a weird triangle of collision where C3 has wigged out trying to work out your shape (which is why I said check).

    The other collision there is on 'colisao', which you seem to have drawn as an invisible object.

    I'm not sure what you were hoping for here. What do you want to happen?

  • It's not great to use WeTransfer - those links expire and it means that no-one can access that in the future.

    With dropbox or googledrive you get lots of data for free. Use dropbox preferably.

  • I've found a solution involving adding the UID to the timer name, and passing the UID into the function:

    + Keyboard: On Space pressed

    -> objects: Start Timer "shakeReset_"&objects.UID for random(5) (Once)

    * On function 'resetShake'

    * Parameter 'objectUID' (Number)

    ----+ objects: Pick instance with UID objectUID

    -----> objects: Set shakeAmount to shakeStrength

    -----> objects: Set shakeTimeElapsed to 0

    + objects: On Timer "shakeReset_"&objects.UID

    -> Functions: Call resetShake (objectUID: objects.​UID)

    Hope that helps someone!

    Now, all the instances work independently of each other, and only listen to their own timer (I think...).

  • Save as a .c3p file, upload it to a dropbox/googledrive and post link here.

    Is solid enabled at start on your solid obstacle?

  • What do you mean? In Construct 3?

    It's a 2D engine. 3D is faked/pseudo 3D. So the answer is no.

    Also, you wouldn't ever use a game engine to make an animation really. You're better off using a 3D package such as Blender to make models and animations.

  • Have you checked the collision polygon in the animations tab?

    It doesn't always turn out as you might expect - especially for non-regular shaped objects.

  • I'm still getting the effect where if one timer goes off, it acts on all instances.

    This is what I have that's relevant:

    -------------

    + Keyboard: On Space pressed

    -> objects: Start Timer "shakeReset" for random(5) (Once)

    + objects: On Timer "shakeReset"

    + System: For each objects

    -> Functions: Call resetShake

    * On function 'resetShake'

    -> objects: Set shakeAmount to shakeStrength

    -> objects: Set shakeTimeElapsed to 0

    -------------

    The exact function is the objects shake a little to give some animation/game feel. But I want them to shake at random intervals individually, and not be in sync. I can happily get them to shake altogether, but not independently.

    I'd like each instance's timer to make just that same instance shake a little. At the moment the timer of any instance will make ALL of them shake.

    What have I missed in your answer? Thanks for your continuing help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah, I didn't know about the 'for each family' bit. I'll try it and see how it works.

  • Hi,

    I have 3 objects that belong to a family. I have multiple instances of each of those three groups on the layout.

    I have added a timer behaviour to the family.

    I want to set a timer on each object, and a function to fire when that timer finishes.

    I can easily do it so that all objects act in unison i.e. one timer ends and they all execute function simultaneously. But what I want is for them to be out of sync. I want to set a timer on EACH individual object to timerLength+random(timerLength), or similar.

    How do I code it in C3 so that each object acts as an individual, and they don't keep getting messages from every objects timer - which I think is what is happening?

  • To help others with this issue, this is what I ended up doing:

    I have two families - one has my 'generators' in. The other has my 'generated objects' in.

    For the 'Generators' family, there is a family-level boolean of 'used' (necessary to use so that you don't get multiple objects spawning on the same site).

    ----+ System: On start of layout

    -----> Functions: Call fruitGenerator (generator: "genBerry", fruit: "berry", number: 2)

    -----> Functions: Call fruitGenerator (generator: "genCarrot", fruit: "carrot", number: 4)

    ----* On function 'fruitGenerator'

    ----* Parameter 'generator' (String)

    ----* Parameter 'fruit' (String)

    ----* Parameter 'number' (Number)

    | Local number i‎ = 0

    --------+ System: While

    --------+ System: i < number

    ------------+ System: Pick a random generators instance

    ------------+ System: generators.ObjectTypeName = generator

    ------------+ generators: [X] Is used

    -------------> System: Create object fruit on layer 1 at (generators.X, generators.Y), create hierarchy: False

    -------------> System: Add 1 to i

    -------------> generators: Set used to True

    --------+ System: Pick all generators

    ---------> generators: Set used to False

    Thanks again for the help!

Psynaptik's avatar

Psynaptik

Early Adopter

Member since 7 Nov, 2013

Twitter
Psynaptik has 1 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies