Настройка мода к Sandbox 2

Материал из CryWiki Russia

Версия от 21:30, 9 апреля 2011; DCamer (Обсуждение | вклад)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Содержание

Set up a Mod in Sandbox2

Index

Overview

In this document you will learn how to correctly set up your mod so you can work with it independently from the core Crysis installation. In addition this document includes a description how to prepare your mod for distribution and get it working for the Crysis Mod Loader that is implemented into Crysis since patch 1.2, and Crysis Wars, since patch 1.4.

Working with Mods

Getting started

The first step in creating a new modification for Crysis is to open a file browser (Windows Explorer for example) and find where Crysis is installed. (Usually C:\Program Files\Electronic Arts\Crytek\Crysis) There you’ll have to create a subfolder called «Mods», in which you need to create your mod folder.

For example, if your Mod is named “mymod”, create a new folder with that name. The path should look something like this:

Crysis/Mods/MyMod/

Mod folder structure

Depending on what you want to change in your mod, you need to create appropriate subfolders within your mod folder. If a folder doesn’t exist, then the assets from your default game folder will be loaded.

The structure within the Mod Folder needs to be the same as in the root game folder. So, if you wanted to add new objects to your Mod, create a subfolder called “Game”, then another folder called “Objects” where you can place your custom objects into. The path should look like this:

Crysis Root Directory/Mods/MyMod/Game/Objects/

Примечание:
Notice that in mod structures, we do not use .pak's. Instead, you need to create a folder named the same as the .pak. (For Example Objects.pak is Mods/MyMod/Game/Objects/.

Here is a full list of how the folder structure inside your mod should look like: (It doesn’t have to have all these directories. You only need directories for the files you have changed.)

Crysis/Mods/MyMod/Bin32
Crysis/Mods/MyMod/Code/ (исходный код на C++)
Crysis/Mods/MyMod/Game/
Crysis/Mods/MyMod/Game/Animations/
Crysis/Mods/MyMod/Game/Entities/
Crysis/Mods/MyMod/Game/Fonts/
Crysis/Mods/MyMod/Game/Levels/
Crysis/Mods/MyMod/Game/Levels/Multiplayer/
Crysis/Mods/MyMod/Game/Localized/
Crysis/Mods/MyMod/Game/Libs/
Crysis/Mods/MyMod/Game/Materials/
Crysis/Mods/MyMod/Game/Music/
Crysis/Mods/MyMod/Game/Objects/
Crysis/Mods/MyMod/Game/Prefabs/
Crysis/Mods/MyMod/Game/Scripts/
Crysis/Mods/MyMod/Game/Shaders/
Crysis/Mods/MyMod/Game/Sounds/
Crysis/Mods/MyMod/Game/Textures/

Loading a Mod in the Editor

To load your Mod in the Sandbox Editor, you need to run the Editor.exe with a command line parameter. Be sure you have the editor installed properly, and then follow the steps below:

  • Go to your Crysis root directory and enter either the “Bin32” or “Bin64” folder depending on your installation.
  • Right click on the Editor.exe and create a shortcut of it in any directory.
  • Go to the directory where you placed the new Editor shortcut.
  • Right click on the shortcut, and choose Properties, and then add the command -mod mymod to the Target line.

The target line should now look somewhat like this: Sandbox ModSetupSandbox image001.jpg

The Editor will then load up with your mod files (such as new assets), or the default game files if no other files exist.

Loading a Mod in Crysis

In the following chapter, you will find an alternative method of loading modifications in Crysis if you do not want to use the Mod Loader that is embedded ingame. (In Patch 1.2> in Crysis and Patch 1.4 > in Crysis Wars) To launch Crysis directly with having a mod loaded, you need to run the Crysis.exe with a command line parameter.

  • Go to your Desktop where a Crysis shortcut should be located. (Or create one by finding the 64bit or 32bit .exe in Crysisroot/Bin32 or Bin64.)
  • Right click on this shortcut and choose Properties add the comamnd -mod mymod to the targetline.

The target line should now look somehow like this:

Sandbox ModSetupSandbox image002.jpg

The game will then launch by having your mod loaded as well. You can deactivate it ingame via the Mod Loader if you wish so.

Preparing a Mod for distribution

Re-Packing your Mod
In order to optimize your modification for distribution it is always good to pack the folders inside your mod in order to minimize the size and to keep everything easily structured for the community.

This is a list of which folders should be put into one new .pak file:

Animations.pak
Animations

GameData.pak
Entities
Fonts
Libs
Materials
Prefabs
Scripts

Music.pak
Music

Objects.pak
Objects

Shaders.pak
Shaders

Sounds.pak
Sounds

Textures.pak
Textures

Before you start creating such a .pak file be sure to have a ZIP or RAR program (such as WinZip, 7Zip or WinRar) installed. To create such a .pak file please follow these steps:

1. Go to your mod folder that is located inside _‹root directory of your Crysis Game›Mods\_
2. Enter the “game” folder and select some folders you want to put into a .pak file.
3. Right click on one of the folders and select “add to archive…”.
4. Define the name of the file (e.g. GameData or Objects) and use the normal .zip compression. (note: other compressions won’t work properly)
5. Replace the .zip ending by .pak and create the archive.

List Mod in the ingame Mod Loader

To have your mod being listed ingame in the mod loading menu you need to prepare a specific .xml file that needs to be stored in the following directory:

Crysis Root Directory/Mods/MyMod/

The file is called info.xml and includes the following content that is important to let the game know more about the mod.

<?xml version="1.0" encoding="utf-8"?>
<Mod Name="<yourmod>" Version="<0.0>"  Screenshot="<jpg file>" Description="<description>" url="<URL>"/>

The following is a description of what kind of information can be put into this file:

An example of an modloader screenshot (512x384)
Mod Name 	= "<yourmod>" 		//put in the name of your mod
Version		= "<0.0>"		//add the version number of your mod
Screenshot	= "<jpg file>" 		//
Description	= "<description>"	//description of the mod
url		= "<URL>"		//URL to your mod/mod team's website

It is recommended to always implement a small banner of your mod that is getting displayed automatically when selecting your mod ingame via the Mod Loader. It helps the community to identify your mod easier and also looks nice and more professional.

To add an image place a screenshot with the maximum size of 512x384 in your mod folder and add the full name of it to the Screenshot description inside the info.xml file.

See Also