Dark Souls

This guide is for version 1.0.2 of the mod
Tools Used

UnpackDarkSoulsforModding - For unpacking the game's files for easier modding.
Soulstruct - For modifying the event files.
EventPocket - For monitoring event flags during testing.

Note: You may alternatively use DarkScript for modifying event files, however the code shown in this guide will not work with that tool. Soulstruct and DarkScript have a completely different way of displaying the scripts. I've chosen to use Soulstruct for this guide because the code is generally easier to read and write, and thus easier to explain to others.


Editing the Files

When editing the game's event files, the first thing you'll need to do is figure out which file you want to modify. The event files are located in the "event" folder in the game's install directory. If you're looking to edit something that is in a particular map, you'll want to refer to the map list on the modding wiki and find the .emevd.dcx file associated with that map. If it's a general event that isn't tied to one map it's probably in the common.emevd.dcx file.


Warping Always Enabled

Bonfire warping is usually unlocked when event flag 710 in the common.emevd.dcx file is switched on, which happens when the lordvessel is obtained. However, many other event scripts, in multiple files, also check to see if this flag is on for various other reasons as well. For example, m16_00_00_00.emevd.dcx (New Londo Ruins) uses this event flag to determine whether or not Ingward should acknowledge that the player has obtained the lordvessel, which results in him giving the player the key to the seal.

Since event 710 is used for other things we don't want to force that event flag on as a way of enabling bonfire warping, so we need to figure out a different way to do it. Luckily, event 717 in the same file also enables warping. This event's full script is listed below for reference:

DisableFlag(717)
IfFlagOff(1, 710)
IfInsideMap(1, game_map=NEW_LONDO_RUINS)
IfStandingOnCollision(1, 1603300)
IfConditionTrue(0, input_condition=1)
EnableFlag(717)
IfStandingOnCollision(2, 1603300)
IfConditionFalse(0, input_condition=2)
DisableFlag(717)
Restart()


This script is designed to temporarily enable bonfire warping if the player manages to defeat the Four Kings boss fight before obtaining the lordvessel, so they aren't trapped in the abyss. The script enables bonfire warping by turning on event flag 717, but only if the right conditions are met. After the player has warped out of the area it disables bonfire warping again by turning the event flag off. This is the event we're going to modify in order to enable bonfire warping from the beginning of the game. For this mod I completely rewrote the event 717 script to something much simpler, since we no longer need to check for those specific conditions:

SkipLinesIfFlagOff(2, 710)
DisableFlag(717)
IfFlagOff(0, 710)
Restart()


As you can see, much shorter, much simpler. So, how does this new script work?

SkipLinesIfFlagOff(2, 710)

This line checks to see if event flag 710 is on, since that event flag also enables bonfire warping. If it's not on it will skip the next two lines of code for now.

Restart()

So we skipped the two middle lines of code, and now this line will restart the script from the beginning. It will go back up to the first line and perform the check again to see if event flag 710 is on yet (I'll explain why that's important soon). However, when the last line of a script is executed it also automatically turns on that event's flag, which means that before it restarts the script it will also toggle event flag 717 on if it isn't already, which enables bonfire warping.

DisableFlag(717)

So the game is going to continuously keep executing the first and last lines of this script to make sure that event flag 717 is always on while event flag 710 (lordvessel obtained and also enables warping) is off. The reason we need to keep checking if event flag 710 is on is because if event flag 710 and event flag 717 are both turned on then two warp options will appear on the bonfire menu. So, to fix this, we add this second line to the code to turn off event flag 717. As explained before, the first line prevents this second line from being executed unless vent flag 710 is on. So, when the player obtains the lordvessel, event flag 710 is turned on and event flag 717 is turned off at the exact same time.

IfFlagOff(0, 710)

This line is a bit trickier to explain... This is a condition line, and the 0 in this line tells the game not to execute any other lines of code in this script until the condition is met. The condition it's looking for is if event flag 710 is off. In other words, as long as event flag 710 is on, the script will forever halt on this line, continuously checking whether event flag 710 is on or off. This prevents the last line of the code from being executed, which prevents event flag 717 from being turned on while event flag 710 is on.

If event flag 710 is ever switched off then it will allow the script to continue to the next line of code, which, as explained before, will turn on event flag 717 and restart the script. Event flag 710 is never turned off through normal playing conditions once it is turned on, until the player starts "new game +" obviously. But, if it were to be turned off for any reason (from a mod, messing around with modding tools, etc.) then this will allow event flag 717 to turn on again so warping will always be an option on the bonfire menu. This is the reason I chose to use IfFlagOff(0) rather than using EndIfFlagOn().

So these four lines of code are designed to ensure that either event flag 710 or 717 is on at any given time time (so the warp option is always present), while also making sure that event flags 710 and 717 are never both on at the same time (so the player doesn't get two warp options on the bonfire menu).

Now that we have bonfire warping enabled at all times, we want to remove the message that bonfire warping has been enabled when the player receives the lordvessel. This message is managed by event 0 at the top of the same file:

RunEvent(260, slot=2, args=(710, 10010620, 0.0), arg_types='iif')

This line tells the game to run event 260, which is used to display messages on the screen. Since this event is used for multiple different messages it uses variables (args) to give the event script the information it needs. In this case, it runs event 260, which checks to see if event flag 710 is on, and if it is then it displays a message with the text ID 10010620. This is the message that tells the player bonfire warping has been enabled. Since event 260 is used for multiple things, not just this one message, we don't want to modify that event script at all. So instead we simply delete this line from event 0 to prevent that message from being displayed.


Streamlined DLC Access

We know that most of the DLC access content is located in Darkroot Basin. If we check the map list we can see that m12_00_00_00.emevd.dcx is the file which controls events for that area.

This first thing we want to do is allow the golden crystal golem to spawn without the hydra being killed. The event that prevents the golden crystal golem from spawning is event 11200800. But since this event actually doesn't do anything besides disable this spawn from happening, we're just going to disable the event from running at all instead of modifying the event script. Events 0 and 50 are always used to initalize events while the map is being loaded. If you look through event 0 you'll see this line:

RunEvent(11200800)

Simply deleting that line will be enough to prevent that event from running at all, even if the event script is still in the file. If an event script isn't inititialized with RunEvent() somewhere then the script is ignored.

With that event disabled, the golden crystal golem will now spawn without the hydra needing to be dead first. However, if the golem is killed right now Dusk will not spawn because there is a redundant check in her event script that also checks to make sure the hydra has been killed first. The event is 11200530, and here is that event's full script for reference:

IfFlagOn(1, 1120)
IfFlagOn(1, 11200800)
IfConditionTrue(0, input_condition=1)
DisableFlagRange((arg_4_7, arg_8_11))
EnableFlag(arg_12_15)
Move(arg_0_3, destination=1200200, destination_type=CoordEntityType.Character, model_point=101,
copy_draw_parent=1200200)
EnableCharacter(arg_0_3)
Wait(0.5)
SetStandbyAnimationSettings(arg_0_3, standby_animation=7875)
ForceAnimation(arg_0_3, 7876)


The line we're looking for is:

IfFlagOn(1, 11200800)

As you can probably tell, it's checking to see if event flag 11200800 has been turned on, which normally happens when the hydra is defeated. But since we disabled that event to allow the golem to spawn, killing the hydra now will not turn that event flag on. So we're going to change this line to check if the golden crystal golem is dead instead by changing that line to this:

IfCharacterDead(1, 1200200)

1200200 is the EventEntityID associated with the golden crystal golem, so this condition line just checks to make sure the golden crystal golem is dead. Now Dusk can spawn properly after the golden crystal golem has been killed, without the hydra needing to be dead as well.

Since we know that the lower part of the event 11200530 script runs immediately after the golden crystal golem is killed (because it spawns Dusk, which we know happens at that time), we can use this event script to also give the player the broken pendant.

EnableFlag(arg_12_15)
Move(arg_0_3, destination=1200200, destination_type=CoordEntityType.Character, model_point=101,
copy_draw_parent=1200200)
EnableCharacter(arg_0_3)


This is the part of the script that makes Dusk spawn, if the conditions at the top of the script are met (which we just edited). If we put a line of code within this part of the script we know it will be executed right after the golden crystal golem is killed:

EnableFlag(arg_12_15)
AwardItemLot(27100200, host_only=True)
Move(arg_0_3, destination=1200200, destination_type=CoordEntityType.Character, model_point=101,
copy_draw_parent=1200200)
EnableCharacter(arg_0_3)


The line I added to this script will give the player ItemLot ID 27100200, which is the broken pendant. This will allow the player to meet all of the conditions for the DLC. We could also just make other edits to this file to remove the need to have the broken pendant, but that's more work and I prefer to leave it as it is in case the broken pendant has some sort of lore attached to it.

The last thing we need to do is prevent the golden crystal golem from respawning after it has been killed. Normally this is done with event 11200800, but since we disabled that we need a different way of preventing the golden crystal golem from respawning. We can add these lines of code to the bottom of event 0 or 50 to accomplish that:

SkipLinesIfFlagOff(1, 11200530)
DisableCharacter(1200200)


The first line performs a check to see if event flag 11200530 is on or off. If it's off then the script will skip the next line of code. If the event flag is on then it doesn't skip any lines of code, so the second line is executed. I chose event flag 11200530 because this is the event script that controls Dusk spawning for the first time (it's the script we just made edits to). So we know this event script only reaches the end of the script (thus switching its event flag on) after Dusk spawns, which only happens if the golden crystal goldem has been killed. So if this event flag is on, the golden crystal golem should not be respawning.

The second line of code above is obviously what prevents the golden crystal golem from respawning. As I said before, 1200200 is the EventEntityID associated with the golden crystal golem, so that's how this line of code disables it. Because events 0 and 50 are always run every time the map is loading, it will ensure this character is always disabled as long as the line above it isn't causing it to be skipped.


Removing the Odd Crystal Golem From The Duke's Archives

Once again we can check the map list to see that m17_00_00_00.emevd.dcx is the file which controls events for The Duke's Archives.

Event 11700700 is the script that controls the spawning of the odd crystal golem near the entrance. Here is the original script for reference:

IfCharacterAlive(0, 1700510)
EndIfFlagOn(11700700)
IfDLCOwned(1)
IfCharacterDead(1, 1700510)
IfFlagOn(1, 11200530)
IfFlagOff(1, 1121)
IfConditionTrue(0, input_condition=1)
IfCharacterHuman(-7, PLAYER)
IfCharacterHollow(-7, PLAYER)
EndIfConditionFalse(-7)
AwardItemLot(27100200, host_only=True)


You might think we just want to disable the event and use a similar method as above to prevent the spawning of this character, but unfortunately that won't work this time. There is something weird about this character that causes it to force a spawn even if you disable event 11700700 and use DisableCharacter() in event 0 or 50. So, for this one, we're going to completely rewrite the event 11700700 script to this:

DisableCharacter(1700510)
Restart()


Same as before, 1700510 is the EventEntityID associated with that particular enemy, so the first line of code will disable it. However, as I said before, the game will try multiple times to spawn this enemy for some weird reason, and that's why we need to use the second line to restart the script. This will cause the script to repeatedly disable that character, so when the game keeps trying to spawn it, this script will keep preventing it from doing so.


Optional File: Antiquated Set Corpse Always Enabled

Obviously this is also going to be in m12_00_00_00.emevd.dcx, since the corpse is in Darkroot Basin. It's managed by event 11200690, so here's the original script for reference:

SkipLinesIfThisEventOn(6)
DisableTreasure(1201600)
DisableObject(1201600)
IfFlagOn(-1, 1123)
IfFlagOn(-1, 1130)
IfConditionTrue(0, input_condition=-1)
EnableObject(1201600)
EnableTreasure(1201600)


This one is pretty simple to edit. We're just going to remove the top six lines from the script, since they just disable the corpse and treasure from spawning, then set the conditions needed for them to spawn. So we leave this script as just the bottom two lines of the original script:

EnableObject(1201600)
EnableTreasure(1201600)


If you try to just disable this event instead you will find that the corpse will spawn but the treasure will not. That's why we need to set this event to make sure they're enabled.


Useful Resources

If you'd like to learn more about modding From Software games you can find a ton of useful information here:

From Software Games Modding Discord
Souls Modding Wiki

If you have any questions that are specific to this guide or this mod you can ask them below and I will try to help you figure things out.

Article information

Added on

Edited on

Written by

Dziggy

0 comments