Nepeo's Forum Posts

  • Fib It's true, and by design. Sound files are grouped by name, not by extension. If you import sfx.wav and sfx.m4a they will appear as 1 file "sfx", with 2 subfiles for the types "webm" and "m4a".

    Adding a play action selects an audio file, not a subfile. Which means you can add and remove subfiles for that audio file without issue. If you remove the file, or the last subfile, then it will remove the related events.

  • As dop2000 says you cannot modify project files from within your game. This doesn't stop you from being able to keep your changes though.

    If you want to modify the files only for that user, you can save your changes to localstorage. When the game starts you can check if a revision exists in localstorage and load that instead of the project file.

    If you want to actually put your changes back into the project the easiest way is to download the JSON object from your game, and then back in the editor replace the project file with the JSON file you have just downloaded. This basically makes your game a custom authoring tool for that file.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads

    Minor Update here, I was notified that the 12 provider limit appears to have been lifted on the User Consent SDK. I managed to track down a changelog for the SDK and have confirmed that they have removed the limit, I've updated the documentation to reflect this change.

  • Behaviours for exist on the "behaviors" field of the instance.

    for (const inst of runtime.objects.Sprite.instances())
    {
    	const Bullet = inst.behaviors.Bullet;
    
    	if (Bullet.distanceTravelled > 2000) {
    		inst.destroy();
    	}
    }
    
  • Glad I could help. Yeah there's some magic with audio files specifically for being able to have multiple formats, it's quite handy.

  • Automatically converting the files is potentially destructive, and not necessarily what the user wants. For best results you should always import your audio from a high quality source, not re-encode an already compressed file. Also in most cases m4a and ogg is still a valid choice for providing audio support. We still allow users to import m4a files for audio as an alternative to webm(opus).

    It should be relatively easy to convert these files into webm if you so wish. Audio is played by name, ignoring type, so swapping file types shouldn't effect your event sheets. Importing audio can be done in batches, so you can import as many files as you want in one go. If you don't have the source audio anymore then you can extract your audio files from the project by downloading a copy of the project, unzipping the C3P file, and then just copying the files from the "sounds" and "music" folders.

  • The Web Audio API is exposed in a fairly basic way through the actual Audio plugin.

    That said if you know how to write JS there's several projects around that create synths using the Web Audio API. With a bit of work you should be able to embed one into your game, then call it directly using inline scripts.

    This one is pretty cool, I don't really understand what half the dials do though!

    EDIT: MDN has a tutorial for creating a synth using web audio.

  • NetOne Some interesting findings, I would be curious to see what the results would be like over a wider range of devices.

    As for your questions:

    1. Are you using Worker mode or DOM mode for your game? Worker mode doesn't work in an Android app, and has some latency for certain interactions that must be performed on the main thread ( audio, mouse and touch to name a few ).

    2. It's important to understand that we are actually targeting APK 28 ( Android 9 ) and the value that is set is the minimum supported device version. I'm not exactly sure what optimisations are done for this but my expectations are it affects how your app interacts with dynamically linked libraries. These are software libraries which are already on your device, so they don't have to be included in the APK. Setting a lower version will likely include additional libraries in the APK that are absent on older devices, or may use older API methods that behave differently in terms of performance. There's an outside chance that one APK ends up with more performant memory layout and allocation, but that's something which is going to be very difficult to test and tweak.

  • Thanks for letting us know about this Wael-Alwasel I've corrected this for the next beta release.

    Do you actually need this permission? Prior to r169 it was included because a library we used added it, but it wasn't required. We removed it to get rid of unneeded permissions in exported games, but included an option to add it back in case it was critical to anyone's games. However, I'm not aware of any normal use case that would require it.

  • Data from the BinaryData, JSON, Array, Dictionary and XML plugins can all be nested within each other, provided you know the correct transformations. This of course makes them compatible with the localstorage plugin as well.

    The "procedural terrain generation" example project uses JSON to store data for zones of the terrain, converts it to a string then places it into a Dictionary. The keys for the Dictionary are based on the location so they can be easily looked up and replaced.

  • Animate glad I could help, the "hard" option isn't really that hard I guess. When I was working it out it just seemed to be more complicated I guess, so long as you understand it!

  • Well the feature is still new, maybe suggest a "Follow object" action to Ash.

  • There's a lot of information here, but I can't see any clear issue I'm afraid.

    There is a known issue with tracking prevention in Safari 13 which is preventing login sessions from persisting, but it doesn't cause any major issues as far as I'm aware. The following log messages are related to that:

    Blocked a frame with origin "https://account.construct.net" from accessing a frame with origin "https://editor.construct.net". Protocols, domains, and ports must match.
    
    _MaybeSwitchToMemoryFallback — localforageadaptor.js:19
    
    [Error] Unable to use local storage, reverting to in-memory store: (2)
    
    SecurityError: IDBFactory.open() called in an invalid security context — kvstorage.js:22
    
    "IDBFactory.open() called in an invalid security context"
    
    _MaybeSwitchToMemoryFallback (localforageadaptor.js:19)
    
    (anonymous function) (localforageadaptor.js:36)
    
    asyncFunctionResume
    
    (anonymous function)
    
    promiseReactionJob
    

    By the looks of your browser information you may also experience a bug when using TiledBackground or 9Patch objects in worker mode, worker mode has been disabled by default in the latest beta release because of this.

  • It's a little awkward because most of the actions set a value on a parent, which makes it hard to replace the root object. So there's kinda 2 ways forward, depending on what restrictions you have on the format:

    1. Easy option: keep the root as a JSONObject and place the array into a field like so:

    	{
    		"array": [
    			{ "answer": 0, "incorrect": 0, "correct": 0 },
    			{ "answer": 0, "incorrect": 0, "correct": 0 },
    			{ "answer": 0, "incorrect": 0, "correct": 0 }
    		]
    	}
    

    2. Hard option: Use the "parse" action to replace the root with an array, increase the size of the array using the "push value" action with dummy values, then replace those dummy values with objects using the "set object" action.

  • We're planning to update the billing library, the cordova plugin for Mobile IAP is forked off a third party project so we have been waiting on them to complete the work. It's been a couple of weeks since I've checked, so they might have finished. I will take a look today, it would be nice to get it in place for the next stable.