Dragon Age: Inquisition Modding Tools

All about modding tools for Dragon Age: Inquisition
It is currently Thu Jun 29, 2017 1:52 am

All times are UTC

Welcome to the Dragon Age Modding tools forum

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Set Plot Flags-an Easy Way
PostPosted: Wed Feb 15, 2017 1:02 am 

Joined: Mon Feb 09, 2015 9:55 pm
Posts: 96
Has thanked: 58 time
Have thanks: 130 time
How to Add and Set Plot Flags in your Game (with a mod)

I kept meaning to post this tutorial here. I hope it's not horribly out of date; it was written in November 2015. It was on my old website that crashed. Thanks so much to theskymoves for helping me find it here
http://web.archive.org/web/201610261239 ... #getthemod
Any updates will be added to this daitools post.

this tutorial is meant to be noobish-friendly. Advanced modders can skip the boring stuff :) There are 3 steps: 1. identify the correct flag from conversation files, 2. add the flag to an object, 3. add the object to a store.
You’ll Need:

The ModMaker by dawnlessSky (get it here, be sure to get dawnlessSky’s DAI Tools SuiteLoader as well if you don't have it)

a hex-editor, such as HxD (get HxD here https://mh-nexus.de/en/hxd/) It is free, and easy to use.)


I’m none too confident about bit-shifting in a save game (for that, see this helpful tutorial by FanDidlyTastic tutorial-softening-leliana-in-your-save-game-t1212.html), but I set plot flags all the time, by adding the plot flags onto equip-able items. In-game, the plot flags are activated as soon as the item enters my inventory, and I can set, or reset, the flag again, in-game, whenever I need to. Let’s say I set an “Amulet of Constitution” to reset the plot flag that tells the game I’ve already done Josie’s cache perk. I can sell myself the modded amulet at a store; as soon as I buy it, the flag is reset. Now, I’ll go and do the perk again. When I get out of the War Table room, I can access the Inventory menu and equip the amulet on Cassandra. Now, the amulet is no longer in my inventory. So, whenever I’m ready to do the perk again, I remove the amulet from Cassandra. The second it re-entered my inventory, the plot flag did its job and the perk flag was reset. Obviously, this is not a real solution for the perks, since you can only set one flag per item; this is where the Plot Flag Editor shines. But, when you need to ADD in a flag that you don’t already have, the Plot Flag Editor can’t do it. Why? If there is a cardinal rule of modding DAI it’s this: We can’t change the file size. This fact lurks behind nearly all of the complications with modding this game.
EverestMan, following Ricco19, came up with a brilliant way to substitute one plot flag for another in a save game via bit-shifting.
The way I do it is to make a mod that "tricks" the game into doing it for me. Modders have limits, but the game is, of course, allowed to change the file size as much as it feels like. This way ou don’t have to sacrifice an old plot flag for every new one you add in. The danger with my method is that some plot flags can truly mess up your game if they enter your inventory at the wrong time, via loot or rewards. Plot flags do nothing in and of themselves; they just mark that an event has occurred. If you set a “romance active” flag with someone, you won’t get any scenes, quests, or dialog that involve romance with that person, because the game will “think” they have already occurred. (Sorry to keep repeating this; I don’t know how else to get the message across!!!) If you set the “completed Adamant” flag, you’ll have some new conversation options, but the Grey Wardens, Erimond, Hawke, the Divine, et al will be unresolved, and you’ll miss scenes and conversations that trigger important plots. “Whooooaaaa, that’s heavy…” as Marty McFly would say, before he erased himself from history. Use this trick for the little things. Make a label for your flag and add it to the Plot Flag Editor list; use the tool to fix it if you think you messed up!

That said, I’ll show you how to set the flag that tells the game that Sera’s unlocked all the doors in the basement of the Haven chantry. The flag doesn’t “activate” the doors itself; the zone itself checks for the flag when it loads (when you approach), then creates the doors accordingly (pretty much). What we’ll do is simple:

1. find the flag we want
2. add the plot flag to a file for a ring
3. add the ring to a store

How to Find Plot Flags

Of course there are a few little details. For instance, where do you find the plot flags you want? The easiest sources to use are conversations. I’ll show you the following from Sera’s hub (DA3//designcontent//Conversations//InquisitionBase//SecondBase//Sera//SeraHub//in2_sera_hub_main_i is where you can find it in the Mod Maker. My pictures, taken over a year ago, are from Eham’s DAI Modding Tool hooked up to a Patch 5 game on an external drive because the Mod Maker at the time did not like conversation hubs; they are huge files). When you open up a conversation file, click on “Preview” at the top of the file to see how plot flags direct the conversation. We’re looking at the Preview in Sera’s hub below


Here we see some of the flags that are conditions that must be met for the Inquisitor to ask Sera to unlock the doors.

Obviously, the Inquisitor can't be a rogue, or s/he would just open the door themselves. The “inquisitor class rogue” was identified by modders early on, and I know that E7D1D575B07D444B98AF44FBAEBE015B sets as soon as the Inquisitor gets to Skyhold (it’s used frequently, in all kinds of conversations and events), so we know those should be false. I know from experience the topic of locks won’t trigger with Sera until you have actually gone and tried to open the door, so I’m going to guess that the 478E5880704cf04d8f5c946b9a770192, since it should be “True,” sets at that time.

That leaves AC951D0CECDA8E4D873ADE23049601BE. We know that the conversation topic will only trigger if it’s “False,” so it’s a good bet that it’s the doors being unlocked, the one we want.


Continuing through the conversation tree, we see that very same flag gets set as
"True" after Sera responds to your question about the locks. So if we add and set that flag in our mod, we can get the door to open itself without Sera's help.

Copy the plot flag number AC951D0CECDA8E4D873ADE23049601BE to a text file somewhere

How to Add the Plot Flag to an Item

A lot of items you can equip, namely armor and weapons, have a slot prepared for a plot flag; this is so the game will know when you get a plot item, or something else of significance, so that it doesn’t give it to you again. Most items aren’t important in that regard, so this slot is blank; it has a value of zero and is denoted “invalid” by the game. Unfortunately, setting a plot flag take up a lot more room than checking a plot flag, so we can’t simply “reverse-engineer” conversations and logic blueprints that conduct checks. Also, many aspects of the file structure seem to be pre-set by BioWare’s own software, so we can’t, say, force the file to add five more plot flags. We’re pretty much stuck with one per item. The good news is that the new flags will be stored, permanently, in our save games, as soon as they set, so you can keep re-modding the same item, but switching in a different flag, saving, and re-merging, whenever you need to, over a series of games. Anyway, I like to use accessories, since they’re small and disposable (if need be). I’m going to show you how to put items in a store, since you may need to, but in the future, you may wish to simply find a store first a use the items already in stock, to add your plot flags to.

Open up the ModMaker, and navigate to da3/equipment/items/accessories/rings

we’re going to use the first non-dlc item on the list, the low-level armor penetration ring (DA3//Equipment//Items//Accessories//Rings//equip_acc_ring_armor_penetration_1)


Click on the file, and an Asset Preview (a human-friendly version of the file) will pop up. If you haven’t already, check both boxes at the bottom of the Asset Preview “Show data offsets” and “Show GUIDs as String (inverted)” Once you can see the offsets in the Asset Preview, scroll down to the offset 0x00001424 to see where the plot flag is going to go (the arrow).


Now it’s time to export the file so we can change it in the hex editor. Go up to “Debug” at the top of the Asset Preview, and select “Export EBX Binary” from the menu.

Save As anything you like (I usually copy and paste the file name into the save field, to help remember). Then, open up your hex editor, and open the (it will end in .ebx) file you just exported.

If you’re new, the above photo is just a reminder of how to find that offset in the opened hex file

Before we set the flag, I’ll show you how to “de-Invalidate” (so the plot flag isn’t ignored). Find the offset for the Action Type, listed at 0x0000141

The “Action Type” we provide tells the computer what to do with the plot flag. We’ll enter a value of 01 at 0x0000141c (“02” would reset the flag. Too complex for now, but there are others.)

Now, find the flag you (hopefully) copied and pasted somewhere, AC951D0CECDA8E4D873ADE23049601BE (our example), and paste it into your hex editor, starting at 0x00001424.

Save (the hex file) As something you’ll know. I usually just stick a “test_” at the front of my modded files so I know which ones they are.

Once the hex file is saved, you can import back into the Mod Maker. Go back to “Debug” at the top of the Asset Preview, and choose “Import EBX Binary.” It should look like this


Oh no, it’s backwards! Well, not backwards, but all endian-flippity-thingy-inverted-noninverted-pain-in-the-neck-looking.In the next section, I’ll show you how to deal with it painlessly, if it happens to you. If it doesn't, forget the scary picture above and skip to the section after the following!

*I wrote this tutorial in November of 2015, and I know the ModMaker has been carefully updated since then. It probably doesn't have this bug anymore, but I haven't modded this game in a long time and I don't know. Anyway, the next part will show you how to find numbers and match them up just by looking at the hex file (so you can just copy them instead of doing all the annoying reversing yourself)

Finding Inverted Numbers

Now, Dawn patiently explained to me the hex-friendly “strings” view, that I think of as “the right way,” is actually the “inverted” view, but it seems to be common parlance among modders to denote the non-hex-friendly-view as the “inverted” one, so keep that in mind...

So that we can add this modded ring into a store file, we’ll need to get the EBX and GUID numbers of its file, so the game can identify it in a list.

There’s no need to go through the song-and-dance of reversing the pairs, not for these long numbers that are easily messed up. I’ll show you how I deal with this.

*Of course, had you KNOWN this would happen, you could have copied and pasted the hex-friendly EBX and GUID numbers somewhere yourself before you imported I just want to show you this trick, so you don’t get thrown when this happens.

What I call the “EBX number” is the first number you’ll see at the top left of the Asset Preview. If you have closed the hex file you exported from this Asset Preview, re-open it. The EBX number is always located at 0x00000028. When you’ve found it in the hex file, copy and paste it to a text page.

Image(In this picture and the one below, I drew small lines to separate the pairs, in the first group before the first dash, of the Asset Preview numbers, in the hope it may help those who are new and not used to thinking "in pairs." The pairs get reversed, as pairs, but the two numbers within the pair do not change.)

What I call the “GUID number” is right below the “EBX number.” Technically, all of these long numbers, assigned by the game to identify…everything…are all GUID numbers, so you may not think of them the same way I do, but I’ve found it’s easier to talk about them when they have names. I know they are not very creative names; I am sorry

ImageThe “GUID number,” the second of the pair, will not always be at the same offset but it is easy to find by eye. Just scroll down in the hex file until you see the name of the file. The first full line below it will always be that GUID number you need. The EBX and GUID numbers bookend a lot of information that doesn’t show up in the Asset Preview.

You might want to get used to “eyeballing” the pairs for these occasions. Look at the number as it appears on your asset preview, look at the first group of numbers before the dash; that last pair, right before the dash, will be the first pair in the hex-friendly view, so you’ll know what to look for. Also, the very last group of numbers (after the final dash, in the number on your Asset Preview), will always be exactly the same, even direction-wise, as the hex-friendly number, so you can just copy and paste that into your hex-editor’s search function to find the hex-friendly number fast.

How to Add the Item to a Store

For our purposes, the ReSpec store at the Blacksmith’s (in Haven, for our early-game mod), is the easiest thing to do. You can find the store files under “Equipment” in the Mod Maker.

ImageClick on the file (DA3//Equipment//Stores//store_Respec) and open its Asset Preview. Export the file and open it up in your hex editor.

We’re going to replace the cheap amulet with the armor-penetration ring we modded. We’ll find its EBX and GUID numbers, locate them in the ReSpec Store file, and paste the EBX and GUID numbers for our modded ring over the amulet’s numbers.
To find the cheap amulet’s EBX and GUID numbers, simply click on the blue link, the cheap amulet’s file name, in the ModMaker. The cheap amulet’s file should pop up (if you have already saved, the file may not pop. You can navigate to it under da3/equipment/items/accessories/amulets). Look in the top left of the file to get the EBX and GUID numbers.

Now, look over at your hex file, the ReSpec store and locate those two numbers. If you are lost, remember that the EBX and GUID pairs, such as these, that the file uses for reference to other files, start at 0x0000040, and will end before the legible words-you’ll see them on the right-begin. So the words are the lower boundary of the region you should be looking in for these numbers.

Once you find them, you can go ahead and paste the EBX and GUID numbers of the modded ring file over them.

Save the hex file as “test_respec_store.ebx” or whatever you would like. Now, import the modded ebx file you just saved into the Asset Preview of the ReSpec store file, and voila!


Now, all you have to do is save and name your mod! It should be just the two files (for our exercise, at least), the armor-piercing ring, and the respec store.

As soon as you buy the ring in game, that is, “on_pickup,” the flag will activate. There are other options, such as “on_use,” but whatever “use” is intended does not include equipping the item. Room for experimentation, certainly. Anyway, once that flag is added in-game, it will be there in your save game, forever. So you can safely uninstall the mod you just made, and use the cheap amulet space in the respec store to deliver anything you need to your inquisitor.

One more thing, for “Extra Credit,” (literally) is that you need to be able to afford the item you’ve just placed in your shop. The easiest thing to do is to make everything in the store free. Here’s how: find the store’s Sell Multiplier in the Asset Preview, and locate it in the store’s hex file (the one you’ve modded already). In our example it’s 0x00000524 Change the number you find at the offset (there will be four pairs; I believe it is 00 00 80 3F, which is 1.0 in hex float notation), to all zeroes. If you want to give yourself an even better rate (the vanilla game’s is pretty bad), you can change the digits at 0x00000520, which you can see, on the Asset Preview, is the Buy Multiplier, you can change those digits to 00 00 80 3F to sell at 100% of items’ value (00 00 00 40 is 200%, 00 00 40 40 is 300%). Or just zero the whole hing out for free stuff.

Also, if you have attached the plot flag to say, some nice new armor (two birds, one stone, why not?) make sure you’ve removed any restrictions (you’ll still get the plot flag when it enters your inventory, I’m just being a mother hen here.)


Get the Mod

If you want to look at the mod made in this tutorial, you can download it here
https://www.dropbox.com/s/my8jz0ywz21ir ... k.zip?dl=0

How to see what files were saved in any mod (your own that you are making or another’s that you’ve opened) go to the menu bar along the top of the ModMaker’s main screen. Click on “Edit,” and open “Adv. Mod Configuration” from the menu. When the box appears, click on “Data,” and the “bound data” files that you see are the ones that have been used in the mod. ***To exit the Advanced Mod Configuration box, click “Cancel,” or close via the “x” in the upper right hand corner. Don’t click on “Save,” or everything will crash!!!(***again, I wrote this tutorial in November 2015, and I'm guessing that bug got fixed too, but not 100% sure, so I will check).

Good luck to all!

Big thanks to dawnlessSky for the ModMaker, to Ottemis and Zhentar for keeping the tools up-to-date and making everything so easy to use

and Ehamloptiran for the DAI SaveGame Editor and the original DAI Modding Tool
borglet has been thanked by:

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: