Jump to content

lyravega

Recommended Posts

This is a guide to try and explain how to mod skills. It is INCOMPLETE, I'll try to finish it part by part.

 

Modding Targets:

Skill XML - data0.pak\data\skills\common_skills.xml

-This one is the real deal

 

Default XML - data0.pak\data\skills\default_levels.xml

-This one is for reference only

 

UI - data0.pak\data\menu\scr\menuskills.xui

-UI is optional, but mandatory if you want to make new skills

 

Localization - data0.pak\data\maps\common_texts_all.bin

-Skill descriptions and names are saved in Localization

 

Resources & Tools:

-Notepad++

-UI file ready to be modded:

-Chrome Workshop (author removed the tool, trying to contact him/her to get permission to attach it here)

-A simple builder written in javascript to fill in the blanks in the UI file above: AMM (make a copy of this on your own drive)

 

Getting Started:

First thing you need to learn is, to understand how the Skill XML file works. I cannot explain everything one by one however, the XML file is rich enough for you to take examples from, here I'll be explaining just one.

<skill id="Finisher" cat="fighter" tier="22" max_level="1" desc_params="stun_kill;M:Finisher" skill_points="1" skill_points_type="Fighter">
	<level_req type="Fighter" value="12" />
	<skill_req id="Stunning" />
	<effect id="FinisherFrontEnabled" change="1" />
</skill>

Attributes of a skill:

id: Internal ID. Used by the game internally, also used for localization.

cat: Category of the skill. Either this or skill_points_type is responsible from UI placement

tier: Tier of the skill. As far as I can tell, only used by the UI to determine where the skill should go in the tree.

max_level: Times you can invest in the skill.

desc_params: First variable here is for the icon, the rest, icon visuals & description aid (hexagon/active/passive)

skill_points: How many skill points this skill requires

skill_points_type: What kind of skill point this skill requires

 

Requirements of a skill: (note, all of these below are optional, but having no requirements is bad)

level_req type, value: Type of the level. Can have more than one.

skill_req id: The ID of the required skill in order to unlock & get this one. Can have more than one.

tier_req value: This type is NOT used in Dying Light. Since the skill structure is very different from Dead Island, trying to use this will be pointless, as this does the same as above.

 

Effects of a skill: (this is the real kicker here)

One thing you need to learn here is, how "change" works. Pretty much everything in the game has base values. Most of these values can be found in the Default XML. Basically what a skill effect does is, it alters these base values. In this particular example, "FinisherFrontEnabled" has a v of 0 in the Default XML, however if the player grabs this skill, it will be "base + change" and thus, 1.

 

The value of the change is always an addition, unless it has an "x" in front of it. "x" denotes that this change is multiplicative rather than an additive one. Lets say, we have a base value of 10. And we have a skill which has this line: <effect id=EFFECT change="x-0.5" />. This means, the final result will be "10 + (10 * -0.5) = 5". To negate something, you can just write "x-1"; or to double something, "x1" for example.

 

There are a few skills that do not have any effect however. Some of these skills are used by some of the buffs; which I'll go into detail later on. Some of them are handled by the code. Two examples would be related to potions, and crafting; there is one skill that allows you to craft more, and there is a skill that allows you to gain stronger/longer buffs from potions. None of both has any effect however.

 

Name & Description of a skill:

As Chrome Workshop is removed from the Nexus, I'll be holding this part out, for now.

 

Altering the UI (updated!)

UI placement is handled purely by tier, and cat (or instead skill_points_type). For example, if you swap tier of two skills, their positions in the skill tree will effectively be changed. More on dressing the UI to custom skills will be explained later on. The UI file contains all the node locations, and arrows, nothing is done on the Skill XML aside from telling the UI where a skill should go.

 

First thing is, open the provided UI file. I've removed all of the skill related stuff from that file, and instead left 3 commented lines. Search for "lyr", and you'll end up with 3 results; "lyr / Status", "lyr / Runner", "lyr / Fighter". These are the lines you will replace with the help of the builder link I've provided. The builder link is for view only; make a copy so you can toy around with it yourself on your own drive.

 

6UtPlSW.jpg

 

The first 4 sheets, I used as a reference. 5 to 7 are skills placed in their vanilla positions. And last 3 sheets are what I use in Advanced Moves. Lets take a look at vanilla skill placement; the sheet for vanilla Runner skills is opened below:

 

Bzsbyis.jpg

 

First thing to note here is, there are 3 big cells. The third cell; the one on the right is the cell which has the contents that we want to paste to our "menuskills_wip.xml". Second thing to note is, the "+" is actually a button, which executes the script. Before I go into their details, I should explain how to use this workbook first. The green cells are the skills; red cells are the possible but empty placements. The green cells have a number in them; and this actually is the "skill tier" which I was talking about above. The cells around the node are arrow cells; there are 5 types of arrows (left/right/down/dleft/dright). Lets take 15 as an example (top-left skill); if we write "left" in the cell to the left of it, you will see an arrow pointing to the left in the game.

 

You can move everything around. But you have to follow suit when using this javascript code. Skills always go to the colored cells. Don't use same number (tier) twice. If you want an arrow, be sure you are using the correct word for the arrow (if you want left; you write left to the skill cell you want it to come from).

 

After you commit your changes, click the + sign, and open the "menuskills_wip.xml". Since this is Runner skill tree, search for "lyr / Runner". In the sheet, copy the contents of the 3rd big cell, and paste it below the "lyr / Runner" line in the xml. Note that, since this XML doesn't have the skills from other skill trees, even if you are NOT going to change anything on the other trees, you still have to generate them and paste them like you did with Runner.

 

That's pretty much it. You can check Advanced Moves, and the last 3 sheets to get a bit more idea.

 

Making a new skill (new!)

Lets make a new skill and place it to the top left side of the Runner skill tree. I call this passive skill, Tutorial, and it gives us a constant health regeneration. Only prerequisite is Health Regen II, and this skill is free.

<skill id="lyr_Tutorial" cat="runner" tier="50" max_level="1" desc_params="health_regeneration;P" skill_points="0" skill_points_type="Runner">
	<level_req type="Runner" value="20" />
	<skill_req id="HealthRegen2" />
	<effect id="HealthPerSecond" change="0.01" />
</skill

Voila!

-We've given a new id to our new skill.

-Placed it in the correct category.

-Gave it a new tier - and we are sure that this tier is NOT in use by any other skill.

-It only has one level

-We are using the same icon from Health Regeneration II. And we wrote P as it is a passive skill.

-It is free as it doesn't cost any skill points.

-It'd have required runner skill points if it wasn't free.

 

-It requires you to be level 20 in order to get this skill.

-In addition, you also need Health Regen 2 from the same tree.

-And the effect is, HealthPerSecond. This is one of the unused attributes in the game. It is percentage based, so a change of 0.01 (and its base is 0) will make the player to constantly regenerate 1% of their HP every second.

 

But we are not done. Now the UI part. All we have to do is, go to G_R (runner sheet), and on top left side, add 50 & an arrow towards it. Arrow is optional, but since there was another skill next to it, I linked them in this example, for the sake of example.

 

Fwg9Rgz.jpg

 

Now, after this change, you need to click the "+" button, grab the newly generated cell contents, and place them in the right area in the .xml file. Be sure to make a copy of "_wip" file before, and rename the new file to "menuskills.xui". Now, when you pack yourself a Data3.pak, you'll have the newly created skill in the game. Ta-da! You have a new skill in the game now.

 

...more to come

 

Warnings:

-Do not change the order of the skills in the Skill XML. Everything is loaded (and saved) in order, so moving them around will cause issues. When you are adding a new skill, add them to the BOTTOM of the file.

-As said above, since everything is loaded in an order, you cannot have a skill at the top of the Skill XML that requires another skill below it. What I'm trying to say is, lets say skill X is defined at the top of the file, and skill Y after that. X cannot have Y as a requirement; Y has to be defined before X in order to have it your way.

Edited by lyravega
Link to comment
Share on other sites

Thanks for the guide. How I wish I would have just waited a few days. I learned most of what you wrote here by extracting other peoples mods and comparing against the original source. I thankfully got that chrome workshop downloaded locally before the author removed it. That excel sheet is awesome. I was in the process of mapping out the stupid node "tiers" this very morning.

 

I would add that I couldn't get the .scr files open in NP++. I have only used it for the compare add-in in the past so I am woefully unaware of how to use it correctly. I am currently using visual studio and it works like a charm. It also lets me organize the code on the fly for some of those UI files that are just one long unbroken line.

 

Anyway that brings me to my question if you don't mind.

How do I modify certain attributes of weapons using the skill tree. For instance, I would like to add to the actual force of the standard kick using a skill tree perk. However when i use the below it does nothing. Even at extremely high values.

<prop n="KickBaseDamageMul" v="1.0"/>
<prop n="KickBaseForceMul" v="1.0"/>
<prop n="MeleeVerticalPhysicalDamageMul" v="0.5"/>
The only way I could get it to work is modify the leg "weapon" itself at the inventory level. But it doesn't seem that the below "force" has anything to do with the above "kickbaseforcemul". If that makes any sense at all ~_~
Item("Melee_Leg", CategoryType_Melee)
{
Name("&Melee_Leg_N&");
Description("&Melee_Leg_D&");
ItemType(ItemType_Stick);
Condition(0);
Damage(10.0);
DamageToPhysicsObjects(34.0);
CriticalProb(0.0);
CriticalDamage(2.0);
DamageRange(2.0);
Force(500.0);
PhysicsDamageMul(3);
StaminaUsage(0.5);
HeadSmashProb(0.0);
HeadCutProb(0.0);
ArmsCutProb(0.0);
LegsCutProb(0.0);
AiHitSound("leg");
DamageType(DamageType_Kick);
Reparable(false);
MinDamageAngle(-8.0);
MaxDamageAngle(8.0);
MaxHitSeverity(HitSeverity_Medium);
MinHitSeverity(HitSeverity_Medium);
StaminaUsage(0.0);
use HitEffects_Default();
}
Link to comment
Share on other sites

One thing to note:

1- <prop n="KickBaseDamageMul" v="1.0"/> works in default_levels.xml

2- <effect id="KickBaseDamageMul" change="1.0" /> works in common_skills.xml

 

If you are using the first one in the "common_skills.xml", it won't work. Another thing that comes to my mind is, try using "KickForceMul" instead of "KickBaseForceMul". I'm not sure which one, but one of them wasn't working or didn't have the impact I was looking for.

 

About NPP, it has a lot of plug-ins. Not just compare, but tidying XML up for example. It is fast, reliable, allows multi-editing, regex, etc... whatever I can think of. I even have a console open in it, where I can run .lua code directly from it and so on. I suggest taking a look at "Default Programs" to make NPP default program to open .scr files. Make sure the language is set to C# as well.

 

And lastly, about the sheet, it is not just a source of information, but where you can generate .xml code to modify the skill placements, and even add new skills. I've updated my post with more information, hope it helps!

Edited by lyravega
Link to comment
Share on other sites

Yah, I got the tags under control. I realize the attribute would have to go in the effect if tag instead. Ill definitely try using that other variable. The leg variable that i linked is what I used to successfully mod the knockback on the kick. I can send people to the moon. I learned the logic from the ninja mod. I just can't seem to tie it to a skill though.

 

I have used NP++ for other things just not extensively. I use it for regex on occasion but I mostly program in SQL so all of my game coding logic is self taught. But NP++ is set to default on almost all extensions for me anymore.

Link to comment
Share on other sites

You may be right about the leg thingy. Been a while since I checked specials file. To try it out properly, maybe go to the default_levels.xml, scroll to the bottom, add level 1 tags, and put the stuff you want to test in it. Like so:

<level id="1">
	<prop n="KickForceMul" v="10000"/>
</level>

For NPP, I suggest "XML Tools", and "Compare" plug-ins, definitely. From Settings>Style Configurator, you can add the scr extension to C# as a custom extension, so whenever you open a .scr file it'll look nice :smile: By the way, in order to compare my stuff, you should ignore whitespaces and stuff otherwise it'll cause mismatches everywhere.

Edited by lyravega
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...