rhg1968's Forum Posts

  • Tom

    That did it, Thank you !!!

  • Tom

    I just tried again and I am still getting the error

  • I am getting ready to upload a new version of my plugin and I get an error message that archive can't contain .svg files anymore. That is icon file for the Plugin. If I download the SDK templates they have an svg file and the documentation indicates that the icon.svg file is what it is supposed to be. Just wanted to see if something has changed that I am not aware of.

  • I am on version 407.2

    I created a simple project and imported a simple class without issue.

    I was testing import maps and it throws an error that it can't resolve the import name and it needs to be relative or direct path with a . or /

    I did make the import map json of the type import map.

    This works correctly

    import {Item} from "/Items/Item.js";
    // Import any other script files here, e.g.:
    // import * as myModule from "./mymodule.js";
    
    runOnStartup(async runtime =>
    {
    	// Code to run on the loading screen.
    	// Note layouts, objects etc. are not yet available.
    	
    	runtime.addEventListener("beforeprojectstart", () => OnBeforeProjectStart(runtime));
    });
    
    async function OnBeforeProjectStart(runtime)
    {
    	// Code to run just before 'On start of layout' on
    	// the first layout. Loading has finished and initial
    	// instances are created and available to use here.
    	
    	const test = new Item(123);
    	
    	runtime.addEventListener("tick", () => Tick(runtime));
    }
    
    function Tick(runtime)
    {
    	// Code to run every tick
    }
    

    I then created a json file and set it's type to import map

    Changed my main.js file like so

    import {Item} from "myItem";
    // Import any other script files here, e.g.:
    // import * as myModule from "./mymodule.js";
    
    runOnStartup(async runtime =>
    {
    	// Code to run on the loading screen.
    	// Note layouts, objects etc. are not yet available.
    	
    	runtime.addEventListener("beforeprojectstart", () => OnBeforeProjectStart(runtime));
    });
    
    async function OnBeforeProjectStart(runtime)
    {
    	// Code to run just before 'On start of layout' on
    	// the first layout. Loading has finished and initial
    	// instances are created and available to use here.
    	
    	const test = new Item(123);
    	
    	runtime.addEventListener("tick", () => Tick(runtime));
    }
    
    function Tick(runtime)
    {
    	// Code to run every tick
    }
    

    I then get the following error

    [C3 preview] Browser opened wrong size popup: wanted 854 x 480, got 854 x 479; resizing to compensate
    local.html:1 Uncaught TypeError: Failed to resolve module specifier "myItem". Relative references must start with either "/", "./", or "../".Understand this error
    domSide.js:37 Error loading project main script: Error: main script did not run to completion
     at RuntimeInterface._InitDOM (domSide.js:37:143)
     at async RuntimeInterface._Init (domSide.js:29:261)
    _InitDOM @ domSide.js:37Understand this error
    runtime.js:26 
  • I have an addon in the store that does exactly what has been mentioned.

    construct.net/en/game-assets/addons/publish-subscribe-events-2497

  • The only thing I noticed was that you are storing your calculated result in a string and then the return type of the function is a number, which may convert it a 0.

  • I agree this feature would be game changing. GDevelop has this ability and it really is nice to be able to create behaviors in the editor using events or JavaScript snippets.

  • Thank you for getting back to me. You were right, as I looked at what my plugin was actually doing I really didn't need to call those event sheet functions. I was able to make it work correctly without those calls and now my plugin is all set for v2.

  • I am porting a global plugin I made awhile ago over to v2.

    In my original plugin the calls to GetCurrentEventStackFrame and GetCurrentEvent worked fine.

    Once I upgraded to V2 I get this.runtime.GetCurrentEventStackFrame is not a function

    Any guidance would be appreciated

    Here is the original condition:

    "use strict";
    
    {
    	self.C3.Plugins.RGBZ_PubSub.Cnds =
    	{
    		SubscribeToEvent(name)
    		{
    			console.info(`Subscribe called ${name}`);
    
    			const current_frame = this._runtime.GetCurrentEventStackFrame();
    			const current_event = this._runtime.GetCurrentEvent();
    	
    			const eventId = current_event._sid.toString() + '-' + current_frame._cndIndex.toString();
    
    			if (this.EventPublished && this.EventPublished.Name==name.toLowerCase() 
    					&& this.EventPublished.HandledBy.find(x=>x==eventId)==null) {
    				this.EventPublished.HandledBy.push(eventId);
    
    				return true;
    			}
    			else {
    				return false;
    			}
    		}
    	};
    }

    Here is the new V2 version

    "use strict";
    
    const C3 = globalThis.C3;
    
    C3.Plugins.RGBZ_PubSub.Cnds =
    {
    	SubscribeToEvent(name)
    	{
    		console.info(`Subscribe called ${name}`);
    
    		const current_frame = this.runtime.GetCurrentEventStackFrame();
    		const current_event = this.runtime.GetCurrentEvent();
    
    		const eventId = current_event._sid.toString() + '-' + current_frame._cndIndex.toString();
    
    		if (this.EventPublished && this.EventPublished.Name==name.toLowerCase() 
    				&& this.EventPublished.HandledBy.find(x=>x==eventId)==null) {
    			this.EventPublished.HandledBy.push(eventId);
    
    			return true;
    		}
    		else {
    			return false;
    		}
    	}
    };
    
  • Your script block is at the same level as the on start layout. So it's not part of that event. It gets called every ticket of the game.

    You need to either add it directly to on start layout or to a new sub event of the on start for it to only run once/

    If you want to call it from the event sheet as a function you should move it to a separate js file and import it into the events js file so it's available to call in the event sheet

  • Thank you for your input. Worst case I can disable the extension when creating a new project. Once the project is created there aren't any issues.

  • I tried it in edge and it worked. So I disabled all extensions and it worked. So I started turning extensions back on. It appears it is happening with the last pass extension. Last Pass is a password management app. So not the greatest situation because it is one that I definitely like to use and it causes the issue.

  • I have been working on an existing game for awhile, but if I try to create a new project Construct 3 always crashes. I have tried on different computers and I am never able to create a new project. I have wiped the browser storage and started from a clean re-download/cache of the application. The results are the same.

    I am using chrome 99.0.4844.51, windows 10 and windows 11, and R285.3.

    I always get the following error when trying to create a new project.

    Error report information Type: unhandled exception File: https://editor.construct.net/, line 0, col 0 Message: ResizeObserver loop limit exceeded Stack: null Construct 3 version: r285.3 URL: https://editor.construct.net/ Date: Fri Mar 04 2022 07:55:28 GMT-0500 (Eastern Standard Time) Uptime: 47.2 s Platform information Browser: Chrome Browser version: 99.0.4844.51 Browser engine: Chromium Context: browser Operating system: Windows Operating system version: 10 Device type: desktop Device pixel ratio: 1 Logical CPU cores: 8 Approx. device memory: 8 GB User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 C3 release: r285.3 (stable) Language setting: en-US WebGL information Version string: WebGL 2.0 (OpenGL ES 3.0 Chromium) Numeric version: 2 Supports NPOT textures: yes Supports GPU profiling: yes Supports highp precision: yes Vendor: Google Inc. (Intel) Renderer: ANGLE (Intel, Intel(R) HD Graphics 630 Direct3D11 vs_5_0 ps_5_0, D3D11-21.20.16.4574) Major performance caveat: no Maximum texture size: 16384 Point size range: 1 to 1024 Extensions: EXT_color_buffer_float, EXT_color_buffer_half_float, EXT_disjoint_timer_query_webgl2, EXT_float_blend, EXT_texture_compression_bptc, EXT_texture_compression_rgtc, EXT_texture_filter_anisotropic, EXT_texture_norm16, KHR_parallel_shader_compile, OES_texture_float_linear, WEBGL_compressed_texture_s3tc, WEBGL_compressed_texture_s3tc_srgb, WEBGL_debug_renderer_info, WEBGL_debug_shaders, WEBGL_lose_context, WEBGL_multi_draw, OVR_multiview2

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It could also be if you're behind a proxy. I have seen where most things work correctly from a proxy but it will fail to load the minimizer until you are no longer using the proxy.

  • Thank you.....

    I couldn't figure out why it was not defined. Works now :)