How to create a custom platform that only works with small games?

This one:

Platforms.doesPlatformSupportGameSize = function (platform, size) {
        if (size != "small")
            return platform.id != "ID_OF_ANDROID"
        return true
    };

Of course, if you figure it out yourself it would be the same. It doesn’t belongs to me, you can use it of course.

Thanks. Good luck with your mod. Hope you will be using the API Soon

Thanks, we made this topic super long in a few minutes (like 20 posts) lol

Meh, I like to help

@FireChaos this is a very bad idea. What you are essentially doing here, is overwrite an existing game function and replacing it with a version that does not do what the original was doing.

If anyone would actually use this in their mods, it would mean that the grPhone and the Gameling would suddenly also work on large to AAA games.

What’s worse is that if anyone else modded this function you would also overwrite their changes. Not cool.

@123sendodo

What you should be doing is hijack the original method as explained under Changing game code behaviour.

This will likely look like this:

(function(){
	var originalMethod = Platforms.doesPlatformSupportGameSize;
	var customPlatformSizeCheck = function(platform, size){
		//handle our custom case
		if (platform.id == 'EnDroid' && size!='small')
			return false;
			
			
		//otherwise preserve original functionality
		return originalMethod();
	};
	Platforms.doesPlatformSupportGameSize = customPlatformSizeCheck;
})();

@FireChaos: also please don’t copy/paste code from the game on the forum as it is against the modding agreement. We are fine with it in the advanced modding category, to a degree, but not in the public categories.

2 Likes

You ninja’d me.

The game developer ninja’d me on a game code question… Seems legit!

1 Like