yunings 发表于 2012-7-5 18:14:47

Simple Way to Add New Towns Under Era 2.3 (Dragon Peaks example)

E文不好的童鞋,请点击下面的链接查看翻译:http://www.wogcn.net/viewthread.php?tid=37254&page=2&fromuid=97#pid392576
感谢 renlinfeng 童鞋的给力翻译!
==================================================================================================================
Original Posted @ HCby JimV(http://heroescommunity.com/viewthread.php3?TID=37767)

This post will describe a simple mod which adds a new Town without eliminating an existing Town. The main reason I am posting it is as a template (or just an idea) for others to consider when adding new Towns.

Download Link:https://www.box.com/s/a8a7accc0b5436638aa5

This mod adds a new town, "Dragon Peak", via wogification under Era 2.3.The town is slightly similar to a Heroes II Dragon City, in that you have to fight dragons to win it, and it produces dragons weekly and 1000 gold daily. It contains Fairie, Rust, Crystal, and Azure Dragons.

INSTALL:   For this map you have to install the Heroes 3 "Era 2.3" addon, which you can download from http://heroescommunity.com/viewthread.php3?TID=37208 - see the installation instructions there. Note:this mod will not work under Era versions prior to 2.3.

After installing Era 2, extract the zip file directly into your Heroes 3 - Era 2/Mods folder.The result should have this structure:
(Heroes 3 Era 2 Folder - where you installed Era 2 over Heroes 3 SoD or Heroes 3 Complete)
    ... (subfolders to Heroes 3)
    Mods (a subfolder to Heroes 3)
      DragonPeaks (subfolder to Mods)
            Data (subfolder to DragonPeaks)
            Maps (subfolder to DragonPeaks)
      ... (other Mods subfolders: Yona, WoG, etc.)
    ... (other Heroes 3 subfolders and files)

The DragonPeak mod can be used to add a new feature (new Town) to random maps.It can also be used in custom maps, by either wogifying them with the DragonPeaks mod enabled, or with the DragonPeaks.erm script (DragonPeaks/Data/s) placed in a Timed Event using the Map Editor.Custom DragonPeak cities can be added in the Map Editor by adding Rampart Towns whose names begin with "Dragon Peak", e.g. "Dragon Peak NW".Randomly added DP Towns will be named "Dragon Peak 1", "Dragon Peak 2", etc., so do not name a custom DP town with a number which will match one of these.That is, if you intend to add 8 randomly-placed DP Towns (using the script menues at the start of a game), number your custom DP Towns as "Dragon Peak 9" or higher (or do not use numbers in the name).

At the start of a game, DragonPeak.erm will attempt to add DP Towns to the map. Due to the large footprint of a Town, most random maps will not have enough clear space in which to add DP Towns.The script will ask if you wish to remove 1/3 of the map's resource piles, in hopes of clearing spaces for random placment.If the script cannot find space for a random placement (after about 200 random tries), it will then ask if you want to convert a neutral Town to a DP.

Mod Method:

I used DefPreview, H3DeftOOL, and MMARCHIVE (thanks to Grayface) to manipulate DEF and PCX files.I used GIMP to modify graphics. Bersy's new "RedirectFile" option, as well as other Era options, were crucial to the development.

The plan was to make a new Town type out of Rampart Towns, without eliminating the original Rampart Towns, by changing Town properties and graphics each time a Rampart Town named "Dragon Peak xx" is entered.

Towns whose names begin with "Dragon Peak" are changed to the new type, and other Rampart Towns are left unchanged.

Mod Details:

A Town can be entered by three methods (usually):

1) A Hero visits the Town (!?OB trigger).

2) The player clicks on a Town in the Town List on the right side of the Adventure Screen (!?CM5 trigger).

3) The player clicks on a Town in the Town List in the Town Screen (!?CM1 trigger).

All of these events can be detected with ERM triggers and used to implement Town changes.

However, there is one limitation, under event 3):it seems the Heroes 3 program does not reload Town graphics (DEF's and background PCX) when transferring from one Ramparts Town Screen to another.So transferring from a Dragon Peaks Town to an ordinary Rampart Town via the Town Screen Town List leaves the modified DP graphics in place, and vice-versa.

Therefore the script checks for this type of transfer and prevents it.(You can transfer from a Dragon Peak Town to a standard Rampart (e.g., "Rainhaven") by transferring from the DP to another Town type (e.g., Castle), and then transferring from the Castle to Rainhaven.)

A Dragon Peaks Town is a simple town, with only four Creature Dwellings and an unmodifiable Town Hall.The following scriplet shows how their new graphics are implemented:

!?FU6150&-413; set DP Town Cr's
!!UN:T1/2/0/134;
!!UN:T1/3/0/135;
!!UN:T1/4/0/133;
!!UN:T1/6/0/132;
* change "TB" and "TO" to "JV"
!!SN:L^Era.dll^/?y1; y1=handle
!!SN:Ay1/^RedirectFile^/?y2; y2=FU address
!!SN:Ey2/1/^TBRMDW_2.def^/^JVRMDW_2.def^;
!!SN:Ey2/1/^TBRMDW_3.def^/^JVRMDW_3.def^;
!!SN:Ey2/1/^TBRMDW_4.def^/^JVRMDW_4.def^;
!!SN:Ey2/1/^TBRMDW_6.def^/^JVRMDW_6.def^;
!!SN:Ey2/1/^TBRMEXT2.def^/^JVRMEXT2.def^;
!!SN:Ey2/1/^TBRMEXT3.def^/^JVRMEXT3.def^;
!!SN:Ey2/1/^TBRMHAL2.def^/^JVRMHAL2.def^;
!!SN:Ey2/1/^TORDR1AA.PCX^/^JVRDR1AA.PCX^;
!!SN:Ey2/1/^TORELF1.PCX^/^JVRELF1.PCX^;
!!SN:Ey2/1/^TORHAL2.PCX^/^JVRHAL2.PCX^;
!!SN:Ey2/1/^TORPEG1A.PCX^/^JVRPEG1A.PCX^;
!!SN:Ey2/1/^TORTRE1.PCX^/^JVRTRE1.PCX^;
!!SN:Ey2/1/^tbrmback.pcx^/^JVrmback.pcx^;
!!IF:V413/1; prevent redirected redirects

!?FU6151&413; restore Rampart Town Cr's
!!UN:T1/2/0/18;
!!UN:T1/3/0/20;
!!UN:T1/4/0/22;
!!UN:T1/6/0/26;
* undo all redirects
!!SN:L^Era.dll^/?y1; y1=handle
!!SN:Ay1/^RedirectFile^/?y2; y2=FU address
!!SN:Ey2/1/^^/^^;
!!IF:V413/0; unflag redirects

The "JV" graphic items are stored in h3sprite.pac in DragonPeaks/Data.

When a Hero visits a Town, this scriplet makes the necessary changes:

!?OB98/1; Hero enters Rampart Town
!!CA998:N?z3; get Town Name
!!VRz2:M1/z3/0/11; get substring "Dragon Peak" if Town is a DP
!!FU6150&z2=z709/-413:P;
!!FU6151&z2<>z709/413:P;

(Similar scriplets are used for the other two entry methods.)

That is the basic method. See other tutorials (here and elsewhere) to learn how to use the Grayface tools, GIMP, ERM, and Era.

Dragonpeaks.erm uses these (unclaimed, as far as I know) items:z709, FU6150-6160, flags 411 & 413 (v1-v10, z1-z10 temporarily).

Screenshots:

The new Town Screen:

http://i1224.photobucket.com/albums/ee380/JimVog/DP_Aft_1.jpg

The day-one menu:

http://i1224.photobucket.com/albums/ee380/JimVog/DP_NoOfDPs.jpg

The resource-pile option:

http://i1224.photobucket.com/albums/ee380/JimVog/DP_RemoveRP.jpg

The option to convert neutral towns if random placement is limited by the lack of clear space:

http://i1224.photobucket.com/albums/ee380/JimVog/DP_ConvertNeutral.jpg

A randomly-placed Dragon Peak:

http://i1224.photobucket.com/albums/ee380/JimVog/DP_RandomlyPlaced.jpg

A converted neutral Town (on a random map):

http://i1224.photobucket.com/albums/ee380/JimVog/DP_ConvertedTown.jpg

The download package contains a custom map and a random map which can be used to test the mod.The custom map ("Hint Test") is just a test vehicle, not a playable map.

兽哥哥 发表于 2012-7-5 18:20:53

翻译官快快现身,:shufu:

兽哥哥 发表于 2012-7-5 18:21:36

第一个图是什么意思?四大龙都悬空了?

兽哥哥 发表于 2012-7-5 18:22:45

就看懂一个下载地址,不知道是干嘛地?;ym;

yunings 发表于 2012-7-5 18:24:01

该主题的大意是:在ERA2.3平台下,可以通过添加一些资源来追加新的种族、城镇,这个Dragon Peak就是一个样板。它是一个类似要塞的新型“城镇”,可以通过占领它来招募野外的四种龙,同时每天提供1000大洋的收入。是不是很棒?

兽哥哥 发表于 2012-7-5 18:25:25

追加新的种族?不需要MOD支持吗?还是说是一种玩法?等下叫翻译官来看看。

kswdiy 发表于 2012-7-5 18:26:05

一个使用添加 城镇的
era2.3新特性
话说这个需要erm和 mod这2个方面技术 呵呵

虽然快一步 比云大 看过了....

yunings 发表于 2012-7-5 18:29:34

当然需要!作者给我们通过样板,提供了一个新的追加方式。新的生物模型,在ERA下,也应该是可以添加成功的,只能说ERA太强大,赋予了WoG全新的生命力。

renlinfeng 发表于 2012-7-5 18:35:12

;oweojs; 呵呵,KS比我懂多了。简单的说ERA就是为了WOG提供了无限的创造性和可能性,一切都可以靠外置MOD来解决,但又不是传统意义上的替换;oweojs;

无心云 发表于 2012-7-5 18:38:45

哈哈,那不是我们这边的MOD,和ERM大师们的空间更广阔了,以前不能做或者很难做的事情都应该变得更可能更容易了吧
(话说ERM那边转型可能有点痛苦)

;oweojs;

兽哥哥 发表于 2012-7-5 18:39:37

回复 9# 的帖子

你大概翻译一下啊,就不要劳烦我出动谷歌了。那个下载的是什么?

renlinfeng 发表于 2012-7-5 18:45:47

回复 11# 的帖子

;lan; 下载地址就是Jim Vogen做的MOD样本啊,下面就介绍这个MOD了,给大家参考下的。实在需要等等吃完饭翻译下;lan;

兽哥哥 发表于 2012-7-5 19:12:24

搞了半个多小时,终于把这两个帖子转到了游家,贴吧也转了一个

风侠 发表于 2012-7-5 20:21:59

下一个轰动的MOD会是什么呢?老外有没有正在进行的大作?

天之河 发表于 2012-7-5 20:46:45

这分辨亮瞎偶滴双眼;ooru;
强烈期待不用补丁就能享受到的高清;aoleof;

renlinfeng 发表于 2012-7-5 23:19:30

;lan; 眼睛眯了会儿就睡到10点,还是明天搞定吧;han;

灰狼王子 发表于 2012-7-5 23:56:34

WOG的又一个春天来临了

这个超给力啊,可以预见WOG的又一个春天要来了:good_job: ;gaxing;

贤知有您 发表于 2012-7-6 08:18:00

看来这个!!SN 语句不是一般的强大。
很多额外的命令都是通过SN来缔造的。

兽哥哥 发表于 2012-7-6 10:02:35

原帖由 hanter007 于 2012-7-6 08:18 发表 http://www.h3wog.com/images/common/back.gif
看来这个!!SN 语句不是一般的强大。
很多额外的命令都是通过SN来缔造的。 这就叫内行看门道,我们就看热闹

renlinfeng 发表于 2012-7-6 10:29:55

简单的方法在ERA 2.3中添加新的城镇(以下为龙崖的样板)
原帖出自HC论坛的JimV(http://heroescommunity.com/viewthread.php3?TID=37767

这个帖子将会描述如何在不抹除其他已存在的城镇的情况下添加一个简单的新城镇MOD。我发这个帖子的主要意图就是能够为了在添加新城镇这块上给大家抛砖引玉。

龙崖MOD样板下载地址:https://www.box.com/s/a8a7accc0b5436638aa5

这个MOD包括了一个新的城镇,“龙崖岭”,通过ERA 2.3实现WOG化。这个城镇有点像英雄无敌2中的龙城,之中你必须先与龙群战斗取胜,然后它在每周都会生产龙族单位以及每日给你带来1000的黄金。其中包含了紫龙,毒龙,水晶龙和圣龙。

安装方法:首先你必须安装ERA 2.3,你可以在http://heroescommunity.com/viewthread.php3?TID=3720这个地址下载,然后阅读相关的介绍。注意:这个MOD必须在ERA 2.3的版本下使用。

安装了ERA之后,直接解压压缩包内的文件到H3的目录-ERA 2/Mods folder文件夹下。然后应该是以下的情况:
(Heroes 3 Era 2文件夹 - 安装ERA 2之后生成的文件夹)
。。。Mods (子文件夹)
         DragonPeaks (Mods文件夹的子文件夹)
         Data (Dragonpeaks的子文件夹)
         Maps (Dragonpeaks的子文件夹)
。。。。(其他MOD文件夹的子文件夹: Yona, WoG, 等等。)
。。。。(其他英雄无敌3的子文件夹和文件等等)


龙崖岭MOD可以在随机地图中添加一个新的元素(即新城镇)。当然同样可以用在玩家定制的地图上,可以在龙崖岭mod正常可用的状态下(使用mods manager)wog化地图来实现,或者使用地图编辑器将DragonPeaks.erm脚本(DragonPeaks/data/s文件夹下)放置到地图事件中来实现。玩家可用通过地图编辑器来添加龙崖岭城镇,方法是使用原来的壁垒城添加,不过此刻名字会是“Dragon Peak”,比如说,“Dragon Peak NW”。随机添加龙崖岭城镇则会被命名为“Dragon Peak 1”,“Dragon Peak 2”,等等。所以不要将自己添加的龙崖岭城镇命名为那些数字。事实是,如果你打算添加8个随机放置的龙崖岭城镇(通过使用游戏开始前的菜单选择),那么你自己添加的龙崖岭城镇的名字就会变成“Dragon Peak 9”亦或是更高(要么就不要用数字命名)。

在游戏开始之前,DragonPeak.erm会尝试在地图中添加龙崖岭城镇。由于一座城镇所占的体积过于巨大,大多数随机地图都没有足够的空余空间来添加龙崖岭。脚本会询问你是否同意删除三分之一的地图资源及建筑,以此来肃清空间添加城镇。如果脚本无法找到合适的空间来添加一处随机的城镇(大概在200次随机尝试之后),那么它会询问你是否想要将一个中立的城镇转换为龙崖岭。

MOD制作方法:

我使用了DefPreview, H3DeftOOL和MMARCHIVE来处理DEF和PCX文件。使用GIMP来修改图像。Bersy所写的新的“重置文件”选项,以及其他的ERA选项,对WOG起到了至关重要的发展作用。

计划是在壁垒城下制作一种新的城镇类型,而并不抹除原始的壁垒城,通过改变城镇的属性和图像在每一次壁垒城被输入命名为“Dragon Peak XX”时。

于是那些初始名为“Dragon Peak”的城镇变换为了新的类型,而其他的壁垒城依旧保持不变。

MOD细节:

城镇有三种方法进入(通常情况下):

1) 英雄访问(!?OB trigger).

2) 玩家在右侧的冒险界面城镇菜单中点击选择 (!?CM5 trigger).

3) 玩家在城镇界面的城镇菜单中点击选择(!?CM1 trigger).

所有的这些事件都能被ERM触发器接受来执行城镇的变化。

不过,这之中有一个限制:看起来英雄无敌3的程序并不能重新加载城镇的图像(DEF文件和PCX背景)当从一个壁垒城的界面转换到另一个的时候。所以当一个龙崖岭城镇通过城镇界面的菜单转换到原始的壁垒城时会留下修改过的龙崖岭的图像,反之亦然。

因此脚本会检查这种转换方式并且防止其发生。(如果你想从龙崖岭转换到普通的壁垒城可以先从龙崖岭转换到别的城镇,比如说城堡,然后再由城堡转换到壁垒城。

龙崖岭城镇是一个简易的城镇,只有4种生物巢穴和一个不变的市政厅。以下的脚本显示这些i型内的图像是如何执行的:

!?FU6150&-413; set DP Town Cr's
!!UN:T1/2/0/134;
!!UN:T1/3/0/135;
!!UN:T1/4/0/133;
!!UN:T1/6/0/132;
* change "TB" and "TO" to "JV"
!!SN:L^Era.dll^/?y1; y1=handle
!!SN:Ay1/^RedirectFile^/?y2; y2=FU address
!!SN:Ey2/1/^TBRMDW_2.def^/^JVRMDW_2.def^;
!!SN:Ey2/1/^TBRMDW_3.def^/^JVRMDW_3.def^;
!!SN:Ey2/1/^TBRMDW_4.def^/^JVRMDW_4.def^;
!!SN:Ey2/1/^TBRMDW_6.def^/^JVRMDW_6.def^;
!!SN:Ey2/1/^TBRMEXT2.def^/^JVRMEXT2.def^;
!!SN:Ey2/1/^TBRMEXT3.def^/^JVRMEXT3.def^;
!!SN:Ey2/1/^TBRMHAL2.def^/^JVRMHAL2.def^;
!!SN:Ey2/1/^TORDR1AA.PCX^/^JVRDR1AA.PCX^;
!!SN:Ey2/1/^TORELF1.PCX^/^JVRELF1.PCX^;
!!SN:Ey2/1/^TORHAL2.PCX^/^JVRHAL2.PCX^;
!!SN:Ey2/1/^TORPEG1A.PCX^/^JVRPEG1A.PCX^;
!!SN:Ey2/1/^TORTRE1.PCX^/^JVRTRE1.PCX^;
!!SN:Ey2/1/^tbrmback.pcx^/^JVrmback.pcx^;
!!IF:V413/1; prevent redirected redirects

!?FU6151&413; restore Rampart Town Cr's
!!UN:T1/2/0/18;
!!UN:T1/3/0/20;
!!UN:T1/4/0/22;
!!UN:T1/6/0/26;
* undo all redirects
!!SN:L^Era.dll^/?y1; y1=handle
!!SN:Ay1/^RedirectFile^/?y2; y2=FU address
!!SN:Ey2/1/^^/^^;
!!IF:V413/0; unflag redirects

The "JV" graphic items are stored in h3sprite.pac in DragonPeaks/Data.

When a Hero visits a Town, this scriplet makes the necessary changes:

!?OB98/1; Hero enters Rampart Town
!!CA998:N?z3; get Town Name
!!VRz2:M1/z3/0/11; get substring "Dragon Peak" if Town is a DP
!!FU6150&z2=z709/-413:P;
!!FU6151&z2<>z709/413:P;

(Similar scriplets are used for the other two entry methods.)

这只是一个基础的方法。多看看其他的指导以便更好的学习如何使用Grayface工具,GIMP ERM和ERA。

Dragonpeaks.erm使用了这些项目:z709, FU6150-6160, flags 411 & 413 (v1-v10, z1-z10 temporarily).

新城镇界面


第一天的菜单选择


资源建筑清除选项


空间不足时的转换中立城镇选项


随机放置的龙崖岭


转换的中立城镇(随机地图下)


下载包中包含了一张定制的地图与随机地图以用来测试MOD。定制的地图("Hint Test")只是一种测试的手段,并不具备可玩性。

[ 本帖最后由 renlinfeng 于 2012-7-6 10:40 编辑 ]
页: [1] 2
查看完整版本: Simple Way to Add New Towns Under Era 2.3 (Dragon Peaks example)

捐赠