DiegoM's Recent Forum Activity

  • The way you have it set up the loops are executing every tick, so effectively all the time.

    If you want a loop to only happen after something else takes place, you should place it as a sub event of either:

    1) A block of conditions you want to be met before the loop executes

    2) A trigger condition

    In your example try placing the the loops you have as a sub event of the On start of layout trigger.

    Doing that will cause them to only run once, in this case, when the layout starts.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think the problem you have is logical. For 16 unique answers, you can only have 4 different questions if each of them have only 2 answers, that would be 2 * 2 * 2 * 2 = 16.

    With 4 questions you guarantee to get a unique answer each time.

    Right now with 8 questions you have 256 possible results. That's 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 = 256. So if you have a catch all case, it makes sense that most people are getting the same result, only 16 combinations out of 256 have something! The probability is 16 / 256 = 0.0625 which is 6.25%. I think i got the math right... in any case, it's a pretty low chance.

    If you want more questions there are a couple of things I can think about that you can do.

    1) More unique answers. So for 5 questions with two possible answers, you would need 32 unique answers. 2 * 2 * 2 * 2 * 2 = 32. That might be a lot of work, but the results are guaranteed to be unique.

    2) You can have questions that decide the main result and questions that only wedge the main result a little bit. This will allow you to keep the answers you have and potentially have an infinite number of questions. This approach requires additional logic to decide exactly what it means to "wedge" the final result, and once that is decided, how big each wedge should be? The good thing is that you don't need to produce more unique results.

  • You have the "Open in Construct 3" option, so that means Construct is already installed as an app in Chrome. That's why you can't see the "Install" option.

    Have you tried opening it by clicking on "Open in Construct 3"?

    Edit: Sorry I missed that part of your original post.

    Try uninstalling C3 by opening it using the Open in Construct 3 option, and then going into the menu in the top right and choosing the Uninstall option. Then try installing it again.

  • Some browser extensions can cause problems with C3.

    Recently there have been a few reports of the error ResizeObserver loop limit exceeded. If that is the error you are seeing, try disabling your browser extensions to see if it makes a difference.

  • To answer the original question, there is no built in way to do what you want.

    The easiest thing I can think of is keeping track if the boss has been defeated in a given room, then with that information decide if it needs to be destroyed or not after recreating all the instances in the corresponding room.

    This falls in the domain of very specific game logic, so C3 doesn't provide a special way of doing it.

  • This is 100% an issue with some extension.

    C3 does not use the ResizeObserver object anywhere. So if that is causing a crash, it's coming from somewhere else.

    Try disabling your extensions one by one until you notice the problem stops.

  • I just checked the feature support and it seems that Firefox and Safari are falling back to our custom resize algorithm.

    I will have yo try it out to be sure that is the case.

  • It makes sense that the problem is still present in Edge and Opera because much like Google's Chrome, they are based on the open source project, Chromium. So they pretty much have the same strengths and weaknesses.

    Firefox and Safari are both unique, so they have different strengths and weaknesses.

  • This seems to be related to this chromium issue. Where the maximum quality when resizing doesn't produce the expected result.

    bugs.chromium.org/p/chromium/issues/detail

    C3 is using a browser feature to produce resized images when it is available, if it is not available, it falls back to our own implementation of a resizing algorithm, which I have noticed produces better results, the problem is that it isn't as efficient as the browser and it is prone to run out of memory.

    For a while now the feature has been supported by browsers, so the custom resize logic isn't used. In any case, I prefer to not use that because the browser implementation will be way better, assuming it works. The problem is that there is no reasonable way to detect if the resizing is working properly or not to fallback to our resizing method.

    Is this a problem in other browsers? Namely Firefox and Safari.

  • After the tween starts, t.value will have the value the tween is currently in.

    In order to get the changing value over time you need to query that function multiple times during the lifetime of the tween. You can do that by listening for the "tick" event of the runtime.

    Try adding something like this to your main script.

    let t = null;
    
    async function OnBeforeProjectStart(runtime)
    {
    	// Set up a "tick" event listener
    	runtime.addEventListener("tick", () => Tick(runtime));
    	
    	// Get the first Sprite instance
    	// (assumes a Sprite instance already exists in the layout)
    	const sprite = runtime.objects.Sprite.getAllInstances()[0];
    	
    	// Get the Tween behaviour from the sprite
    	// (assumes the Tween behaviour has been added to the instance in the editor)
    	const tween = sprite.behaviors.Tween;
    	
    	// Start the tween
    	t = tween.startTween("value", 200, 3, "linear", {
    		startValue: 100
    	});
    }
    
    function Tick(runtime)
    {	
    	// Check every tick for the state of the tween,
    	// Make sure it has been created and that is hasn't been released before trying to use it
    	if (t)
    	{
    		if (t.isReleased)
    		{
    			// Null the reference to the tween once it has been completed
    			t = null;
    		}
    		else
    		{
    			// Get the value of the tween
    			console.log(t.value);
    		}	
    	}
    }
    

    You can check what is being printed in the console by pressing F12 when the preview window shows up.

  • This is a small example showing how to load an animated SVG.

    dropbox.com/s/w66ch2oks77qzl1/Animated%20CSS.c3p

    The SVG is in it's own file and is loaded into the HTML element using the AJAX plugin. The animation is defined in a separate CSS file which is loaded automatically by setting it's purpose to "Stylesheet"

    I haven't tried it, but you could also choose to define the SVG and CSS directly in the Content property of the HTML element instance.

  • Yeah, that's it. That's the main thing the timer behaviour does under the hood.

DiegoM's avatar

DiegoM

Member since 24 Apr, 2015

Twitter
DiegoM has 1,380,312 followers

Trophy Case

  • 9-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies

Blogs