RattyRat's Forum Posts

  • Hi,

    Suspected as much. However, if this is expected behavior, then surely it should be documented (otherwise I would not have reported it).

    I had a good search through the manual and could not find anything explaining this (although I found at least one occurrence of the manual distinctly saying instructions are applied in order, whereas "destroy" is clearly not).

    Please could you also suggest why, having set the variable Clicked to YES, the next event that checks if Clicked is YES does not get run.

    Thanks for the swift action on this,

    RR

  • Hi, manual states that events/actions run in order shown but some actions (Sprite.Destroy) seem to occur only after end of main loop.

    (also trying to analyse this I got an oddly similar result when setting a global variable).

    Link to .capx file (required!):

    dl.dropboxusercontent.com/u/15657176/Destroy_Order.capx

    Steps to reproduce:

    1. Run prog

    2. Click on a sprite (sprite is destroyed)

    Observed result:

    1. Note that Destroyed Sprite UID still appears in For Each Sprite report

    2. Note also that although 'Clicked' is set to YES the "BEFORE" (before loop end) report (which is after the click event) does not get shown.

    Expected result:

    1. Destroyed Sprite UID should not be in For Each report

    2. "BEFORE" report should be showing

    3. "AFTER" (after loop end) is as expected

    Browsers affected:

    Chrome: yes

    Firefox: ?

    Internet Explorer: ?

    Operating system & service pack:

    Win 7 SP1

    Construct 2 version:

    r143

  • Found a solution using Families, here is an example to illustrate:

    https://dl.dropboxusercontent.com/u/15657176/FindBothInOffsetOverlap.capx

    By putting the sprite in a family and then detecting offset overlap with that we get 2 picked lists, one for the sprite and one for the family.

    Using FOR EACH did not work as it only picks from one object.

    Using a normal FOR loop from zero to 'PickedCount' and then applying the Pick Instance event on both the sprite and family seems to get the matching pairs.

    I hope this helps someone else as it was really frustrating me!

    RR.

  • Hi all,

    I suspect this is not possible, either that or I have really missed something.

    I have lots of instances of the same sprite, I need to know when another instance of the same sprite is, say, 16 pixels above another (IE Y-16).

    This is easy enough using the 'Is Overlapping At Offset' event, set Y to -16 and I get all the sprites with another sprite 16 pixels above them.

    But is there any way of picking the sprite that is at the Y-16 offset? Using Pick Instance does not work because the picked sprites are only those with a Sprite at Y-16, not the ones at Y-16.

    I realise I can have another event to look for the Y+16 sprites, but it seems really wasteful to have to do two overlap detection's when both sprites would have been found in the first event.

    Any ideas?

    Cheers,

    RR

  • Blacksmith - Thanks, I had realised that but had thought that setting the objects timer back to 1 might have fixed it.

    Ashley - Cheers - that helped me fix it, I now set a global variable called dialogtimer to wallclocktime + 120 in the above event, then have a second event that checks for wallclocktime >= dialogtimer and adds one to the DialogueID when it does.

    Thank you both for the swift replies, much appreciated.

    RR.

  • Hi,

    I am trying to get some dialogue in my game that pauses the game while it is being displayed, here is the code:

    <img src="https://dl.dropboxusercontent.com/u/15657176/codebit.png" border="0" />

    It pauses the game by using "Set time scale to 0" and it correctly displays the first dialogue part. Unfortunately it then stops at the wait statement and never goes on to the next line, despite my having set the time scale of the dialogue text box (which triggers the event) to 1.

    I assume therefore that the Wait statement must be system specific (IE linked to the global timer) rather than event or object specific.

    So my questions are 1) Is this expected behavior? and 2) Any ideas how to make this work as expected?

    Cheers.

  • Hi Onion,

    I have been going through the same wringer as you it seems. This certainly appears to be a gap in construct 2`s functionality.

    My first impulse was to use Arrays (object gives an array index to look up the appropriate text) or Dictionary (same but dictionary key passed). First major problem with this is that these can only be populated at run time from the event sheet, not much use when I want to define dialogues for each level.

    Also for my game I want occasional events to start the dialog, with sets of dialogues chained together to make conversations, possible with arrays but not ideal.

    My current solution is to use just one pipe separated string like:

    Hello Joe|Hi how are you|Not too good can you help?|Sure, I`m the hero aren`t I?|{end}

    Then my events pass an ID to the dialogue text object (which has an 'is ID >0' event waiting) and that uses tokenat(dialogue.txt,ID,"|") to get the correct string. The rest of the conversation goes in sequence from that until it gets to a {end} string.

    This way I can have a different instance of the dialogue text object per level with several different conversations in it.

    Still a little clumsy to edit the string so not ideal (although you could read it from a text file and use newline as a separator). * - Also not too sure how many characters the text object allows?

    Hopefully Scirra will see the need and implement something more useful.

    I hope this helps someone with similar problems.

    RR

  • Thanks Arima,

    Coming from a traditional coding background this is making my brain twist around a bit.

    It looks to me like any action that changes an object will act on all picked instances, while any action that needs to access the objects properties needs the loop (so it knows which one it is getting the data from).

    Cheers!

    RR

  • Thanks vee41, that sorted it, very much appreciated.

    I just tested it with sprites not in families and noticed it requires the same, I am amazed I got this far without hitting this before.

    I also spotted that if I put in, say, a rotate action instead of the text setting it acts on both sprites, could you explain the distinction (IE why one action needs the loop and the other does not)?

    Cheers,

    RR

  • Hi all, I hope you can help me with a problem I have been having using Families and instances.

    On this link is a simple test case I have created to demonstrate the problem:

    FamilyTest.capx

    This is not exactly what I am doing in my actual app but it shows the issue nicely.

    In this example I was expecting it to show me the UIDs of both the sprites in 'Family1' but it only ever shows the the UID of the sprite with UID zero.

    Surely the 'is visible' event should pick both instances in `Family1`?

    Any help with why it does this or what I am doing wrong would be much appreciated.

    Cheers,

    RR

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks (odd, I could have sworn I`d already replied to this a month ago!)

  • Hi,

    Is there a way to get the forums to automatically e-mail me when someone replies to my posts/topics?

    I have found this useful on other forums as without it I tend to miss replies and end up looking unresponsive or just plain rude.

    Sorry if this is something obvious that I have simply missed.

    Thanks,

    RR

  • Cheers for the responses (and sorry for my tardy response).

  • Thanks for the swift reply.

    Well, okay then. I can understand this might be Box2D behavior, too bad really as it adds a level of complexity to setting up joints and an extra overhead during runtime.

    Incidentally a quick search of the bugs forum for revolute turns up some more recent reports of similar behavior.

    As it is not going to be fixed perhaps an addition to the manual pages on joints would be in order as it might save some hair pulling for other users.

  • Is anything being done about this Bug? I am getting the exact same effect in R124.

    The revolute joint position remains the same on the source object and the point it is attached to on the secondary object will also stay the same until a different frame is chosen on the source object. When that happens the point of attachment on the second object drifts.

    It is very frustrating and I would like to avoid adding multiple, unnecessary, blank objects just to get revolute joints to work correctly with animated sprites.

    Ta.