[RELEASE] Jaguar Company 2.5r29

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

Moderators: winston, another_commander

Diogenese Senna
Dangerous
Dangerous
Posts: 106
Joined: Fri Jan 31, 2014 1:08 am

Re: [RELEASE] Jaguar Company 2.4

Post by Diogenese Senna »

How about getting invited to join Jaguar Company ...
Location - Galaxy 5 : Python Explorer : Elite
'Death by Wife is fast becoming a real world OXP mission'
User avatar
Tricky
---- E L I T E ----
---- E L I T E ----
Posts: 821
Joined: Sun May 13, 2012 11:12 pm
Location: Bradford, UK. (Anarchic)

Re: [RELEASE] Jaguar Company 2.4

Post by Tricky »

Diogenese Senna wrote:
How about getting invited to join Jaguar Company ...
Well... you kind of do get invited, just not told about it. 8)

(Just under 75 more updated threads to read now)
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: [RELEASE] Jaguar Company 2.5.29

Post by Norby »

Jaguar_Company_2.5.29.oxz is in the wiki from now due to Tricky's server is down.
Duggan
---- E L I T E ----
---- E L I T E ----
Posts: 496
Joined: Sat Dec 31, 2011 2:58 pm

Re: [RELEASE] Jaguar Company 2.5r29

Post by Duggan »

Still no markets at JC bases (just to let you know) :)
Flying Python Class Cruiser, Chapter & Verse IV
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 462
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Jaguar Company 2.5r29

Post by Milo »

If anyone is maintaining this, there are some updates needed for Oolite 1.82+.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: [RELEASE] Jaguar Company 2.5r29

Post by dybal »

I spent a time as a fugitive, reduced my bounty by helping police and finally paid a small fine to get back to clean.

Since I was in an Anarchy system, there was a Jaguar Company base and JC ships around, and while I was a fugitive they attacked me on sight... being a firm believer in the right for self-defense, I usually fought back.

Now, I'm clean, but JC ships still attack me on sight.... I looked into the code:

a) if the player hits a JC ship more than 5 times, even if it's attacking the player first, the player is flagged an attacker and the palyer ship's ID stored;
b) if the player helps JC enough times, the player ship ID is removed from the attackers list, but the attacker flag isn't reset;
c) the only way to reset the attacker flag is by jumping to a new galaxy.

Now (a) is not something I like, since it doesn't take into account who started the fight, but I can live with it, but not resetting the attacker flag in (b) seems like a bug to me
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 462
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Jaguar Company 2.5r29

Post by Milo »

I agree, (a) is intended behavior, (b) seems like a bug. Although, if you actually killed some JC ships, they might very well hold a grudge even if you stop attacking them and starting helping, I think they should stop attacking you at that point as long as your legal status is clean.

phkb and I are collaborating on an update for this OXP so we can look at this too. What I would do here is keep the attacker flag (so they remember their grudge, and limit how "friendly" they can become with you) but have them not attack you if your legal status is clean.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: [RELEASE] Jaguar Company 2.5r29

Post by dybal »

Milo wrote: Fri Jul 10, 2020 2:30 pm
I agree, (a) is intended behavior, (b) seems like a bug. Although, if you actually killed some JC ships, they might very well hold a grudge even if you stop attacking them and starting helping, I think they should stop attacking you at that point as long as your legal status is clean.

phkb and I are collaborating on an update for this OXP so we can look at this too. What I would do here is keep the attacker flag (so they remember their grudge, and limit how "friendly" they can become with you) but have them not attack you if your legal status is clean.
The attacker flag is important because we can't rely solely on the attacker list stored: it uses the ship's personality to identify the attacker, and the player can change that with Ship Respray, or the whole ship with HyperSpaceHangar.

I don't know if checking for clean legal status would make any difference: I think JC ships would still attack the player on sight if the player is not clean, even if the attacker flag is reset.

This is my fix (untested):

Code: Select all

diff -Nuwr jaguarCompany-2.5.29/Scripts/jaguar_company.js jaguarCompany-2.5.30/Scripts/jaguar_company.js
--- jaguarCompany-2.5.29/Scripts/jaguar_company.js	2020-07-10 10:08:43.335754113 -0300
+++ jaguarCompany-2.5.30/Scripts/jaguar_company.js	2020-07-10 10:27:04.514610470 -0300
@@ -29,7 +29,7 @@
     this.copyright = "© 2012-2013 Richard Thomas Harrison (Tricky)";
     this.license = "CC BY-NC-SA 3.0";
     this.description = "Script to initialise the Jaguar Company.";
-    this.version = "2.5";
+    this.version = "2.5.30";
 
     /* Private variables. */
     var p_main = {},
@@ -375,6 +375,11 @@
             missionVariables.jaguar_company = JSON.stringify(this.$playerVar);
         }
 
+        if (this.$playerVar.attacker === true && this.$playerVar.reputation[galaxyNumber] >= this.$reputationHelper) {
+            // there was a bug in version <= 2.5.29 where the player ship was removed from the attackers list but the attacker flag wasn't cleared
+            this.$playerVar.attacker = false;
+        }
+
         /* Setup the private main variable + some public variables. */
         this.$setUp();
         /* Remove join navy variable. */

diff -Nuwr jaguarCompany-2.5.29/Scripts/jaguar_company_ships.js jaguarCompany-2.5.30/Scripts/jaguar_company_ships.js
--- jaguarCompany-2.5.29/Scripts/jaguar_company_ships.js	2020-07-10 10:08:43.311754486 -0300
+++ jaguarCompany-2.5.30/Scripts/jaguar_company_ships.js	2020-07-10 10:16:41.256310021 -0300
@@ -1255,6 +1255,7 @@
                 if (p_ships.logging && p_ships.logExtra) {
                     logMsg += ", removing (player turned from the dark side)";
                 }
+                p_ships.mainScript.$playerVar.attacker = false;
 
                 /* Remove the player from the real attackers array. */
                 this.$removeAttacker(attackerKey);
I have some exceptions from Jaguar Company OXP in my Latest.log:

Code: Select all

12:02:17.602 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (jaguar_company_patrol.js 1.10): TypeError: this.$friendList is undefined
12:02:17.602 [script.javaScript.exception.unexpectedType]:       AddOns/jaguarCompany-2.5.30.oxz/Scripts/jaguar_company_ships.js, line 553.
$friendList is defined in a timer 0.5s after startUp in jaguar_company_ships.js with a bunch of other variables... I think it could safely be defined at startUp
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 462
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Jaguar Company 2.5r29

Post by Milo »

I think the intended/desired behavior is to remember that the player was an attacker (keep the flag), but not attack when the player is clean. Your fix removes the flag, which I think is incorrect. To put it another way, JC shouldn't be attacking clean legal status even if attacker flag is true. Except, maybe, in interstellar space, where they might well decide to take revenge...
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: [RELEASE] Jaguar Company 2.5r29

Post by dybal »

True, but what will you use the attacker flag for when the player is clean? If it doesn't change anything after the player is clean it should be reset...

Perhaps it could add to the reputation thresholds? Help threshold is 5 if not-attacker, 2*5 if attacker? And perhaps store the timestamp of last attack and clear the attacker flag after some time from the last attack and a certain reputation threshold being surpassed and bounty less than another threshold (low offender, bounty < 5?, or whatever the cops use)
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 462
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Jaguar Company 2.5r29

Post by Milo »

I would use attacker to override the "don't attack if clean" rule when interstellar without witnesses (no non-JC/non-Thargoid ships). It represents some JC pilots holding a grudge and wanting revenge ... when they think they can get away with it. They might even shoot you along with the Thargoids! It already clears when you jump galaxy so I don't think it needs to expire otherwise. I would also change the condition to gain the attacker flag from 5 hits to actually killing a JC ship or a JC escape pod (including by collision). Hitting them only should subtract from your JC reputation.

After looking into the code, I am less convinced that the current behavior is a bug. It seems very deliberate. You are given warnings when shooting at JC ships, and you are designated as an attacker if you ignore the warnings and hit them repeatedly or if you kill one of them. Maybe the attacker status should be cleared if you gain enough reputation with them, but if you kill one, JC reputation should be set to -1000 so it's quite difficult to earn forgiveness. I don't think JC would care nearly as much about your current legal status as they do about your past interactions with them.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5365
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 »

Has this been updated to use GNN yet?

Or is it still on Snoopers (and, much more importantly, the wiki page is still accurate!)?
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: 4830
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: Fri Jul 09, 2021 8:18 pm
Has this been updated to use GNN yet?
I have a version that has been converted, but I have a bit more work to do on it to get it as up-to-date as I'd like.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5365
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 »

Tricky wrote: Thu Feb 20, 2014 5:25 am
Well... you kind of do get invited
Got these error messages when I ran it:

Code: Select all

10:53:14.281 [oxp-standards.deprecated] OOStandardsInternal (OODebugStandards.m:92): Old style sub-entity declarations are deprecated in jaguar_company_template
10:53:14.281 [oxp-standards.deprecated] OOStandardsInternal (OODebugStandards.m:92): Old style sub-entity declarations are deprecated in jaguar_company_template
10:53:14.281 [oxp-standards.deprecated] OOStandardsInternal (OODebugStandards.m:92): Old style sub-entity declarations are deprecated in jaguar_company_template
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: 5365
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: Fri Jul 09, 2021 9:13 pm
Cholmondely wrote: Fri Jul 09, 2021 8:18 pm
Has this been updated to use GNN yet?
I have a version that has been converted, but I have a bit more work to do on it to get it as up-to-date as I'd like.
Any chance of seeing the updated script for GNN?

I can then post it on the wiki as an example of how to update Snoopers to GNN.

jaguar_company.js (lines 2847 - 2923 at the end of the file)

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) {
            /* 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;
        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)());
I can't find anything which looks like text for the Snoopers newsflashes...
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