Technical mod feedback


#1

I took a look at some of the current mods listed under http://forum.greenheartgames.com/t/unofficial-mod-list-index/8619

Some promising/fun mods are appearing already but I’d like to point a few things out to the modders involved (@dillion345, @jasonlamb, @Venomous, @Gold, @hi5gameslp and @DzjengisKhan):

Many mods seem to include files from the gdt-modAPI

Don’t include files from gdt-modAPI project. The gdt-modAPI comes with the game so if you clone files and include them with your mod then all you do is override what is already there and this could cause problems in the future.

Most mods I’ve seen would be better off, if the following folders are removed:

  • remove the api folder from your mod
  • remove the helper folder from your mod
  • remove the examples folder from your mod

And some things to check:

###Names

Give meaningful names to your mod and any global objects/items you put into the game. Naming your mod GameDevTycoonMod or GDTExpansion isn’t a very good name because chances are that someone else will pick this name as well. Pick something that is unique, instead of generic.

In the same spirit, make sure that any id’s are globally unique. When in doubt, use a GUID generator to generate your id’s.

###Don’t steal from other mods
It’s okay to learn from other mods and I think everyone is happy to help each other out but don’t re-use stuff from other mods without asking first. Copy/pasting code will also introduce compatibility problems, since mods might overwrite each others data.

###Scope
Don’t pollute the global scope. If you don’t know JavaScript very well then just follow these guidelines: Instead of just throwing code into your main code file like this:

//your code goes here
//example:
var myEvent={};
GDT.addEvent(myEvent);

wrap the content of your file into a self-executing function like this:

(function(){
	//your code goes here.
	//example:
	var myEvent={};
	GDT.addEvent(myEvent);
})();

All that does, is move your variable definitions into a local scope so you don’t pollute the global scope.

Hope this helps.


[REL] Cheat Mod by kristof1104
#2

Ok, thanks for the feedback.


#3

Thanks for the advice Patrick!


#4

Thanks for the feedback Patrick, already removed the api files from my project but I will remove the other files as well!


[REL] Game Dev Tycoon: Platforms, Events, and Topics, OH MY
#5

I just made the changes in my mod, @PatrickKlug, you can download it at https://github.com/Turntablelover/Game-Dev-Tycoon-Mod


#6

I’m planning to change the default behavior when adding topics so that when mods try to add topics with a id that already exists, only the first topic is kept.

I think it’s good that the id’s for topics are the same as the name, after all it would not make sense to have two ‘Assassin’ topics in the game.


#7

If you haven’t already then please all take note of this:

http://forum.greenheartgames.com/t/announcement-first-beta-version-with-modding-support-is-live/8612/45?u=patrickklug

@dillion345, @jasonlamb, @Venomous, @Gold, @hi5gameslp and @DzjengisKhan


#8

Yup, i saw Daniels post, and i’ve already made my mod compatible with the new update ^^


#9

I´ve saw this too , the next update of my mod is coming at Sunday


#11

Ya, if you want to generate new names i will recommend create unique names through this latest updated Online GUID Generator script.