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

Found the code, but I have to convert it.

Platforms.doesPlatformSupportGameSize = function (platform, size) {
        if (size != "small" && size != "medium")
            return platform.id != "Gameling" && (platform.id != "Vena Gear" && (platform.id != "grPhone" && (platform.id != "PPS" && platform.id != "GS")));
        return true
    };

So, you said. You want your Android platform be available only on making small games, correct? You can’t develop medium, large or AAA.

UME is quite limited when it comes to complex things. What I recommend is this, go to codecademy.com to learn some basics on JavaScript. Then you could download other mods using the gdt-modAPI and look at their code and what it does. Then, if you are able to obtain the game code, you should study it to help you learn more complex things. If you ever need help on how to start creating mods through JavaScript, we are all here…

So, if that’s true, the code will be:

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

Thanks for your help! Should this work? And which class file should I put it in?

You are free to look at my mod, ExtnededGDT, found here on the workshop:

http://steamcommunity.com/sharedfiles/filedetails/?id=296660989&searchtext=

Or my forum post

http://forum.greenheartgames.com/t/rel-extendedgdt-1-3-1-0-let-there-be-balance/13740

Lol that’s cool!

Edit: I see endroid

1 Like

Again, if you’re using UME, put it in the code.js . Though, you must put it in a valid position. Paste the code of code.js, and I’ll paste it for you.

Where? My mod added Endroid versions ago :stuck_out_tongue:

Well I can figure the remaining part by myself. Just let me try first. Thanks

1 Like

Cool. If you’re out of luck just tell me. Alright? I’ll be here.

Can I add the piece of code I made to my mod’s platforms as well ? :stuck_out_tongue:

Which piece of code?

1 Like

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