Superelastic's Recent Forum Activity

  • instance.count seems the way to go.

  • Just one other thing, is there a way to identify the total number of instances spawned for an object. If I can get the total number of IIDs, I can select the last one as the child and the penultimate one as the parent.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You've been a great help!

    The spawn is created in a For Each loop so I guess it makes sense that pickedcount shows as 1. Where it spawns that must increase it to 2 until it passes through the loop and reverts to 1.

  • Thanks once more. Definitely getting somewhere (and learning plenty). One remaining oddness I have is that carn.pickedcount = 1 for all instances, even though I have multiple instances in action. Occassionally I see it rise to 2 then immediately drop back to 1.

  • Cheers! Will definitely use the first bit for inheritance.

    The second bit returns some odd results for me - I think I need to look at how I'm spawning.

    The actual parent and child UIDs are 73 and 280, however I get the following:

    carn(0).uid = 5 (shrug)

    carn(1).uid = 73 (parent ID)

    carn(2).uid = 279 (child ID minus 1)

    Would UIDs typically be incremental (1,2,3,4...)?

  • Thanks for the reply, vee. For inheritence, I could individually assign each variable to the child object (although there are 30+variables) but seems a reasonable solution. However, I still need to identify the child UID. I thought this would be populated by NewUID=Carn.UID but that picks up the parent.

  • Hi all

    New to Construct (and game authoring) but have gone through the faq, manual and forum looking for an answer to this.

    I have a sprite "Carn" to which I assign values to variables during runtime, not in the layout. Once this instance has enough health & energy I spawn a new instance of Carn.

    At present, the new instance selects the default variable values from the layout. I would like it to inherit its parent's values.

    Secondly, after the spawn action in the same event, if I select Carn.UID it gives me the UID of the parent, not the child.

    This picture might make it a bit clearer:

    <img src="http://www.superelastic.net/construct2/CarnSpawn.png" border="0" />

    Any help would be much appreciated.

    Thanks

Superelastic's avatar

Superelastic

Member since 2 Feb, 2013

None one is following Superelastic yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies