Sam Mortimer's Recent Forum Activity

  • Was there some newly created objects along the way per chance?

    Yes!

  • Set the size of every instance of this object based on some instance variables.

  • Huh that's weird. I've copy-pasted the actions now instead of using a function and that's done the trick, so don't worry.

  • An action to call a function appears in my event sheet BEFORE the 'on-function-called' condition executing the function, so it should be able to occur in one frame, right? Well it looks as if the function is happening the frame AFTER it's called.

    If that's not supposed to happen and somebody can guess what I might be doing wrong to cause it then it would be super nice if you told me. Thanks.

  • Jesus christ, okay that was tricky but I finally found a solution. Gave up on those bullshit containers. I went back to my instance-variable-indexes and tried a bunch of different ways to pick the correct instances, and I GOT ONE THAT WORKS.

    The important parent object with all the crucial instance variables and shit is called "Person", everything else is in a family called "BodyParts". Every time I want the BodyParts to do something in relation to their parent Person, I use the conditions:

    • For each Person
    • Pick BodyParts by comparison, BodyParts.index = Person.index

    And it bloody works.

    Thanks everyone.

  • Thanks for the detailed answer!

    I experimented with containers, and they're not what I was expecting but they're really useful.

    However I don't think I can use them because the way they work, from what I can tell, is that one of every object in the container is spawned at once, and each one is linked solely to the objects it spawned with. This means I can't have more than one of the same object, e.g. more than one eye, and still have them linked together in the event sheet.

    I could bypass this problem if there were some way to spawn a container full of objects, then spawn another instance of one of the objects without anything else in the container getting duplicated too, then add this extra object into the existing container. But I have no clue how that would work.

    Any ideas, anybody?

  • I'm trying to randomly generate people that spawn every now and then and walk around. They're made of a torso which contains all the important instance variables and a bunch of other sprites hanging off (limbs, facial features) in their own family called 'BodyParts' or something.

    The characters will be moving around, changing size (handled with a 'SizeScale' instance variable rather than the built-in 'Scale' parameter which wasn't really doing what I'd hoped), changing the z order and jumping between layers.

    I think containers might be what I need, but I don't quite understand how they work so instead I've given everything an 'index' instance variable to show which body parts belong to which torso. I've been using this with the conditions 'if BodyParts.Index=Torso.Index and Torso.Index=BodyParts.Index', to make sure the right instances get picked. Then I'll move the sprites to where they need to be or whatever.

    Anyway, it's not working. The way it assigns the index works fine, the z ordering fake-3d stuff works fine with just the torsos, but the other body parts are all over the place. Even when the conditions specify I want to pick the BodyParts with the same Index as a Torso and visa-versa, it just isn't happening. Some body parts behave and move with their parent torso, but most of them just float about ignoring the programming.

    The BodyParts definitely have the same 'index' as their corresponding torso. So how do I get the conditions to pick all the right ones? Alternatively, is their some other method of getting different objects to move around like one object, including their Z order and everything?

    Sorry if I'm not explaining this properly or if I'm missing something obvious.

  • Oh hey look at that, it works beautifully. Thank you!!!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm making a little system for highlighting interactive objects close to the player in this platformer/adventure-game thing. It uses a big invisible circle over the player that acts as the area in which interactive parts of the environment can be interacted with. So, if an object in the 'Interactive' family overlaps this big circle AND it's the nearest instance to the player's position, it is highlighted with a boolean instance variable thing going 'true' and with a little visual effect.

    SO how do I then un-highlight an object? The easy part is un-highlighting anything not overlapping the player's magic invisible interactive circle. But I also want to pick all instances in the 'Interactive' family which are overlapping the circle but ARE NOT the closest instance to the player.

    I need to pick all instances which do not fit the condition "pick closest to player". How do I do this???

  • thanks a bunch.

    • Putting all my events in groups and only enabling each group when I need to, otherwise they're left disabled so the game doesn't have to think about them.
    • Adding 'Every X seconds' beneath conditions that would otherwise check every tick.
  • I don't know if this is actually what you'd call 'masking', but what I want to do is have every object on one layer display what's on another.

    So, there would be one layer called 'Objects' with various rectangle sprites scattered around it, then another layer called 'Texture' which contains different moving shapes. Not sure how to phrase it, but I want everything on Objects to have the appearance of the Texture layer. The Texture layer is only visible where stuff is present on the Objects layer.

    I guess you'd say I want Objects to 'mask' Texture?

    What blend mode & other settings should I apply to each layer and what order should they be in?

Sam Mortimer's avatar

Sam Mortimer

Member since 7 Nov, 2013

Twitter
Sam Mortimer has 2 followers

Trophy Case

  • 11-Year Club
  • Popular Game One of your games has over 1,000 players
  • Email Verified

Progress

13/44
How to earn trophies