Jump to content

Shared LOS


Recommended Posts

I am looking into making shared line of sight a bonus in my mod, where a Maurya player automatically gets shared line of sight with allies.  Is there a special trick to making shared LOS work?

First I tried just changing the team bonus to an aura by basically copying the shared_los tech, but that didn't work:

Spoiler

{
    "type": "player",
    "affectedPlayers": [ "Player" ],
    "modifications": [
        {
            "value": "Player/sharedLos",
            "replace": true
        }
    ],
    "auraName": "Arthashastra",
    "auraDescription": "See allies vision.  Mauryas used an extensive network of informants and spies."
}

Then I tried making it a tech that autoResearched, but that didn't work:

Spoiler

{
    "genericName": "Arthashastra",
    "description": "See allies vision.  Mauryas used an extensive network of informants and spies.",
    "autoResearch": true,
    "modifications": [
        {
            "value": "Player/sharedLos",
            "replace": true
        }
    ],
    "requirements": {"civ": "maur" }
}

I noticed that in template_player there is a specific line for Shared Los tech, so I added my new tech to it:

    <SharedLosTech>
        unlock_shared_los
        arthashastra
    </SharedLosTech>

Still no results...  No errors messages, no line of sight.

Link to comment
Share on other sites

1 hour ago, Philip the Swaggerless said:

{
    "genericName": "Arthashastra",
    "description": "See allies vision.  Mauryas used an extensive network of informants and spies.",
    "autoResearch": true,
    "modifications": [
        {
            "value": "Player/sharedLos",
            "replace": true
        }
    ],
    "requirements": {"civ": "maur" }
}

I feel like this should work. You placed this in the technologies/civbonuses folder?

I tried it locally in DE and it didn't work for me either. Possibly something where <SharedLosTech> in template_player overrules the tech.

Link to comment
Share on other sites

3 hours ago, Philip the Swaggerless said:

    <SharedLosTech>
        unlock_shared_los
        arthashastra
    </SharedLosTech>

Perhaps:

 

    <SharedLosTech tokens="">
        unlock_shared_los
        arthashastra
    </SharedLosTech>

lol dunno. @Freagarach:) 

My guess is there can be only 1 tech able to toggle SharedLos.

Edited by wowgetoffyourcellphone
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, wowgetoffyourcellphone said:

there can be only 1

The relevant excerpt from Player.js.

Player.prototype.UpdateSharedLos = function()
{
        let cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
        let cmpTechnologyManager = Engine.QueryInterface(this.entity, IID_TechnologyManager);
        if (!cmpRangeManager || !cmpTechnologyManager)
                return;

        if (!cmpTechnologyManager.IsTechnologyResearched(this.template.SharedLosTech))
        {
                cmpRangeManager.SetSharedLos(this.playerID, [this.playerID]);
                return;
        }

        cmpRangeManager.SetSharedLos(this.playerID, this.GetMutualAllies());
};

So that "modification" isn't used. xD
One day, I might have time to fix this (it was on my list already). If anyone else wants to: make the modification used.

  • Thanks 2
Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...