Page 4 of 5

Re: [RELEASE] Jaguar Company 2.4

Posted: Fri Feb 07, 2014 4:20 am
by Diogenese Senna
How about getting invited to join Jaguar Company ...

Re: [RELEASE] Jaguar Company 2.4

Posted: Thu Feb 20, 2014 5:25 am
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)

Re: [RELEASE] Jaguar Company 2.5.29

Posted: Sun May 24, 2015 9:05 am
by Norby
Jaguar_Company_2.5.29.oxz is in the wiki from now due to Tricky's server is down.

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Tue Jun 30, 2015 9:02 pm
by Duggan
Still no markets at JC bases (just to let you know) :)

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Wed Jun 17, 2020 1:29 am
by Milo
If anyone is maintaining this, there are some updates needed for Oolite 1.82+.

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Fri Jul 10, 2020 1:51 pm
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

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Fri Jul 10, 2020 2:30 pm
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.

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Fri Jul 10, 2020 4:16 pm
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

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Fri Jul 10, 2020 4:38 pm
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...

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Fri Jul 10, 2020 7:21 pm
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)

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Fri Jul 10, 2020 7:30 pm
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.

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Fri Jul 09, 2021 8:18 pm
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!)?

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Fri Jul 09, 2021 9:13 pm
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.

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Fri Jan 20, 2023 10:51 am
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

Re: [RELEASE] Jaguar Company 2.5r29

Posted: Mon Sep 04, 2023 9:28 am
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...