CREATOR4's Recent Forum Activity

  • ok,

    looks like the idea of a parallel instance variable seems to work --

    So name a sprite type has a name instance variable and the family of that sprite type has an f_name instance variable-- which is inherited to the sprite type as well.

    I now ensure that both are the same by creating an on start of layout event where i for the sprite f_name to name.

    Like this name is now available in both family type and sprite type ...

    thanks,

    However, I think in the future a simpler solution should be available, for example, to simply add an alias for sprite type in picks and then refer to the alias in expressions -- an alias would have all properties available and be treated as if its a different type for picking.

    Dan

    From what you describe it sounds like you don't need any variables in the Sprite. Couldn't you just have all the variables in a family and only ever perform code on that family?

  • And yes, if the functionality given by the sprite's variables is something that should reside in a family, you can just move the variables over to the family

  • Thanks,

    Yes, I tried families,

    Trouble is that once i refer to picks by family, i can't access the instance variables of the underlying sprites via the sprite family name.

    However, I need to access instance variables so i can do conditions across both sprite families.

    is there a solution for that?

    thanks,

    Dan

    You can access the underlying sprites by doing Pick Sprite by UID Follower.UID

  • there's a couple of ways. The way I like to do it is make 2 families

    One family is called "Follower"

    The second family is called "Followee"

    Put your sprite in both families

    Now you can do something like

    For Each Follower

    Pick Followee by UID "Follower.FollowUID"

  • You can't put triggers as subevents of other triggers

    Right now you're trying to put 'On Timer' under 'On Collision'

    Put 'On Timer' as it's own top-level event, not as a sub-event

    (Even if C3 did let you put 'On Timer' under 'On Collision', your character would probably never gather wood. Your code would make it so your character has to simultaneously collide with the tree RIGHT as his collecting timer goes off)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ok i got it (i did it without the division tho)

    nice :)

    yeah the division is only if the origin is in the center

  • You do not have permission to view this post

  • hi just have an instance which uptades every tick with ( player.x + 128 ) !

    how can i check if that is in an object?

    I would make a Function to handle the teleporting

    Something like

    On Teleport Function

    -player.x + 128

    -Is player overlapping wall? -- > set player.y to (wall.y + (wall.height / 2)) (this is assuming the wall's origin point is it's center)

  • When the teleport completes, check if the character is overlapping something, and if it is, teleport the character to the top of the object

  • You do not have permission to view this post

  • Hello, I'm trying to the image point of the origin from a sprite and the result is always 200, 150. No matter where I put the origin.

    This is my code:

    imagePointsX = puzzle.x + piece.getImagePointX(i); imagePointsY = puzzle.y + piece.getImagePointY(i);

    If you want the "image point of the origin" just use piece.x and piece.y

CREATOR4's avatar

CREATOR4

Member since 7 Sep, 2019

Twitter
CREATOR4 has 1 followers

Trophy Case

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

Progress

8/44
How to earn trophies