99Instances2Go's Forum Posts

  • I have no idea how your layout looks like.

    I suppose it is close to this ...

    https://drive.google.com/open?id=0B1SSu ... GhPU3ZkSjA

  • Dont store the amount. It is changing while offline. Buildtime can be negative !

    On item 'time' get

    set buildtime to max(0 , (ItemValue - awaytime))

    set amount to (buildtime) - (round(buildtime/10) *10)

  • ..... "on created" are run as if they were placed where the object was created ...

    There are 2 sides of a story here.

    Story 1: The question is usaly: How/When do i pick my newly created object?

    Answher: Use 'On Create".

    I follow the explination given. And it seems very logical to me (now). But 'on create' is still an exeption on that explination. Even when it seems to run as 'in place', even if it therefor does not count as a new top level event, it picks its new created objece just fine. As i hope it is intend to do.

    https://drive.google.com/open?id=0B1SSu ... m9zejd1VlE

    It keeps working flawless when using a familie. I think it is safe to state that 'on creation' works perfectly to pick a newly created object. Althaught it does not meet the explination.

    https://drive.google.com/open?id=0B1SSu ... jJwdGhEZWc

    Story 2: The Question in this topic: How/When do i pick all objects, including that newly created object (all other picks are just filters starting from here) was completely new to me. And the explination fits for 100 %.

    The reason why i write this, is because the explination seems to discourage the use of 'on creation'.

  • tunepunk

    In my second example, i used a wait 0 before calling the function. This wil force the function 'out of place', but stil in the same tick. (at the end of the tick). For me, this is the solution.

  • variable ToCreateOrNot = 0

    variable ToCOUNTorNot = 0

    On destroyed first

    set ToCreateOrNot = 1

    set ToCOUNTorNot = 5

    system > Every 1 second

    System > compare 2 values > ToCreateOrNot = 1

    System > compare 2 values > ToCOUNTorNot = not 0

    System > create an item

    System > substract 1 from ToCOUNTorNot

  • 99Instances2Go Yes, and also if the next top event is 'on created' picking doesn't work either. It's very weird. Seems like 'On Created' doesn't count as a top event either.

    Since 'pick instance by UID' works, I wonder if it can handle a string of multiple UID's? I never tried that.

    If you use the family as target in the 'on created' finds both members in the family. It should only find 1, the newly created one.

    https://www.dropbox.com/s/sj7m3p9s7940r ... .capx?dl=0

    If you use sprite as the target, the family is unreferenced. So it should address all members, but it does not find the new one.

    Makes, at this moment, no sense to me. But i gave you a good and pretty easy solution.

    You can also make 2 function calls, i think.

    1 with the UID of the new created one as param to pick it.

    1 for all the others.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry that i was of no use for you.

    What if you break it down in 2 string ?

    A = "regex thing class=""x"

    B = ""therestofhtethig

    regex = A&B

    Probaly again of no use.

  • Example of using an array:

    Should have posted this after your exams. But hey.

    https://www.dropbox.com/s/ffbcqx2urfwig ... .capx?dl=0

  • Don't use a 3D for this. id beeing the id of the object.

    Set id on (x=id,y=0)

    set X coordinate on (x=id,y=1)

    set Y coordinate on (x=id,y=2)

    Set name on (x=id,y=3)

    Now you can loop on the X-as and retrieve the values for (x, the y you need)

    You can also delete a position on the x-as, deleting the Y values with it. Just simple with the delete action (for array).

    Should be as easy as this.

    From the other thread -

    > Conditions

    > Array - For Each Element

    >

    > SubEvent Conditions

    > System - While

    > System - Compare two values - IndexOf(Array.At.CurX) != LastIndexOf(Array.At.CurX)

    >

    > Action

    > Array - Delete LastIndexOf(Self.At.CurX)

    >

    >

    This is for a 1d array, but it will still work if you add an additional sub event to check that the second value also matches in both.

  • Manual says: Double quotes can be used as an escape character in any string.

    Strings (text)

    Text is also known as strings in programming, and Construct 2 also sometimes uses this naming convention. Text in expressions should be surrounded by double-quotes, e.g. "Hello"

    The double-quotes are not included as part of the text, so setting a text object to show the expression "Hello" will make it show Hello, without any double-quotes. To include a double-quote in a string, use two double-quotes next to each other (""), e.g. "He said ""hi"" to me" will return He said "hi" to me.

  • Sorry i did not believe you. **Bows** . You stand correct. Although i did't get that there is a function involved.

    But it is even weirder then i expected when testing this. The newly created object is in fact in the family.

    Pick by UID can find it.

    Any other pick condition can not find it. Look:

    https://www.dropbox.com/s/mnwajr51uje7y ... .capx?dl=0

    Luckily the solution is easy.

    https://www.dropbox.com/s/znyj6ajfyprjf ... .capx?dl=0

    I never noticed this before. So, now i have a new rule, but i dont know how to formulate it.

    Newly created members of a family are pickable in the next top-event, but not in a function. Kinda.

    You have to rewrite this though. The formulating of this report is wrong. It only happens in a function call.

  • Condition > Sprite > on destroyed

    Action : create

  • Subscribe to Construct videos now
  • I have no idea what that means. It works this way ....

    Some conditon ...

    The create action .....

    New condition 'on created' ....

    Conditions + actions

    The 'on created' picks the newly created object, when it is ready to pick. And then you do with it what you like.

    The 'on created' is a trigger, it does not matter where in the events you put it, as long as it is a root event.

    If this gives you a picking problem (kinda impossible) then you have to be very specific on what you mean with "it still doesn't work". Show the events.

  • You are the second one bringing this up.

    Other than: you are not alone, i have no idea what is gooing on. When i open the capx i n the other topic, everything shows fine.

    So, question is, what happened on your computer a few days ago ? Got to think/recall.