Enemy
评价数不足
The Unofficial Modding Guide
由 michaelullom 制作
This a spartan and straightforward attempt at giving a blow by blow description of how to Mod enemies, NPCs, items, and eventually cells. This will by no means cover everything, but it is an attempt to give the basics to someone who has a cool trick or two they want to try out.

The extent to which this gets filled out will largely depend on what people are interested in, and are willing to contribute. For now I will not be focusing on adding new textures, meshes, or other graphic modifications as much as changing basic properties of Enemies, Items, and NPCs, primarily because I have no experience modding with graphics. If someone elses wishes to contribute to that, that would be quite lovely, thank you.
   
奖励
收藏
已收藏
取消收藏
Introduction
Fun fact: Enemy is currently the closest we have to an XCom-like Mario Maker. The game is surprisingly moddable once we take a look under the hood. While, as in any game there are going to be limits on what is easily achievable, this guide is written with the intent of identifying what is easy to do and how to do it.

This is going to start as an extremely bare bones operation.

The creator Tom Johnson has put up a video walking through several uses of the editor, including building a cell (a chunk of landmass that is procedurally placed in a given battlefield or town) and has provided files for users to play with, at this link:

http://psteamcommunity.yuanyoumao.com/app/339570/discussions/0/541906989399572499/

he has also provided a link here that contains a zip file chock full of samples and a guide for editing and sound.

http://www.enemygame.net/misc/editor.zip

I encourage those interested to check it out. I also encourage you to download and poke through these files a few times yourself. It is going to be some time before I have information here that adds to what Tom has already published.

I am a less technical person, but I have poked around some of the easier areas. I am putting down here what little information I have discovered in the process of making my 8-Bit Difficulty mod, along with some mucking about generally.
Modding a consumable item's properties
As it turns out, editing an item's properties is one of the easiest things to change in Enemy, and is reasonably intuitive.

You'll want to open up the base.xml file. This is in the Items subfolder of the main enemy folder. As always, make a backup first.

For demonstration purposes, we'll edit the bottle of water.

First, scroll to the relevant entry, in the base.xml , replicated here:

<item>
<name>Bottle of Water</name>
<type>Consumable</type>
<desc>Puts out fires.</desc>
<icon>blue_bottle_icon</icon>
<price>3</price>
<size>1</size>
<slot>Satchel</slot>
<equip_time>5</equip_time>
<object_mesh>items/action/bottle_water.mesh</object_mesh>
<physics_material>Brush</physics_material>
<mass>0.5</mass>
<use_sound_set>
<sound>
<file>SFX/consume.wav</file>
</sound>
<sound>
<file>SFX/consume.wav</file>
</sound>
</use_sound_set>
<min_level>1</min_level>
<max_level>26</max_level>

<status_effect>
<effect>Wet</effect>
<duration>0</duration>
<amount>
<base>1</base>
</amount>
</status_effect>
</item>


For those of you trying this for the first time, the <item> and </item> tags indicate the beginning and end of all proprerties related to that item. Everything that's related to that item will need to be contained within that pair of tags.

Lets go down through some of the tags here:

<type>consumable</type> indicates that the item is a one-use item, as compared to something like a weapon, ammunition or clothing.

<desc>Puts out fires.</desc> tells the person playing the game what the item does. This is purely flavor text.

<price>3</price> I'm going to stop putting in the end tags, but remember they're there!.] indicates that the cost of this is three gold. All it takes is editing that number and saving and the cost of water becomes what you want it to be.

<size> indicates how many spaces it will take up in your satchel. You'll notice that one use items by default tend to be size 1, with weapons and armor potentially taking up larger spaces.

<min_level> indicates the minimum level the item is available for sale, and *I believe* the minimum level the item will show up in the wild, as part of a chest or item box.

<max_level> indicates the maximum level the item shows up. In towns and zones above this level, the item will no longer appear. For example, in higher zones med kits are no longer sold, as they have a maximum level of 10.

<status_effect> breaks down what the item does here mechanically. In this case, it puts the status 'wet' on the player, with a duration of 0. In gameplay, wet as I understand it puts out any fires currently on the player. The duration of 0 indicates how many rounds the status effect wet is active; 0 means the effect is instant and occurs immediately, while a duration of one would 1 indicate the status wet will either last for one full round after using it or activate at the end of the round, depending on the invidiual status effect.

Breaking this down can be a matter of guess work and trial and error and dependant on the status effect being invoked. If there is a pre-existing item whose effect you would like to replicate, take a look at the language there for ideas.

There is more to add to this section: In particular Tom just made it easier to change item's visual properties-and when I have time to experiment I will add more here. Tinkering with weapons, while conceptually similar, has many more tags to juggle. As such, I will spend more time on those down the road.






Changing an existing Enemy
Reviewing the Editor.zip file mentioned in the introduction is helpful here, as Tom also goes into this process for creating a new enemy.

The basic process of changing an existing enemy is this:

open up the editor.

Got to command load prefab under the edit bar. This will load up enemy.dat files in the prefab folder. It is extremely important to note here that this is not the final folder the enemies are drawn from in game.

type in the name of the enemy you want to load, and you should get a list of levels for that enemy. This is because different levels for the enemy have different ability configurations and equipment configurations. As such, if you plan on modifying an enemy, you'll want to make the same changes consistently on the future levels after the levels you edited said enemy, unless you just want to change just that level of the enemy.

Also of note is that the enemy levels programmed aren't the only levels available to such enemy-for example, enemies can be level 2 or 4, despite not showing up on the prefab.

So you've got your enemy loaded up. A model of your enemy should appear on screen, along with a gray character attributes-style bar on the right, listing such things as name, abilities, equipment, and more esoteric data.

what next?

You can change enemy abilities:

opening up the abilities window will reveal a list of enemy abilities, including abilities that are not listed in the current game, such as Ninja and Vision. You can't add points to those.

you can click on a given ability to add one point to it, and confirm it by hitting ok. Please note that there are no limits as to the points you assign-if you want to make a level one enemy that has maxxed stats, you are free to do so, though anybody else playing your game will probably hate you for it.

You can also click on the x button next to the initial abilities tab to 'empty' out the ability selections.

You can change equipment

this is as simple as opening up the equipment menu and dragging around the appropriate configurations. Enemy AI as of this time does not use consumables, but they do reload as necessary. Note that generally speaking, equipping equipment has the same ability restrictions as in the game.

you can change the enemy name

Look at the display name tab on the right. it should say something, like, 'archer', or 'bandit'.
When a character spots that enemy in game they will say "I see an archer", even though the enemy will be named 'archer'. The way it is coded is that you put in the grammer-necessary words like a/an for purposes of characters spotting said enemy, though just the latter word like bandit or archer is listed as the character's name. An interesting programming shortcut.

you can change some other stuff
Tell me what you did and what effect it had. I haven't done much else than this. Changing the mesh the character is using currently changes what abilities the character has access to, as well as whether or not they can use equipment (if a monster).

After you've made your edits, hit the ok button at the bottom of that gray sidebar on the right.
This is necessary to ensure that your changes are savable.

After that, you still need to save your changes.

Again, under the edit bar, click on save prefab, and navigate through the enemy folder, and then the sub folders to find the .dat file you're overwriting, assuming that this is what you want to do. Be sure and remember which level you edited prior to saving over another .dat file.

What next?

As I mentioned in the beginning, the prefab folder is *not* the same folder that enemies are drawn from in-game. If you want your modified enemy to show up, then you need to replace the old .dat file or files in the enemy folder/ whatever enemy you're modifying with the prefabs you edited. I typically edit the entire set of levels to the extent I want to, then simply drag and replace the older folder with the prefab one.

Now, the modifications you've made should show up in game.



Adding An Enemy
There's a few additional steps necessary to create an entirely new enemy to fight. My personal suggestion, at least for the first time, is to copy an existing enemy directory and enemy.dat files, and make the changes you want to the enemy level by level. It's tedious but it will give you an idea of how enemies progress in power. Don't forget that changes are made in the prefab folder, with the final version to be copied over to the Enemies subfolder.

The following steps are necessary to ensure that the enemy appears in game:

1) rename the directory and enemy.dat files. They should be the same name. The enemy.dat files should continue in the same [enemyname][level].dat format. Copy them into the enemy subfolder, of course.

For example, I created an alternate Bandit to fight. I copied the directory, then renamed it banditalt, and all instances of bandit were replaced with banditalt in the dat files.

2) In the Enemies subfolder, there is an enemies.xml file. Crack this sucker open.

You'll see a series of entries like the following:

<enemy>
<directory>grenadier</directory>
<boss_name>The General</boss_name>
<theme>Action</theme>
<keyword>bomb</keyword>
</enemy>

Copy and paste to create a new entry. Edit it as follows:


<Directory> tells the game which directory the enemy will be pulled from to fight. This should be the same name as the folder your new enemy is in.

<boss_name> I've never found a reason to deviate from the examples already shown here. As such, I have no idea what this is for.
<theme> Tells the game which themed zone this enemy should appear in. If you want the enemy to appear in multiple zones (not sure why, but hey, you're the one modding), I suggest you create multiple entries for that enemy and have unique themes for each entry.
<keyword> I'm not *entirely* certain what this does. It's clear that putting Boss here should keep the enemy from spawning normally. I *believe* the game distributes enemies randomly from among the various types of enemies you can fight in a more or less even pattern-As in, here's a few melee types, here's a few ranged types, and here's a few bomb types in a given level. I don't think it influences the enemy's AI.

Please note that some enemies, such as the Knight and Wizard have an additional entry between the <enemy> and </enemy> tags, like this: <min_level>5</min_level>
This tells the game that this particular enemy is not to apper until the Zone the player is in has *some* enemies of that level or higher.

In addition, while not part of the default experience, you can add the folllowing tag:
<health_boost>2</health_boost>
which doubles the health of the listed enemy in its basic incarnation. (I don't know if the health would be increased again in the event that that enemy is selected as the boss of a given 'miniboss' castle).

3) Add a taunt for the new enemy. See the 'Little Edit's section for more details.

After these steps, you should be good to go.
Little Edits: Taunts and NPC dialogue
Taunts

A taunt is the line of dialogue an Enemy says when it first spots you.

Go to the Taunts folder, and open the xml file. It should be fairly self evident from here, but you look under the directory name of the enemy you're modifying and simply replace the description.

If you're adding a taunt as a result of a new enemy, I'd simply copy and past one of the existing taunts, change the directory to the directory you're pulling from (the subfolder in the enemy folder which contains the .dat files of your new enemy) and then edit the appropriate description.

Villager Dialogue

Open up the Dialogue folder. Open up the base XML file inside. You'll notice that both that the dialogue is broken down into themes (Action, Platformer, Horror, Adventure), and also that the dialogue is identical for each theme. I happen to think this is a ripe opportunity to either personalize your game a bit, or if you're making your own mod, have the villagers describe new items or effects in a given zone.





11 条留言
Naderz 2019 年 4 月 9 日 下午 4:28 
kk
michaelullom  [作者] 2019 年 4 月 9 日 下午 4:07 
Naterz, I'll work on that! I keep meaning to bug the maker of this game on a few minor asks, but I don't want to interrupt his schedule on Ecosystem too much.
Naderz 2019 年 2 月 27 日 下午 6:39 
Would love to know how to make new items lol
michaelullom  [作者] 2017 年 12 月 7 日 下午 1:37 
JTIZZLE-I haven't tinkered with the hero characters, or their starting inventory. I believe that there are individual files for the heroes, as same as the monsters, but it has been some time since doing so.

New Items should be easy to do, but it's been over six months since I've taken a look at the files. After I'm done with the move, I'll get back to you on this but it will take a couple of weeks. It should be easy to do-its pretty plug and play and if you follow the guide on modding an item, it's simple work to just cut and paste that item's info and put it in again as a duplicate, and rename it. But there may be other factors, and I'd want to double check.
Sloane Ranger 2017 年 12 月 5 日 下午 2:58 
how would one go about creating a new hero character/editing a previous one? what about changing the player's starting inventory? and (last one, I promise) what about adding a new item?
BatsuneMiku 2016 年 7 月 15 日 下午 2:19 
Sure! I'm slow but will do my best. I'm decent at pixel art, and have an understanding on how texturing is done. It's understandable that life gets you busy as I have been out of the modding/art a while too.
michaelullom  [作者] 2016 年 7 月 15 日 下午 1:37 
New Themes, such as new lands and bosses? NoirEater, in frank honesty I'm not sure. I wouldn't mind putting more time in the guide and my mods here, but due to personal life issues I took a break.

Would you be interested on working on this with me? I'd love to see more information accessible to the public on Enemy!
BatsuneMiku 2016 年 7 月 15 日 上午 7:54 
Is there a way to add new themes? My friend and I adore this game! There are a few other questions. Should I make a new post?
michaelullom  [作者] 2016 年 1 月 30 日 下午 1:02 
Final, I haven't tried in all honesty. I suspect so, but haven't looked.
FinalCPU 2016 年 1 月 27 日 下午 5:17 
Is there a way to modify display settings inside of the game files? Like a config file?