thepeacockproject / Peacock

The Peacock Project is a HITMAN™ World of Assassination trilogy server replacement.
https://thepeacockproject.org
GNU Affero General Public License v3.0
367 stars 57 forks source link

Proper killing conditions absent from displayed objective tips in certain peacock escalations #353

Closed suanjiansalt closed 8 months ago

suanjiansalt commented 9 months ago

Describe the bug I've found that some peacock escalations have incorrect in-mission display texts that lack of killing conditions. For example:

I wanted to fix it myself, but struggled to find a way to perfect it. Mainly I don't even know exactly where to change.

suanjiansalt commented 9 months ago

So finally I decide to dig into it...

The "BriefingName"&"BriefingText" lines are for sentences in planning section, and the "HUDTemplate" is for in-mission display sentence. The "ObjectiveType" determines icon before the text. (So what is "iconTyoe" used for?) All I need to do is replace "$loc localizations", right?

For another thing: How could I determine the NPC's name by their "Id"s?

If I know all above surely I would be able to start.

grappigegovert commented 9 months ago

Only use iconType for the icon, ObjectiveType changes the way it's displayed in the planning page (see this function: https://github.com/thepeacockproject/Peacock/blob/v7/components/contracts/dataGen.ts#L354) You can use $($repository npc-repository-id-here).Name to get an NPC's name, often used like this:

"HUDTemplate": {
    "display": {
        "$loc": {
            "data": "$($repository f03a4c5a-767f-4315-a160-baef4bd1def0).Name",
            "key": "UI_CONTRACT_GENERAL_OBJ_KILL"
        }
    }
}

This uses the localization key "UI_CONTRACT_GENERAL_OBJ_KILL", which in english is "Kill {0}" (i think), and replaces the {0} with the NPC's name.

suanjiansalt commented 9 months ago

You can use $($repository npc-repository-id-here).Name to get an NPC's name, often used like this:

"HUDTemplate": {
  "display": {
      "$loc": {
          "data": "$($repository f03a4c5a-767f-4315-a160-baef4bd1def0).Name",
          "key": "UI_CONTRACT_GENERAL_OBJ_KILL"
      }
  }
}

This uses the localization key "UI_CONTRACT_GENERAL_OBJ_KILL", which in english is "Kill {0}" (i think), and replaces the {0} with the NPC's name.

Thank you, but I didn't mean that... I meant how to get NPCs' names with their "Id"s listed in the contractdata folder, like, in this code block:

"_comment": "security2",
"Type": "statemachine",
"Id": "bca06014-1580-4837-916a-95bc9f64d76a",
"BriefingText": {
       "$loc": {
              "key": "UI_CONTRACT_GENERAL_OBJ_KILL",
              "data": "$($repository 1639e08a-4150-4a92-a4b3-bcec99b336fe).Name"
       }
},
"HUDTemplate": {
        "display": {
               "$loc": {
                      "key": "UI_CONTRACT_GENERAL_OBJ_KILL",
                       "data": "$($repository 1639e08a-4150-4a92-a4b3-bcec99b336fe).Name"
               }
        }
},

How to transmit bca06014-1580-4837-916a-95bc9f64d76a into a name out of game and out of server (for example using a tool like RPKG Tool)? And why is "Id" different from id in "data": "$($repository npc-repository-id.Name)?

And of course I'm not aware of ways to turn NPC name to repository Id neither... 😭

grappigegovert commented 9 months ago

The first Id in that block, bca06014-1580-4837-916a-95bc9f64d76a, is the Id of the objective, and is unrelated to the target NPC. The objective Id is just a random Id that needs to be different for each objective, but doesn't affect anything else.

The id 1639e08a-4150-4a92-a4b3-bcec99b336fe is the id of the target NPC and you can look those up in the repository, for example with RPKG Tool in the 'REPO' tab. image