[QUES] "Cannot read property 'experience' of null"

I’m new to javascript, and i have no idea what this means. I was trying to make a mod, but after i added research items, it started giving me this error when i loaded a savegame, even a new one.
“Uncaught TypeError: Cannot read property ‘experience’ of null”.
Here is my source.js: http://pastie.org/8568857

1 Like

Looks like your not the only one.

You get this error because in one of your research items you use
return LevelCalculator.getMissionLevel('Graphics') > 7

But Graphics isn’t a missionLevel. You should use Graphic instead.

2 Likes

Thanks for helping @DzjengisKhan :cake:

It works, thanks!

Was there anything I missed Jengis?

var CryTek = {};
(function () {

/*  */

/* Platforms */

/* CryTek */
CryTek.addPlatform = function () {
	var icon = './mods/CryTekMod/Source/img/Arktose.png';
	GDT.addPlatform(
		{
			id: 'CryTek Arktose',
			name: 'CryTek Arktose',
			company: 'CryTek Technologies',
			startAmount: 0.358,
			unitsSold: 25.358,
			licencePrize: 5500000,
			published: '1/3/35',
			platformRetireDate: '4/6/44',
			developmentCosts: 500000,
			genreWeightings: [1, 1, 1, 1, 1, 1],
			audienceWeightings: [1, 1, 1],
			techLevel: 8,
			iconUri: icon,
			events: [
				{
					id: '10537DA1-58F1-4F23-8854-F1E2621933BF',
					date: '1/2/34',
					getNotification: function (company) {
						return new Notification({
							header: "Industry News".localize(),
							text: "CryTek Technologies, known for there popular hardware, has announced there own Console. Very few details have been released. We will see how this contends with Vonny and Micronoft platforms. {0}.".localize().format(General.getETADescription('1/2/34', '1/3/35')),
							image: icon
						});
					}
				}
			]
		});
};

@Tyler_Moore Euhm… in the date and getETADescription you have 1/2/34 and 1/3/35 But you’re using it wrong. I assume your want the event to occur in year 35. But you need to put it in a different order: 34/2/1 and 35/2/1.

You are using week/month/year, but it should be year/month/week (little note for next time ;))

There were some syntax errors in your code, fixed it here:
http://pastie.org/private/tefqyrf7bnd3jrealbr1q

Remember you file needs to start and end like this:

var CryTek = {};
(function () {

//code here

})();

Plus what Khan said :smile:

1 Like

@SirEverard, LOL didn’t even see that haha

Lol I didn’t see what you saw either :stuck_out_tongue:

Oh thanks lol

You’re welcome, but don’t forget about what @SirEverard said. You have to make sure your ‘layout’ is right. ^^