Death Road to Canada

Death Road to Canada

94 ratings
Modding in Special Characters Guide
By RyukaRuki
This guide will hopefully help you to create your very own custom characters using the game's code.
2
   
Award
Favorite
Favorited
Unfavorite
Introduction
This guide should hopefully help some of you to create special characters that look like whatever you want, and do what you want them to. You will need an image editing software to make them look like what you want. I used Gimp, but if you don't trust free internet downloads, I don't blame you. Microsoft Paint itself won't get rid of the extra white in the background though (as far as I know). You will also need something like notepad to alter the code.

http://sp.zhabite.com/app/252610/discussions/3/133263024014721773/
Step 1 - Find Everything
The first challenge is navigating to the file destination. Knowing where to look is usually not spelled out for you. I'll do my best to make navigating to the files as clear as possible. Since I'm using Windows, and others may use other operating systems, translating the information may be difficult for me since I have very little experience with things like Unix, Linux, and Mac. I recommend looking for a guide for your respective operating system to get to the Steam folder.

Steam
--Steamapps
----common
------DeathRoadToCanada

gfx will take you to the sprite files. This will make it possible to add a new physical appearance for your character.

deathforth will take you to all of the code files. There are a lot of files to go through, but for now, let's start with the appearance. Actually, I made a guide for adding sprites a while ago. It's not too different from that.
Step 2 - Spriting
Go into the gfx -> chars folder and edit the dr2c_special_chars file using your image editing software. Add 24 pixels to the image vertically. Keep how far from the top they are in mind. It's related to their specialtype ID is for the code.

Skippable Advice:

-use a select action to select only the pixels in the row you are trying to make.
-a head that's off-center will look weird. If possible, copy a row and paste it to help get a reference as to what you're doing. Maybe select all pixels in exactly one row, put a dot in the bottom corner and align the dot with the new row's bottom corner.
-slight pixel shifting up for the head will allow the character to look taller and the body section to be shown better, but be careful of having the sprite bleed into the above row.
-using the above heads as a reference for eye and mouth placement may help, varying on how non-human the face looks.
-experiment with it until you like it. You'll get better at sprite creation with practice, and can develop your own style and rules.

Hopefully that advice was helpful. Most of what I'm saying right now I copied from the first guide I made, except it's very abridged.
Step 3 - Coding Overview
Now we get to the tricky parts. The files of code in the deathforth folder are interconnected with each other and making a special character will involve messing with a LOT of files. Here's what you'll have to mess with, and I'll go over it file by file. Here's a huge tip, copy and paste examples often and modify from there. It saves a lot of time in comparison to starting from scratch.

in deathforth:

recruitdecks
charstatmods
roadprep

in deathforth -> events -> sc

Pick any cyoa-screcruit file. There's 4.
Copy one of the files that has the name of a special character and rename it to what you want to name the character. (I'd recommend something simple if you're just starting)

in deathforth -> events -> despair

sort

in deathforth -> blurb

blogic

in deathforth -> blurb -> sc

Copy one of the files that has the name of a special character and rename it to what you want to name the character. (I'd recommend something simple if you're just starting)

Step 4 - recruitdecks.df

Originally put in dailydecks.df before the Coccyx update.

This file houses the pool of special characters's calling cards for their road events. Some are commented out because of updates. This is also an easier way to make certain special characters appear (Which to this day, is still the only reason I met Garf).

So here, we add our own card.

The ____-test cards redirect to the cyoa-recruit files. That's where the recruitment events happen.
Step 5 - roadprep.df

This file acts as a gateway to the special characters' despair events. When you define the 'uses' part of the program, you specify EXACTLY where this all is. all of the despair events are in deathforth -> events -> sc.

Add a 'uses' statements with the last part being named after what you want the special character to be called.

Step 6 - sort.df
This file is where we program in the connection to our special characters' despair events through their specialtype ID number. This will be defined in charstatmods.

Copy and paste an example from bully-st to then;, and change the number and event name accordingly.
Step 7 - events -> sc.df
There's no specific name for this file. It should be the name of your special character though.

This file houses the despair events for your character. Usually it has two variants, one with and without other people. Searching around the code for various effects can make it more than just a simple decruitment.
Step 8 - cyoa-screcruitment#.df


This is the file where you implement the character's recruitment! All recruitment code should be crammed in here. I think looking at the code might be the best way to understand it.

.___ify is used in charstatmods to make the character's specialtype ID and stats.
Step 9 - charstatmods.df
This one's a pretty big step that I still don't fully understand myself. Overall, you can make the characters say things while attacking and modify their default stats here. Copy and paste is your friend here.

Update: It took some time, but I think I understand it now.

enum MOD_SC is what links the character to mid-battle dialogue. Commenting out or not inserting any of the MOD_SC things results in no in-battle dialogue.

step 10 - blogic.df
This is the file that connects the random things characters will say in the car. The top part connects it to the appropriate file, while the lower part uses the correct deck based on the specialtype ID from charstatmods.df.
Step 11 - blurb -> sc.df
This is the file that stores everything the character will say in the car.
Step 12 - Troubleshooting
There will likely be some form of random error you didn't account for. For situations like that, you'll need to know where to go and what the issue is. The file boot.df along with the game's log files can help!


The way I did it was probably stupid, but it worked. I used the in-game console to find what file had the issue, then checked for the problem and line in the log file.

I'm very thankful for everyone's support! Thanks for all of the help and tips!
Have fun!
That should be all of the basics. There may be some things that aren't 100% yet. If anyone would like to help make this guide better, feel free to leave a comment! I kinda rushed a little to finish this since I've been waiting too long to do this (finals week happened).

Experiment a bit and see what you learn! Maybe you can make a character that raises morale for everyone every time they say one of their car lines! (I couldn't. The closest I got was just themself. :/)


Princess Olive (Princess Maker 2) owned by Gainax

Coco Bandicoot (Crash Bandicoot) owned by Activision

Garrus Vakarian (Mass Effect) owned by BioWare

Toro Inoue (Doko Demo Issyo) owned by Sony Interactive Entertainment


Natalie (Ape Escape) owned by Sony Computer Entertainment

Mike Dawson (Darkseed) owned by Cyberdreams

Symmetra (Overwatch) owned by Blizzard

Spyro (Spyro the Dragon) owned by Activision
Update 1 - making special characters converse with other specific special characters


After some toying around with the code some more, I discovered 2 things.

1. It is possible to make unique and interesting dialogues between special characters.
2. The multiperson conversations we made in the blurb folder for the characters don't work quite right...

Luckily, there's a solution to that 2nd one. Just put the converstions name as a selectable card in deck-new.
As you can see from the picture above, this is the current code I used to make the conversation happen. For me, it worked. I'm still trying to make it work for more than just 1 special character, but I can't seem to make an elseif statement work in this code... I'll look into it more, but if you guys figure out a solution, let me know.

UPDATE : I figured it out. Here's the code.

Update 2 - Limits?

After trying to add in my 6th character, this happened. Once you get to a certain point with the enum MOD_BLANKs, it aborts when there's too many. I don't know if continuing is dangerous or not but I'll look into it.

Update: It's optional mid-battle dialogue. Getting rid the code related to MOD_BLANK deletes the mid-battle dialogue, but solves the previously stated issue.
Update 3 - A reference (highly outdated)
A GDrive link used to be here, but several key pieces of code have been moved since, so it's unhelpful now...
Update 4 - epilogue
With the new addition of special endings for each character, the file deathforth\events\finale\epilogue-check allows your special-made characters to have their own endings!

Search for <- char .specialtype@ 97 = if "was mistaken for a rare subspecies of wolverine and got thrown into a zoo. He didn't mind.*" then; then press enter and use what you learned to make your own ending for your custom characters.

There's also a second line.
<- char .specialtype@ 97 = if "GOOD WORK, BUB!" then;
Same process.
Update 5 - death quotes
deathforth/mission-events-human has the code for death qoutes. Search for <- chara .specialtype@ 97 = if RED "SEE YOU LATER BUB" .. <- chara thingyell then; and go from there.
Update 6 - Making a new event
Maybe you want to put in a new recruitment event like the hermit seige or the danger rangers or something. I found it to be difficult, but possible.

First, open deathforth\events\rareloc\rare1. Find a special event with rare characters, and use copy and paste to make life easier. The mission debrief part has a line of code to load in the setting. Find that file.

Most of the files will lead straight to the file with the needed code, but 1 redirects to a different file. Lucky me to wind up using that one... Junkpals is the file I'm using as an example. If you have to find another file and redirect from there, do so. Just copy the found file and rename it. make sure the rare1 code you copy and pasted before redirects to this.



Remembering the steps is a bit hard, so feel free to correct me if something's off, but overall, I didn't change too much. The picture might be better at explaining it than me.
Update 7 - Start off with the character
This can make testing if your characters' recruitment events work correctly a bit easier.

choice( "SEND LINK" fbold )choice: gimmechar1b in the cyoa-k-newbie file adds the option of choosing an event to start with from the cyoa-k-sctest file. Then you change the variables in cyoa-k-sctest accordingly.

Video Guide
110 Comments
viosull 6 Jul, 2022 @ 6:31pm 
my ___-test isnt being found by the recruitment page
MacknCheez 5 Apr, 2021 @ 3:33pm 
To anyone interested in modding in the LIVER update: custom characters start at specialtype ID 119, as of today (4/5/2021). Also, if you want to test your character/their event, you can open console with ` and type "road{ character-test }".
Cyclotone 6 Dec, 2019 @ 4:36am 
Has anyone ever figured out how to attribute certain traits and/or or perks to these characters?
There's things like fitness and strength... but not really what I'm trying to do.
✧ Hazel ✧ 9 Mar, 2019 @ 8:45am 
I have this error :

ERROR: not found at " " " in INTERPRET on line 293, stack:

Do you know anything about solving it?
Woejak 23 Sep, 2018 @ 10:17pm 
totally unrelted, but how do i open console??
last journey 1 Mar, 2018 @ 2:42pm 
this is log
ERROR: not found at " locdef2-r0x " in INTERPRET on line 1, stack:
** DEATH ROAD TO CANADA FEB-14-2018.13.17
** Sun Feb 25 03:03:43 2018

in 1! stack:
** DEATH ROAD TO CANADA FEB-14-2018.13.17
** Thu Mar 01 01:58:47 2018


ERROR: not found at " eat " in INTERPRET on line 660, stack:
** DEATH ROAD TO CANADA FEB-14-2018.13.17
** Thu Mar 01 02:00:47 2018


ERROR: not found at " eat " in INTERPRET on line 660, stack:
** DEATH ROAD TO CANADA FEB-14-2018.13.17
** Thu Mar 01 15:33:16 2018


ERROR: not found at " eat " in INTERPRET on line 660, stack:
** DEATH ROAD TO CANADA FEB-14-2018.13.17
** Thu Mar 01 15:37:15 2018


ERROR: not found at " eat " in INTERPRET on line 660, stack:
** DEATH ROAD TO CANADA FEB-14-2018.13.17
** Thu Mar 01 15:39:20 2018


ERROR: not found at " eat " in INTERPRET on line 660, stack:
last journey 1 Mar, 2018 @ 1:02am 
uh, I can't click start on the main menu. is there a way to fix that? Sorry if this post was posted before in some way
Cosmi 9 Feb, 2018 @ 4:03pm 
Quick suggestion, i'd put the video guide up at the top (as its the easiest to follow) and uh, some people dont enjoy scrolling all the way down
sp0g 28 Jan, 2018 @ 1:08pm 
thanks friend >:]
Martragon 28 Jan, 2018 @ 1:05pm 
Thanks alot!:8bitheart: