And when i start new game or whatever in GDT it spits the error i mentioned in the title. It seems that problem is with
var company = GameManager.company;
cuz i need this split method to shows the notification immediately in option 0. Can someone review the code and see what is wrong? I cant find the issue, everything seems to be written correctly. Thanks in advance for help.
edit there is an error in the code instead of n.addjustCash should be m.addjustCash its just a type but it does not change anything with an error.
date should be a string, not a number. turn 1/2/1 into '1/2/1'. the next thing you will notice is that when the event fires there is likely no game in development so accessing game.title will error out. Seems from the text that it doesn’t make sense to use a game title anyway but if you want to do that then you should check some of the example events, particularly the trigger methods.
haha now i have an error "Cannot read property ‘title’ of undefined so i guess this is a problem with .localize().format(game.title);
Meh i dont like to debug it like that to bad there is no compiler or sth for javascript , when i use this How To debugging method i see no useful info for me.
Ok that make sense now :)…im a lazy man and i like a compiler to thorw the stack trace :)…and this is my first time with javascript, im mostly c++ programmer
Is there any way to delay the notification? I know it is added to an array (on stack :D), but since the stack at the start of the game is empty my notifications pops immediately and it make no sense especially in “Sponsorship” case :). There might be some trick to add empty notifications or etc, but i don’t want to start with that if it doesnt work like that
you set the date yourself so that’s why it fires on ‘1/2/1’. You can either change the date to be later or define a custom trigger function on the event where you can control precisely when this event will trigger. I recommend you take a look at the event example in modAPI where I use this technique to make sure that the event only triggers when a game is in development.