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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...