Chroma72's Recent Forum Activity

  • I have two sprites and I would like to be able to go "If spriteA.myvar = spriteB.myvar" or something like that.

    I would rather not use containers or family. Any ideas?

  • I was using a lot of sub-events to do IF statements to set vars and was like..hmm...it would be cool if I could use ternary operators when setting variable values. I hit run and...WALA!! Happy camper here!

    Example:

    MyVar set to (a > b) ? a : b

    I would put a happy face emoji here but we can't use emojis on this forum. :(

  • Hmmm...neither of those triggers are working for me. Maybe the best solution is to just do a System Wait or does something else then make the sprites visible.

    EIDT: Wait For Previous Actions will do the trick.

  • Makes sense. And thanks for pointing that out.

  • So, I am creating 3 sprites in a function and setting them to Invisible. I then call another function that iterates the Sprite(s) and sets them all to Visible. The sprites do not appear.

    Maybe since the sprite creation and visibility settings are happening in a function, that the ShowSprites function is being called/finishing before the CreateSprite functions are finished?

    Putting the System Wait for 0.001 between the sprite creation and the ShowSprites function makes it work. But I'm wondering if there's a deeper problem.

    Pic attached so you can set up a similar experiment.

  • Worked like a charm. Thanks Kyatric!

  • I accidentally saved my project with the r252 beta release and now can't open it in r25102 stable release.

    I went into the project.c3proj and changed all r252 to r25102 and now I can open it in the C3 r25102 stable version. Is this safe to do? Or could it cause issues? BTW, I have NOT used any of the new features in r252.

  • Yep, an int set to 0 or 1 is what I'm doing now. Was hoping there was some secret to it or I had missed something.

  • I have already used AJAX and JSON to load the appropriate json file and all works well. One of my attributes in the json is a bool. It is set to false. How do I assign my Sprite bool variable to the value of the json bool value?

    I know I can do a sub-event and do a if json value = true then set sprite.mybool to true... But is there a way to do it directly?

  • So let's say I want to add a Vector3 style 1d array to my sprite. Currently I would add three separate variables to it (X, Y, Z) and call it like this: Sprite.X, Sprite.Y, Sprite.Z. The variables list can get really really long.

    What does everyone think about being able to add a 1d array style behavior to a Sprite (such as [3]) ? For instance if you added a 1d array named 'myArr' with a length of 3 to your sprite, you would call it like Sprite.myArr[0], Sprite.myArr[1], Sprite.myArr[2].

    Opinions?

  • You do not have permission to view this post

  • So in my case the empty object would not be a few off-screen to track variables. Each image sprite would have an empty object parent. So there would be a LOT of empty objects moving around using behaviors and other plugins. I think that was the whole basis of requesting an empty object, to use as parents for a great number of sprites, not to use a few off-screen to tracks variables, etc.

    The parent use for thousands of sprites lends credence to creating an empty object plugin for sure. Also, what SnipG said about the impact is interesting. With sprite invisible and collisions disabled, sounds like they are still in the render and collision lists and being checked against to a certain degree?

    Reading everything again, I don't know if there are many projects (if any) that would be impacted by having a lot of invisible/collision-disabled sprites being used as an empty parent object. It doesn't impact my project at all BTW.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Chroma72's avatar

Chroma72

Member since 24 Sep, 2016

None one is following Chroma72 yet!

Trophy Case

  • 8-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies