[QUES] Please Help Me w/ Modding

So, I am making a mod myself, and upon testing… I keep getting “uncaught syntax error” I have over the mod over and over, and cannot see anything off. Am I just blind, or is something bugged in my copy of GDT?

Here is the code:

//Platforms Grapple

var icon = ‘./mods/MOAR_Computers/source/img/delicious.png’;
GDT.addPlatform({
    id : ‘CSHG1’,
    name : ‘Grapple Delicious’,
    company : ‘Grapple’,
    startAmount : 0.3,
    unitsSold : 0.5,
    licencePrize : 100000,
    published : ‘1/1/1’,
    platformRetireDate : ‘18/6/3’,
    developmentCosts : 35000,
    genreWeightings : [0.7, 0.8, 1, 1, 1, 0.9],
    audienceWeightings : [0.5, 0.8, 1],
    techLevel : 3,
    iconUri : icon,
                });
                
var icon = ‘./mods/MOAR_Computers/source/img/deliciousosv.png’;
GDT.addPlatform({
    id : ‘CSHG2’,
    name : ‘Delicious OSV’,
    company : ‘Grapple’,
    startAmount : 0.5,
    unitsSold : 0.75,
    licencePrize : 300000,
    published : ‘17/6/2’,
    platformRetireDate : ‘26/6/2’,
    developmentCosts : 50000,
    genreWeightings : [0.7, 0.8, 1, 1, 1, 0.9],
    audienceWeightings : [0.5, 0.8, 1],
    techLevel : 6,
    iconUri : icon,
    events : [{
            id : ‘SG1’,
            date : ‘17/1/1’,
            getNotification : function (company) {
                return new Notification({
                    header : “Industry News”.localize(),
                    text : “Along with it’s fifth os, dubbed OSV, Grapple has released a new generation of hardware. Sadly, much as the original, it is still much harder to develop for than the PC, However, it sports a very powerful processor, and crashes much less. We will see how it fares against the PC. It will be released later this year.” localize().format(General.getETADescription(‘17/1/1’, ‘17/1/1’)),
                    image : icon
                });
            }
        }
    ]
});

var icon = ‘./mods/MOAR_Computers/source/img/deliciousosx.png’;
GDT.addPlatform({
    id : ‘CSHG3’,
    name : ‘Delicious OSX’,
    company : ‘Grapple’,
    startAmount : 0.4,
    unitsSold : 0.6,
    licencePrize : 500000,
    published : ‘25/6/2’,
    platformRetireDate : ‘99999999/6/2’,
    developmentCosts : 75000,
    genreWeightings : [0.7, 0.8, 1, 1, 1, 0.9],
    audienceWeightings : [0.5, 0.8, 1],
    techLevel : 9,
    iconUri : icon,
    events : [{
            id : ‘SG2’,
            date : ‘25/1/1’,
            getNotification : function (company) {
                return new Notification({
                    header : “Industry News”.localize(),
                    text : “Along with it’s tenth os, dubbed OSX, Grapple has released a new generation of hardware. Sadly, much as the original and osv, it is still much harder to develop for than the PC, However, it sports a very powerful processor, and crashes much less. We will see how it fares against the PC. It will be released later this year.”.localize().format(General.getETADescription(‘25/1/1’, ‘25/1/1’)),
                    image : icon
                });
            }
        }
    ]
});

//Platforms PC

var icon = ‘./mods/MOAR_Computers/source/img/gamingpc.png’;
GDT.addPlatform({
    id : ‘CSHG4’,
    name : ‘Gaming PC’,
    company : ‘Various Hardware Makers’,
    startAmount : 0.2,
    unitsSold : 0.4,
    licencePrize : 1000000,
    published : ‘20/12/2’,
    platformRetireDate : ‘99999999/6/2’,
    developmentCosts : 20000,
    genreWeightings : [1, 1, 1, 1, 1, 0.1],
    audienceWeightings : [0.1, 1, 1],
    techLevel : 12,
    iconUri : icon,
    events : [{
            id : ‘SG3’,
            date : ‘20/6/1’,
            getNotification : function (company) {
                return new Notification({
                    header : “Industry News”.localize(),
                    text : “It looks like there is a new breed of PCs on the horizon. Made specifically for gaming, these are the most powerful (And Expensive) Platforms on the market. I wonder how they will fare against the Delicious and Standerd PCs? They will be released later this year at Christmastime.”.localize().format(General.getETADescription(‘20/6/1’, ‘20/6/1’)),
                    image : icon
                });
            }
        }
    ]
});

var icon = ‘./mods/MOAR_Computers/source/img/budgetpc.png’;
GDT.addPlatform({
    id : ‘CSHG5’,
    name : ‘Bargain PC’,
    company : ‘Various Hardware Makers’,
    startAmount : 0.5,
    unitsSold : 0.8,
    licencePrize : 10000,
    published : ‘20/12/3’,
    platformRetireDate : ‘99999999/6/2’,
    developmentCosts : 1000,
    genreWeightings : [0.3, 0.8, 0.8, 0.3, 0.3, 1],
    audienceWeightings : [1, 1, 0.5],
    techLevel : 4,
    iconUri : icon,
    events : [{
            id : ‘SG4’,
            date : ‘20/6/2’,
            getNotification : function (company) {
                return new Notification({
                    header : “Industry News”.localize(),
                    text : “It seems that a bunch of cheap PCs have a very similar launch window to gaming PCs. These are very underpowered, but are extremely cheap, and on top of that, being laptops, portable.”.localize().format(General.getETADescription(‘20/6/2’, ‘20/6/2’)),
                    image : icon
                });
            }
        }
    ]
});

(Sorry if it is something obvious, I am new to this whole coding thing.)

Am I the only one who thinks VENOMOUS when seeing a red avatar? :stuck_out_tongue_winking_eye:

What is the error?
And You should check the ETADesc.
it shouldn’t be for example [quote=“lilshatespug217, post:1, topic:11860”]
.localize().format(General.getETADescription(‘20/6/2’, '20/6/2’)),
[/quote]

Error
Uncaught error. Please report this to support@greenheartgames.com:
Uncaught SyntaxError: Unexpected identifier
(file:///Users/[My Name]/Library/Application%20Support/Steam/SteamApps/common/Game%20Dev%20Tycoon/Game%20Dev%20Tycoon.app/Contents/Resources/app.nw/mods/MOAR_Computers/PCScripts.js:41)

Please restart the game.

Then something is wrong with 41 row… which one is it?

And what should it be?
(Again, sorry for the noob question, as I am, well, A noob.)

Do You use Notepad++ or other?

text : "Along with it’s fifth os, dubbed OSV, Grapple has released a
new generation of hardware. Sadly, much as the original, it is still
much harder to develop for than the PC, However, it sports a very
powerful processor, and crashes much less. We will see how it fares
against the PC. It will be released later this year."
localize().format(General.getETADescription(‘17/1/1’, ‘17/1/1’)),

Textwrangler. Don’t think notepad works on mac >_<

Yeah, I think that are those wrong are wrong dates [quote=“lilshatespug217, post:1, topic:11860”]
17/1/1’, ‘17/1/1’
[/quote]

I must have missed something… How are those dates wrong? That’s when I set the event to occur?

Look at the example of platform on ModAPI’s wiki:

published : ‘1/3/4’,
events : [{
id : ‘10537DA1-58F1-4F23-8854-F1E2621933BF’,
date : ‘1/2/1’,

.getETADescription(‘1/2/1’, ‘1/3/4’)),

See also that: https://github.com/greenheartgames/gdt-modAPI/wiki/Date

And “Advanced uses (Dynamically referring to a time span in stories)”

I am still confused. Are thsoe dates mandatory, or can I just remove them?

I haven’t tried to remove them…
Idk.

The error the game is giving you is related to the syntax you have used, I have fixed these issues using this tool:
http://www.javascriptlint.com/online_lint.php

Your code:
http://pastebin.com/zKDWcCp0

1 Like

UltimateModEditor can be your mod maker

Thank you!

1 Like