konterball's Forum Posts

  • Well, I am a step further.

    Using "object" as type and JSON as object, I can access to instance variables via _instVars. At least i get the keys and their type. But how do i access their values?

    Thanks!

  • Hi,

    i created a plugin with an action called "TrackEvent", the 2nd param should be an object with key-value pairs, for example: {level: 10, score: 20, stars: 2}. The keys can change, so the structure must be variable.

    How to solve this properly? I mean you only can use string, number and boolean as data types.

    Maybe using the type "object" and then work with the JSON of C3?

    But then how i access the data in my plugin action method? console.log shows me "C3.ObjectClass" for this parameter. How I should proceed?

    Or is there a better way?

    Thanks in advance!

    Tagged:

  • Ashley, could you please tell me how to get a list of all the files (names) that are in "Sounds" and "Music"? Like "AddAudioFileParam" does it.

    I would like to set them in my plugin as source for the Howler object. Thanks :)

  • Yes, i know that. As i said, I couldn't believe it either, but they have assured me that only MP3 is possible in their "special" environment.

    Anyway, I started today to create a plugin for them that uses Howler... Lucky me, that my game only uses "Play", "Set Silent" and "Is Silent", so it should be easy to accomplish :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, I feel like you too. I don't want to give any names here, of course, but the game should be integrated into their app (android apk) and I was told that they would not support OGG and M4A / MP4 and I had to convert that to MP3 by myself.

  • I have a problem: The target platform on which my game should run does not support OGG or M4A.

    Crazy, but that's the way it is. Is it possible to force MP3 in any way for my project? Maybe via an external plugin or certain adjustments that I would have to make after exporting?

    Thanks a lot for any help!

    Tagged:

  • Hi there,

    getting the error "ReferenceError: window is not defined", but i don't have any clue where to put code as follows:

    window["game"].pause = function() {
    	self.Trigger(C3.Plugins.MyPluginName.Cnds.OnGamePause);
    };
    

    I tried different places, but window has never been defined. Has to be a place where I have access to "inst" as well.

    Thanks a lot :)

    Tagged:

  • Thanks for your fast answer!

    Yes, i know that suspending the runtime while showing ads is a little bit "misused" and not the intended use case.

    "The solution is to either remove the opportunity for input events to reach the runtime, or don't suspend the runtime."

    Not suspending the runtime is no option, cause i need to pause AND mute the game. If there is alternative way I'm glad to hear it :)

    How i can remove the opportunity for input events to reach the runtime? Is there a runtime function to manage this? To switch it on and off? This would help me a lot!

    Thanks :)

  • Hi there,

    I'm not sure if this is a bug. If not, maybe you can see it as a suggestion for a next update ;)

    I found out that the game (runtime) while suspended doesn't ignore player inputs, for example a tap gesture. You tap in the suspended game and the actions of this condition will be executed after the suspension finishes.

    It would be very great if any interactions with a suspended game would be ignored.

    I use setSuspended(true) while showing ads (game pauses and mutes). I don't know why but if the player skips an ad this touch event goes "through" the ad overlay right to the game. So if for example a sprite is placed under this "skip" area of the ad its actions will be executed after the ad closes although the game had been suspended in the first place.

    As a workaround I created a "isAdShowing" condition in my addon and use it (inverted) combined with all used touch conditions in my project, but this doesn't seem very elegant.

    It is possible to avoid this behavior of the runtime in the first place or what i can do to solve this issue in a better way?

  • Ashley: Great! Thanks a lot :)

  • For example i would like to show ads and make sure that the game is paused and muted. Video ads together with the sound and/or background music of the game are not allowed.

    What would you suggest?

    It is possible to call SetTimescale(0) in my addon action? And i would need to mute the game as well.

    Maybe both is possible with CallAction functions?

    THANKS

  • Found it out on my own:

    	...
    	inst.GetRuntime().SetSuspended(true);
    	// or:
    	c3_runtimeInterface._GetLocalRuntime().SetSuspended(true);
    

    Thanks for nothing :)

  • Hi there,

    I created an addon, but I cannot figure out how i do suspend a game.

    In C2 the easiest way was to call cr_setSuspended(boolean).

    In the instance.js i tried the following (doesn't seem to work):

    C3.Plugins.MyPlugin.Instance = class MyPlugin extends C3.SDKInstanceBase
    	{
    		constructor(inst, properties)
    		{
    			super(inst);
    			...
    			var self = this;
    			window.onPauseRequested = function(){
    				self.setSuspended(true);
    			};
    ...
    

    Is there a (global) function to handle it like it was possible before?

    Thanks in advance!