Game off market event?

Hey!

I’m new to modding.
Well… i started today.

My question is: Is there any event which triggers, when the game is taken off market?

Because, what I wanna do, is to read out how many times the game was sold.
I tried the following, which wouldn’t work:

var gzZuVk = function(e) {
        GameManager.company.notifications.push(new Notification("News".localize(), "Sales should alrdy be calculated here..."));
    }
    GDT.on(GDT.eventKeys.gameplay.SalesCalculated, gzZuVk);

I hope for help.

Greetings,
Rastla

Hello, and welcome!

If you look at the Mod API wiki at Github, you can see all available eventkeys and other functions. Here is the direct link for event keys: https://github.com/greenheartgames/gdt-modAPI/wiki/Gdt

Now, if you use SalesCalculated you can use its Game object to get the sales.

Hello.

Thanks for the answer.
From this site i had the SalesCalculated event, which I already tried.
Problem is, which I probably didn’t write good: I don’t get the notification, which means that the event doesn’t trigger, right?

//edit:
Also, would this be correct?

var gzZuVk = function(e) {
        GameManager.company.notifications.push(new Notification("News".localize(), "You sold " + game.UnitsSold + "units of your game" + game.title));
    }
    GDT.on(GDT.eventKeys.gameplay.SalesCalculated, gzZuVk);

I would suggest using “showModalDialog”. I dont remember how it is used, so @PatrickKlug should be able to show you. If you add a debug thing, like “console.log(game.UnitsSold)” and then check in the ingame console, that would be more useful. Also, I dont know if there is a variable called UnitsSold on a game object.

1 Like

You are telling me… that this exists??? Dude, how do I access this? I NEVER knew about this… How?

Edit the games package.json.

Set toolbar to true.

Vola!

1 Like