[RELEASE] Jaguar Company 2.5r29

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4643
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: [RELEASE] Jaguar Company 2.5r29

Post by phkb »

The changes were fairly small, because there weren't many format changes between Snoopers and GNN:

Code: Select all

    /* NAME
     *   $sendNewsToSnoopers
     *
     * FUNCTION
     *   Send news to Snoopers (if available).
     *
     * INPUTS
     *   message - news to show
     *   agency - agency to use (optional)
     */
    this.$sendNewsToSnoopers = function (message, agency) {
        var news = {},
        result,
        index;

        if (!worldScripts.snoopers && !worldScripts.GNN) {
            /* Snoopers not installed. */
            return;
        }

        if (!agency || typeof agency !== "number") {
            /* Random agency. [1, 2 or 3] */
            agency = Math.floor(Math.random() * 3.0) + 1;
        }

        news.ID = this.name;
        news.Message = message;
        news.Agency = agency;
        if (worldScripts.GNN) {
        	result = worldScripts.GNN.insertNews(news);
        } else {
        	result = worldScripts.snoopers.insertNews(news);
        }
        index = result + 5;

        if (result < 0) {
            /* Save for later. Snoopers only allows one news item at a time. */
            this.$playerVar.newsForSnoopers.push(news);

            if (this.$logging && this.$logExtra) {
                log(this.name, "$sendNewsToSnoopers::Saving news for later.\n" +
                    "* ID: '" + this.name + "'\n" +
                    "* Message: '" + message + "'\n" +
                    "* Agency: " + agency + "\n" +
                    "* result: " + result + (result >= -5 ? ") " + p_const.snoopersErrorCodes[index] : ""));
            }
        } else if (result > 0) {
            /* Problem. */
            log(this.name, "$sendNewsToSnoopers::Problem with news.\n" +
                "* ID: '" + this.name + "'\n" +
                "* Message: '" + message + "'\n" +
                "* Agency: " + agency + "\n" +
                "* result: " + result + (result <= 30 ? ") " + p_const.snoopersErrorCodes[index] : ""));
        } else {
            /* News inserted. */
            if (this.$logging && this.$logExtra) {
                log(this.name, "$sendNewsToSnoopers::News inserted.\n" +
                    "* ID: '" + this.name + "'\n" +
                    "* Message: '" + message + "'\n" +
                    "* Agency: " + agency + "\n" +
                    "* result: " + result + ") " + p_const.snoopersErrorCodes[index]);
            }
        }
    };

    /* NAME
     *   newsDisplayed
     *
     * FUNCTION
     *   Called by Snoopers when the news item has been displayed.
     *   Check for any more news available and send it.
     */
    this.newsDisplayed = function () {
        var news = this.$playerVar.newsForSnoopers.shift();

        if (news) {
            /* More news available. Send it to Snoopers. */
            this.$sendNewsToSnoopers(news.Message, news.Agency);
        }
    };
}.bind(this)());
The text for the news flashes is in descriptions.plist: keys are "jaguar_company_help_news", "jaguar_company_help_news_quote", "jaguar_company_rescue_news", "jaguar_company_rescue_multiple_news", and "jaguar_company_rescue_news_quote".

I don't know if it helps, but here's the version I was working on (I think with dybal if memory serves): Jaguar_Company_2.6.0.zip
User avatar
Cholmondely
Archivist
Archivist
Posts: 4997
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [RELEASE] Jaguar Company 2.5r29

Post by Cholmondely »

phkb wrote: Mon Sep 04, 2023 6:10 pm
The changes were fairly small, because there weren't many format changes between Snoopers and GNN:

Code: Select all

    /* NAME
     *   $sendNewsToSnoopers
     *
     * FUNCTION
     *   Send news to Snoopers (if available).
     *
     * INPUTS
     *   message - news to show
     *   agency - agency to use (optional)
     */
    this.$sendNewsToSnoopers = function (message, agency) {
        var news = {},
        result,
        index;

        if (!worldScripts.snoopers && !worldScripts.GNN) {
            /* Snoopers not installed. */
            return;
        }

        if (!agency || typeof agency !== "number") {
            /* Random agency. [1, 2 or 3] */
            agency = Math.floor(Math.random() * 3.0) + 1;
        }

        news.ID = this.name;
        news.Message = message;
        news.Agency = agency;
        if (worldScripts.GNN) {
        	result = worldScripts.GNN.insertNews(news);
        } else {
        	result = worldScripts.snoopers.insertNews(news);
        }
        index = result + 5;

        if (result < 0) {
            /* Save for later. Snoopers only allows one news item at a time. */
            this.$playerVar.newsForSnoopers.push(news);

            if (this.$logging && this.$logExtra) {
                log(this.name, "$sendNewsToSnoopers::Saving news for later.\n" +
                    "* ID: '" + this.name + "'\n" +
                    "* Message: '" + message + "'\n" +
                    "* Agency: " + agency + "\n" +
                    "* result: " + result + (result >= -5 ? ") " + p_const.snoopersErrorCodes[index] : ""));
            }
        } else if (result > 0) {
            /* Problem. */
            log(this.name, "$sendNewsToSnoopers::Problem with news.\n" +
                "* ID: '" + this.name + "'\n" +
                "* Message: '" + message + "'\n" +
                "* Agency: " + agency + "\n" +
                "* result: " + result + (result <= 30 ? ") " + p_const.snoopersErrorCodes[index] : ""));
        } else {
            /* News inserted. */
            if (this.$logging && this.$logExtra) {
                log(this.name, "$sendNewsToSnoopers::News inserted.\n" +
                    "* ID: '" + this.name + "'\n" +
                    "* Message: '" + message + "'\n" +
                    "* Agency: " + agency + "\n" +
                    "* result: " + result + ") " + p_const.snoopersErrorCodes[index]);
            }
        }
    };

    /* NAME
     *   newsDisplayed
     *
     * FUNCTION
     *   Called by Snoopers when the news item has been displayed.
     *   Check for any more news available and send it.
     */
    this.newsDisplayed = function () {
        var news = this.$playerVar.newsForSnoopers.shift();

        if (news) {
            /* More news available. Send it to Snoopers. */
            this.$sendNewsToSnoopers(news.Message, news.Agency);
        }
    };
}.bind(this)());
The text for the news flashes is in descriptions.plist: keys are "jaguar_company_help_news", "jaguar_company_help_news_quote", "jaguar_company_rescue_news", "jaguar_company_rescue_multiple_news", and "jaguar_company_rescue_news_quote".

I don't know if it helps, but here's the version I was working on (I think with dybal if memory serves): Jaguar_Company_2.6.0.zip
Thanks for both this and the link.

You were working on this with Milo:
Milo wrote: Fri Jul 10, 2020 2:30 pm
phkb and I are collaborating on an update for this OXP ...
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4643
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: [RELEASE] Jaguar Company 2.5r29

Post by phkb »

Ah! Memory error. Must need some upgrades.
User avatar
Cholmondely
Archivist
Archivist
Posts: 4997
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [RELEASE] Jaguar Company 2.5r29

Post by Cholmondely »

phkb wrote: Mon Sep 04, 2023 8:38 pm
Ah! Memory error. Must need some upgrades.
Added at https://wiki.alioth.net/index.php/Snoop ... ers_to_GNN

Your changes are in red at the bottom.

Thank you!!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cholmondely
Archivist
Archivist
Posts: 4997
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [RELEASE] Jaguar Company 2.5r29

Post by Cholmondely »

phkb wrote: Mon Sep 04, 2023 8:38 pm
Ah!
Sorry! Me again!!

Does Jaguar Company add in bases to every single anarchy/feudal/multi-gov? Or just some of them?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4643
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: [RELEASE] Jaguar Company 2.5r29

Post by phkb »

Cholmondely wrote: Tue Sep 05, 2023 11:58 am
Does Jaguar Company add in bases to every single anarchy/feudal/multi-gov? Or just some of them?
Some of them. Based on what I can see in the code, there's a 37.5% chance in an anarchy, a 25% chance in a feudal, and a 12.5% chance in a multi-gov. But I think the randomness of the choice has been set so that it will be the same systems in each galaxy, although I haven't confirmed that.
User avatar
Cholmondely
Archivist
Archivist
Posts: 4997
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [RELEASE] Jaguar Company 2.5r29

Post by Cholmondely »

phkb wrote: Tue Sep 05, 2023 9:14 pm
Cholmondely wrote: Tue Sep 05, 2023 11:58 am
Does Jaguar Company add in bases to every single anarchy/feudal/multi-gov? Or just some of them?
Some of them. Based on what I can see in the code, there's a 37.5% chance in an anarchy, a 25% chance in a feudal, and a 12.5% chance in a multi-gov. But I think the randomness of the choice has been set so that it will be the same systems in each galaxy, although I haven't confirmed that.
Thanks - and same systems makes sense if true...
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Post Reply