Angus OnAir's Recent Forum Activity

  • Thanks for that. I actually hadn't come across the Pin concept anywhere thus far. Useful stuff.

  • Hello,

    I have characters with identical sets of sprites (body, clothes, hair). It seems like the thing to do in such situations is to collect them all into Containers. Easy enough, and the spawning/despawning works fine.

    From there, however, I can't get the set of sprites to move as one. I thought that was one of the features of a Container, but every time I try to pick an instance of something inside the container, only that picked sprite gets updated.

    I've added the sprites in the Container to a Family, and have tried speaking to just that Family. This does seem to speak to all of them as one, but if I try to randomize the position, I end up scattering all the Container's sprites.

    I found a workaround by declaring a local variable, randomizing that, and setting the family Y to it, but am I fundamentally misunderstanding how Containers and Families work?

    I should mention that I was originally tucking only the parent sprite of the Container into a Family (I have several unique Containers doing the same thing), and having all the child sprites in that family seems like it would cause serious Instance Variable bloating. Am I wrong in theory there too?

  • Bumping. Not sure this topic ever updated in the forum list.

  • I've been dealing with a character swapping issue for several months now, and I was wondering if we could examine methods for doing so in-game during play without pausing. My specific scenario is as follows:

    I have three character containers at all times. At any moment, however, these can be switched to any one of four character designs (which involves several sprites being swapped out). To give a drastically oversimplified example: Mario gets replaced by Luigi, Peach, or Toad on queue, and each character involves a unique set of costume accessories in child sprites which also have to get swapped out.

    The amount of animations involved and the possibility of adding more in later makes simply stacking everything into one sprite's animations unwieldy and inextensible. (As was the suggestion here).

    The fact that UID's can't be predicted and IIDs can be dynamically updated makes these unreliable, as I cannot talk to any of my objects once I destroy one instance and replace it with another. I've managed to use a Local variable number to refer to the characters with limited success, but I can't figure out how to reassign the number to an object after swapping. For example:

    Character IID 3 is assigned localVar value 2.

    Character IID 3 needs to be swapped out, and so is destroyed.

    New character is immediately swapped back in, but the IIDs are all wrong now and I can't figure out how to specify the new instance to reassign localVar value 2.

    I've also seen this tutorial, but that scenario seems to involve switching between objects which never get removed or added back to the layout, and all exist simultaneously.

    I'm starting to think in circles. Am I simply approaching this from the wrong mindset?

    I've tried making use of Families and Containers. Unless I'm mistaken, containers don't allow you to selectively destroy/spawn one single child sprite. Families, meanwhile, suffer the same UID/IID limitations as their Sprite children.

  • My tests which resulted in the screen shot support what you're saying, I think. Per the update I just posted in the original message, I found that forcing the vars to not be set for at least one additional tick seems to have resolved the issue.

    Thanks for your quick feedback! Now that I've resolved this, I can actually start working on the Families related issue that I originally set out to investigate with all this. One problem solved, two more corp up. Yaaaay...

  • As a quick followup, the order those functions in the image are executed is as written on pressing the Space bar. So, MakeNewPlayer -> MakeNewNPCs -> SetLocals.

  • UPDATE: I seem to have fixed it with smoke and mirrors. I added a binary numeral var which is not toggled until all of the characters are created. This toggle causes the variables to be set, but is positioned in such a way that they must be getting set on the tick following object creation.

    With the permission of the moderators, I'd like to leave this post in place for anyone else struggling with this issue. I wasted several days on it. I'm also hesitant to believe I actually understand what's going on.

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

    Hello all. I've been wrestling this for days, and scouring the forums and manuals, so I beg your pardon if this has been addressed elsewhere.

    I am trying to use Create Object to spawn several characters at once, then set instance variables for each of them within the same tick. I know that the first spawned object will be IID 0, because I destroy all objects at the start of the layout.

    The system seems to be either overwriting or completely ignoring those instance variables. I'm setting a text field to verify what's going on, and I get different results within the same tick depending on where that text is set.

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

    In the attached image file, everything works fine, and all the instance variables seem to be properly assigned. If, however, I move that Set Text event anywhere else in the program, including the blank sub event at the end of the attached image, the only instance that retains it's setting is whatever instance I pick first. I know it isn't just the Set Text that isn't working, because I'm tried retrieving the instance variables with subsequent mouse clicks, and those results match the Set Text's output.

    Is it just impossible to pick instances in the same tick as creation of the instance? That doesn't seem entirely true, given the positive results I mentioned. I have no idea what is going on here...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello all,

    I realize I'm not very active as a forum poster, but several friends and I have been following Construct2's development for a while, love it, and want to pick up a set of Business licenses in the near future.

    My Suggestion relates to the layout of the suit's work space. The high degree of customization in arranging the work space is very accommodating, but it seems there's no way to save a particular arrangement once I've got it all just so.

    I like to group all of my layouts on one side of the suit window, with all of my event sheets grouped on the other side. I'd love to be able to save and call up my custom arrangement when I open Construct2. Once you get several layouts and event sheets involved in a single .capx, stopping to rearrange everything on start-up gets a little unwieldy.

    Please accept my sincere apologies if this has already been suggested elsewhere. I tried to check, but one never knows. If this feature already exists, and I'm just blind, I'd be immensely grateful if someone could tip me off.

    Thanks very much for your time.

    Update Added the nature of the request to the topic title. Sorry about that.

Angus OnAir's avatar

Angus OnAir

Member since 31 May, 2013

None one is following Angus OnAir yet!

Connect with Angus OnAir

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies