- 积分
- 9245527
- 威望
- 181
- 魅力
- 183
- 经验
- 9232314
- 热心度
- 17
- 注册时间
- 2005-11-5
- 最后登录
- 2024-12-3
- 主题
- 567
- 回帖
- 5774
- 精华
- 42
- 阅读权限
- 200
成长值: 30850 TA的每日心情 | 无聊 2020-5-27 00:09 |
---|
签到天数: 24 天 连续签到: 2 天 [LV.4]狂狼人
管理员
精灵奇侠
- 积分
- 9245527
|
E文不好的童鞋,请点击下面的链接查看翻译:http://www.wogcn.net/viewthread.php?tid=37254&page=2&fromuid=97#pid392576
感谢 renlinfeng 童鞋的给力翻译!
==================================================================================================================
Original Posted @ HC by 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; [level 2 no upg - Faerie Dragon3]
!!UN:T1/3/0/135; [level 3 no upg - Rust Dragons]
!!UN:T1/4/0/133; [level 4 no upg - Crystal Dragons]
!!UN:T1/6/0/132; [level 6 no upg - Azure Dragons]
* 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:
The day-one menu:
The resource-pile option:
The option to convert neutral towns if random placement is limited by the lack of clear space:
A randomly-placed Dragon Peak:
A converted neutral Town (on a random map):
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. |
|