Dieck's Forum Posts

  • 9 posts
  • rexrainbow

    So I tried it out but it looks like the only way the append() function will append and print is if it is called during typing that is already started:

         Acts.prototype.AppendText = function(param)

         {

            if (typeof param === "number")

                param = Math.round(param * 1e10) / 1e10;     // round to nearest ten billionth - hides floating point errors

            this.content += param.toString();

         };    

        

    Would it be possible to have it call _start_typing() if the typing has stopped when append() is called?

    Thanks

  • rexrainbow

    Awesome man! i will test it out today.

    Thank you.

  • rexrainbow

    Ha! It has the append feature in there. I implemented it inside the regular TypeText action with an extra variable passed in (excerpt from 7z):

         Acts.prototype.TypeText = function(param, speed, append)

         {

            if (typeof param === "number")

                param = Math.round(param * 1e10) / 1e10;     // round to nearest ten billionth - hides floating point errors

              

            this.content = param.toString();

            this._start_typing(this.content, speed, append);

         };

    :) Tried to be a minimalist. I like the idea better of adding the append_text function. :)

    Thanks!

  • rexrainbow

    I started using this behavior but found it did not have an append feature. I dug into the js and added it in. I did it as a different name vairant for side by side testing. I thought you might like to either merge it with yours or add the feature. You can grab it here: dropbox.com/s/y0sysnlpo321l19/rex_text_typing_append.7z

    Thanks for making all these plugins! :)

  • rexrainbow

    Ah I see! I will try that method and see how it works.

    Thanks for the thought help on this! :)

  • rexrainbow

    Ok so given the example InstanceBank_savedUID, it seems no matter what I do to the original object sub and main, when LoadAllInstances get called, the newly load instances have new UIDs and the original instances always stay around. That would seem to indicate if you are loading objects from InstanceBank that were placed in the Layout editor, it will always duplicate on load with new UIDs. Is that the case?

    Would it be more appropriate to use a Dictionary or CSV object to store the individual object state including UID and then reset the sprites from that structure?

  • rexrainbow

    So in order to avoid the duplication, would it make sense to stage the load one event cycle after destroying the objects?

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, I did some more digging through related posts and it looks like this is by design. Destroy flags the sprite to be destroyed at the end of the event sheet per Ashley:

    This is sort of by design... "Destroy" means "flag to be destroyed at the end of the event sheet". This is because people commonly write events like

    Destroy Sprite

    Create explosion at Sprite.X, Sprite.Y

    If the Sprite was really destroyed, the explosion would have nowhere to be created because the Sprite doesn't have an X or Y co-ordinate any more. I could fix the two cases you've shown, but the object would still actually exist until the end of the event sheet, which might just make for some more confusing cases.

    So I guess this means if one is loading an InstanceBank, the layout should not have any pre created objects of the saved type in it prior to the loadAllInstances call, otherwise, duplication occurs.

    There I go, answering my own questions... lol

    Thanks!

  • Hi Rex!

    I have been doing a bit of digging into the demos you posted for InstanceBank. After adding in some debug output to print out the UID's for Main and Sub on "instbank_savedUID" as well as adding in a "onanykey" event to reload at will, I found that the original instances are not getting destroyed leading to duplication of the objects. This can be see most clearly with "instbank_savedUID" with the changes since it has movement and the new object show up looking like a fan blade.

    Here is a link to the modified capx file:

    https://www.dropbox.com/s/9pzrhs54u9v1mjn/instbank_savedUID-modified.capx

    (let me know if you can't get to it.)

    Thank you for making these plugins! It's so nice to see a community giving back to one another.

  • 9 posts