Old Guard Support: Naval Gunfire Support, Close Air Support, Cruise Missile Strikes, Supply Drops

So, while talking to a representative of the Old Guard, he mentioned that the government still has plenty of navy ships and assets available that are being used to support missions and defend the relatively few cities that managed to wall themselves off (though he mentioned the walled cities might just be a rumor or propaganda). I figure that for a sufficiently important mission for the Old Guard, or as a favor to an especially useful or well regarded ally or member, they might be willing to lend a hand with some fire support. This would be an interesting and useful feature, especially for annoying things like infestations of fungus or triffids that have gotten out of hand, or very large zombie hordes. In addition to very high faction approval, or mission based unlock, you would require a radio or cell phone, a laser designator or GPS device for providing coordinates, and a sufficiently close transmission tower or signal booster device for your deathmobile.

Something similar might be employed for supply drops as well, perhaps with an additional $ requirement. You really need a rocket launcher, explosives, or medical supplies right now? For the right price, or in exchange for a future favor, one of the factions might be willing to accommodate you. Might make for a good story plot or mission, when the faction that helped you out in a pinch cashes in the favor you owe, and sends you to do something particularly dangerous or illegal/unethical. You have to either grit your teeth and do what they say, or welch on them and face the consequences of pissing off a faction.

2 Likes

A huge amount of dialogue can now be written in JSON, which means you don’t need C++ coding skills to start implementing this. Opening up the missile strike ability would require some C++ support, but I can do that when the missions are approaching that pay-off.

More missions involving the Old Guard would be a great addition to the game. I’m really looking forward to seeing PRs related to this.

My programming knowledge is pretty much limited to matlab unfortunately. I could write dialogue maybe, but I have no idea how to add it in. I’ve tried tinkering with a couple JSON files in notepad previously. I was trying to mess with the power consumption of a couple bionics in the same way I would mod the raws of Dwarf Fortress, but all the text was smooshed together into gibberish, making it nearly impossible to interpret. Is there a specific application a json file should be opened in?

Also, PRs?

JSON is just a text file. You can open it with any text editor, though notepad++ on Windows does syntax highlighting.

Here’s the JSON for the first two topics in the Old Guard Rep’s talk file:

  {
    "id": "TALK_OLD_GUARD_REP",
    "type": "talk_topic",
    "dynamic_line": { "u_has_any_trait": [ "PROF_FED" ], "yes": "Marshal...", "no": "Citizen..." },
    "responses": [
      { "text": "Who are you?", "topic": "TALK_OLD_GUARD_REP_NEW" },
      { "text": "Heard anything about the outside world?", "topic": "TALK_OLD_GUARD_REP_WORLD" },
      { "text": "Is there any way I can join the 'Old Guard'?", "topic": "TALK_OLD_GUARD_REP_ASK_JOIN" },
      { "text": "Does the Old Guard need anything?", "topic": "TALK_MISSION_LIST" },
      { "text": "Well, bye.", "topic": "TALK_DONE" }
    ],
    "//": "TODO: The rep should know whether you're actually a sworn officer: Wearing the badge without the trait => Bad idea"
  },
  {
    "id": "TALK_OLD_GUARD_REP_NEW",
    "type": "talk_topic",
    "dynamic_line": "I'm the region's federal liaison.  Most people here call us the 'Old Guard' and I rather like the sound of it.  Despite how things currently appear, the federal government was not entirely destroyed.  After the outbreak I was chosen to coordinate civilian and militia efforts in support of military operations.",
    "responses": [
      { "text": "So what are you actually doing here?", "topic": "TALK_OLD_GUARD_REP_NEW_DOING" },
      { "text": "Never mind...", "topic": "TALK_OLD_GUARD_REP" }
    ]
  },

Each block between braces is a talk_topic. The NPC says the dynamic_line, and then the player can choose one of the responses. The player says the response’s text, and then the dialogue advances to the response’s topic.

It’s not super easy, but’s not very complicated either. And it’s fairly well documented in doc/NPCs.md.

Hmm. It looks mostly straightforward. I think I could replicate it if I can convince notepad to display in this way. Not sure if I have ++ or not, I think its just the default version. I can try tinkering with it some. Where do I submit my modified files?

Also, are radio communications implemented, and if so, what file are they in? I would want to write some text for requesting supply drops, air strikes, etc.

Ideally you make a pull request on github but if that’s a blocker for you, if you upload them here and ask nicely, I or someone else would probably be willing to do that for you. However, if they did, it won’t get recorded as your addition but rather theirs with you cited in the comments.

Radio comm isn’t supported yet, but get some basic dialogue going before worrying about the advanced stuff.

So I want to write a couple missions, but first I need to know if it is possible for a couple things to be coded to see if the mission will work as I intend.

Can accepting a mission be used as a spawn trigger for creatures and to change the environment, ex: generate a structure where there was none previously?

Can hostile robots or turrets have their allegiance changed to friendly (ex: hack a computer, defenses belong to you now).

Here is the first scenario I am considering that would require these:

Old Guard Rep: We have a…situation…that needs to be handled immediately if you are willing.
Player: Perhaps. What do you need?
Old Guard Rep: The information I am about to tell you is highly classified, and does not leave this room. Once you have heard it, you cannot decline this assignment. Are you sure?
Player: Yes Sir. (alternate dialog option to decline will also be available “Uh, I don’t like the sound of that, not interested”)
Old Guard Rep: In your travels, you may have noticed strange fungal infestations. Our scientists believe the organism to be extradimensional in origin, and may have invaded during the Cataclysm. One of our last remaining secure and intact labs nearby has been attempting to determine the exact nature of the organism; how it works, its effects are on humans and other lifeforms, and most importantly, how to get rid of it. Unfortunately, we have lost contact with the lab. Last transmissions reported unexpected behavior by test subjects and a containment breach. We must assume the lab has been infested. Your mission objectives are as follows:
1.) Locate the facility at these coordinates, and sterilize the surface around the lab. We can provide a napalm air strike if you have the gear available to provide target designation.
2.) Enter the facility and eliminate all hostile organisms so a decontamination team can reclaim the facility.
3.) (BONUS OBJECTIVE) Download the research data on the fungal organism from the lab mainframe and either upload it to the MELCHIOR network or bring it to me.
4.) (BONUS OBJECTIVE) Quarantine and defend any surviving personnel.

Player: Do you have any suggestions for this?
Old Guard: Do not enter the area without a gas mask or hazmat gear. If you are capable of reprogramming their IFF I would also recommend activating the facilities automated defenses to give you a hand.
Player: Thanks.

Accepting the mission will do the following:
1.) Spawn a small hut on the map somewhere with a basement entrance, surrounded by fungal tiles and fungal monsters.
2.) Spawn a lab entrance in the basement. Basement infested by fungus and monsters.
3.) Generated lab will be fungal infested on all levels. No other monster types.
4.) Generate NPC scientist survivors inside the lab.
5.) Allow temporary access to a single charge of Napalm Strike until mission is completed. (use it or lose it)
6.) Accessing a certain computer in the lab will allow its automated defenses to be triggered. Additional hacking will realign IFF to consider you friendly. NPCs will already be considered friendly by robots and turrets.

Currently, special mission start up code is handled in the C++ code. See data/json/npcs/missiondef.json, the mission “MISSION_OLD_GUARD_REP_1”. “place_bandit_cabin” is the name of a C++ function located in src/mission_start.cpp.

I have a vague plan to move more of the start functions to JSON, but it’s going to take a while.

I would recommend getting the structure for the mission going, and using the existing “create_hidden_lab_console” start, which spawns a lab under a building. You can use that for testing. When you’ve got your JSON mostly ready, I’ll work with you to write a variant of create_hidden_lab_console() with your requirements.

Hostile robots can become friendly; that’s how the control laptop works. Making it happen for all robots in a lab could be tricky for various reasons, so you may want to consider that a stretch goal.

I was thinking that the robots and turrets would not be spawned at all until you hacked the computer, and when you do so they spawn in, initially friendly. Like the bots were all offline and in floor/wall compartments until you activate them, and then they popped out.

I think I can at the very least make the mission speech text coding like you posted above. I can experiment with the other parts of the mission coding but again, my programming expertise is extremely limited. Is there a modding guide somewhere I can consult?

Find ++ here or a portable version below:
https://notepad-plus-plus.org/

https://portableapps.com/
scroll down the full list for ++ and other nifty freebies

There’s this: http://cddawiki.chezzo.com/cdda_wiki/index.php?title=Contributing which has a quick guide to setting up a github account, forking and cloning the repo, and pushing PRs in the middle. You can 100% ignore all the stuff about compiling, but it’s the same process to share JSON (game data files) and code changes, so set up a github account. Technically, you can just edit the files in your game’s data/json folder, but if you do that while in a git repo, then git will automatically keep track of your changes.

.json files are text files, and you can edit them with any text editor, thought notepad++ is recommended on Windows because it will do syntax highlighting and point out places where you missed a comma.

This is mostly about the mod manager app, but it gives the basics of setting up a new mod: http://cddawiki.chezzo.com/cdda_wiki/index.php?title=Mod_manager

There’s a fair bit of documentation in the game already: https://github.com/CleverRaven/Cataclysm-DDA/tree/master/doc

Start with the modding guide: github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/MODDING.md

then the general JSON format guide: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/JSON_INFO.md

then the specific guide to dialogue JSON: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/NPCs.md

Before you contribute, make sure you read the JSON style guide and the manual of style for descriptive text:
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/JSON_STYLE.md
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/MANUAL_OF_STYLE.md

1 Like

Thank you. I’ll tinker with it some this weekend. If I can make it work, I’ll see about making the framework for some missions that you or someone else with a programming background can fill in with the missing moving parts.

Did you ever make any progress on this? I’ve started converting more mission starts into JSON, though what you want would probably need hard coded C++ at some point anyway.

I have some notes jotted down someplace, but I haven’t gotten around to formatting the mission text into JSON format yet, since it was going to require C++ support. But that can change VERY quickly if you are getting to a point where you have a bit of time away from tinkering with the faction camps stuff.

I can definitely focus on it and try to crank something out. I know @Erk is doing some story and mission stuff too, so I’ll try and get with him and make sure we aren’t duplicating anything, or if I can leverage some of his work.

My stuff is very different. I’m going around the idea of the player building their own faction independent of the old guard. If there’s overlap it’s almost better since that makes them both viable streams to get to the same late game stuff.

My stuff wouldn’t necessarily be completely independent of that. You can have your own faction and still be allied or friendly with the Old Guard. The way I was thinking of it, even if you are a US marshal, you are just someone trusted enough by them to act as a local asset, not a true member of the Old Guard.