UncleHo74's Recent Forum Activity

  • I've got my problems with image points too... I have several anmiations for an object and per anmiation different image points from where to spawn bullets from.. Accessing them via number works fine, but via name fails.. at least it seems to take a different image point than the one I want to access.. Everything works fine if there's only one animation though..

    Any ideas why accessing the image points via name fails when there are animations? (The animations are set BEFORE I try to access the image points)..

  • Why is it not intuitive? If you set the effect parameter before the wait it would be done then in the event.

    Well, depends on the way you're looking at it.. after reading the article about the loop and the wait stuff several times I could see why the wait has to be on top... you've really to get your head around the fact that every iteration of the loop starts more or less immediately, and a wait at the end (or in another wrong place) wouldn't help much because all iterations are done almost instantly before getting to the wait command. I know that this is adressed in the tutorial, but as I said, REALLY understanding this is something different.. coming from other programming languages / engines , I have a hard time understanding the concept of Construct sometimes... but I'll get used to it.

    I think I got it now.. thanks again!

  • THAT seems to work.. it's not intuitive in any way, but it does the trick.. thanks!

  • Something like this works for me. I don't know how different it is from what you're using.

    start of layout
       local number value=0
       repeat 10 times
          wait 0.1*loopindex seconds
    	  add 10 to value
    	  sprite: set effect "tint" parameter 0 to value[/code:j0v4w6s6]
    A variable is used instead of using loopindex below the wait because the wait action doesn't save the value of loopindex.
    

    Sorry, it took a while for me to answer..

    Hmm.. I just don't seem to get it.. this is my code (it's a sub-event of "start of layout"), doesn't work for me, it doesn't change the value of the blur parameter at all

    (..sorry, imagebucket link, you may have to click to get the full size image and I don't know what evil things they're doing at imagebucket ad-wise..

    guess I'll have to set up some of my Dropbox or OneDrive folders for public access for future images here ...)

  • It's a good practice though

    Who am I to ignore good practice? I'll keep this in mind, thanks!

  • Neat!!

    This "browser->execeute javascript" action is something which I have to keep in mind... thanks!

  • Let's assume I have set an effect - BlurHorizontal in this case - for an object. It's set at 100 percent for this object via settings.

    I want to decrease the effect over time, right after (or at) the start of the current layout.. so something

    like a "fade in" effect (yes I know there's a behaviour which is already very similar.. but let's ignore this for the sake of the question here).

    I tried several methods.. using the "On start of layout" event, the "On Loader Layout Complete" event... in combination with

    "for" and "repeat" loops and "wait" commands and decreasing the value of BlurHorizontal within this loop .. and yes, already having the "wait issue in loops" in mind ..

    https://www.scirra.com/tutorials/723/us ... t-in-loops

    .. but.. to no avail.

    The loop is finished instantly as it seems, but I DID use "wait * loopindex" method which is mentioned

    in the link above.

    The only way I can implement the feature is via "System->on every tick" in combination with a simple "wait x seconds" action and some other simple conditions (in order to avoid the effect to be continued

    indefinitely). This works like a charm. ("every X seconds" works too)

    But I don't think it's very effective.. I don't like the "on every tick" approach.. and I don't get why it's not working with the loop in the "On start of layout" event in the first place.

    It doesn't help finding the root cause that I can't set a breakpoint because this is a triggered event... (speaking of breakpoints, they seem of very limited use in Construct anyway because of the limitations.. how are YOU guys

    using the debugger in practice?).

    Any ideas?

  • Use a "assets" layout that you never go to on runtime to only place all your objects. That's what we usually do on our projects and it works and keep your game layouts clean.

    Yeah, as I said in my first post, I usually already do this, my "scrap layout"..

    Still not elegant in my eyes, and occasionally I started this scrap layout when I click the "Run Layout" Button...

  • you can destroy them or use their settings to set them disabled.

    If it is a bullet I destroy it and create when needed. For buttons and other objects I use disabled and enable as needed. I set all my buttons on the layout and make them visible and enabled as needed.

    Yeah, I know that there are some objects which can be disabled via the settings.. I do that already, my problem was specific to bullets, particles etc. which have to exist at the start but can't be disabled fully (well, you could like setting the speed to zero etc. etc. but it's not THE solution for me either).

  • Destroy them on start of layout then create them when you need them. If they are outside the layout but then destroyed then they are loaded in memory and any lag is avoided.

    Okay, that will work.. quite a "brutal" method and somehow rough around the edges, I would have guessed that Construct has a method to handle objects which are needed later on in the game a more elegant way, but doesn't seem so.

    Thanks for your help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe your problem and the one I was having are related? See here..

  • Hello,

    I've seen that it is common practice to place objects which will be used later (aka "they will be spawned dynamically") outside the Layout.

    This is somewhat weird to me... Objects with bullet behaviour are flying off screen as soon as the layout starts etc, so you have to place them at the "correct" border of the layout so they not come into the players view during the start while they're flying off.. or place them on a "scrap layout" altogether.

    Is this really the "normal" way of handling the "unused" objects? Or is there a better one?

UncleHo74's avatar

UncleHo74

Early Adopter

Member since 9 Feb, 2017

None one is following UncleHo74 yet!

Trophy Case

  • 7-Year Club
  • Email Verified

Progress

8/44
How to earn trophies