The 3rd Age

Battle of the Pelennor Fields

Battle of the Pelennor Fields

Six new factions. Controle any of the races of man that participated in the War of the Ring.

Button for The 3rd AgeButton for The Dwarf HoldsButton for The Elven AllianceButton for Helm's Deep Last HopeButton for GothmogtheOrcButton for BFME+Button for The Four AgesButton for HDR HeadquartersButton for Middle Earth CenterButton for Project Perfect Mod

Become an affiliate!

   

Quick Lists

Top Rated Popular New Updated Last Comments Users

Register and log in to move these advertisements down

Adding Morthond Bowmen into a mod

Avatar of robnkarla

robnkarla

Category: Code
Level: Intermediate
Created: Monday July 2, 2007 - 11:35
Updated: Saturday June 27, 2009 - 18:26
Views: 17014
Summary: Guide from start to finish on creating a mod that adds a single unit into the game

Rating

Staff says

4.7

Members say

4.4

Average

4.5/5.0

23 votes

Page 1 2 3 4 5 6 7 8 9 10
War of the Ring and text strings:

There are two areas that we will modify in order to get the unit buildable in WotR.

1) Open up livingworldbuildableunits.inc in the \data\ini\campaigns\common\ folder.

2) Look for GondorRangerArmy.
(The blocks of code that you are looking at now are the definitions of the units in terms of the Livingmap. Each LivingWorldPlayerArmy is a type of unit that can be built or used in the livingworld = WotR.

3) Copy and paste the gondorranger block right below.

4) For the name, change it to MorthondBowmanArmy

5) Under ThingTemplate, change this to MorthondBowmanHorde

6) Your livingworldplayerarmy should look like:
              
Code

LivingWorldPlayerArmy
    Name = MorthondBowmanArmy
    DisplayNameTag = LWA:MenOfTheWest
    ArmyEntry
        ThingTemplate = MorthondBowmanHorde
        Quantity = 1
    End
End


Now that we have the units available within the living world, we are going to add them as a buildable unit.

1) Open livingworldbuildings.ini from the \data\ini\ folder.

2) Look for the following code/area:
              
Code

LivingWorldBuilding LWB_GondorBarracks


3) From here scroll down to the BuildingNugget SpawnArmy area and look for:
              
Code

ArmyToSpawn
    PlayerArmy = GondorRangerArmy
    Icon = MoWArmyIcon
    IconSize = Small
    PalantirMovie = Palantir_509
    ConstructButtonImage = BGArcheryRange_Rangers
    ConstructButtonTitle = CONTROLBAR:LW_Unit_GondorRangerHorde
    ConstructButtonHelp = CONTROLBAR:LW_ToolTipBuild_GondorRangerHorde
    BuildTime = 1 ; 2
End


This code defines which objects can be built from the living world barracks as well as which icons/images to use and how long it takes to build.

3) Change the PlayerArmy to MorthondBowmanArmy that we created

4) For the button image, change this to MorthondBowmanButtonImage

Now your unit can be built in the WotR!

1) Open up the lotr.str file and add the following lines at the end:
              
Code

OBJECT:MorthondBowman
"Morthond Bowman"
END

OBJECT:HordeMorthondBowman
"Morthond Bowman"
END

CONTROLBAR:LW_Unit_MorthondBowmanHorde
"Morthond Bowman Battalion"
END

CONTROLBAR:ConstructMorthondBowmanHorde
"&Morthond Bowman"
END

CONTROLBAR:ToolTipBuildMorthondBowmanHorde
"Requires Level 3 Archery Range \n Strong at Range"
END

CONTROLBAR:LW_ToolTipBuild_MorthondBowmanHorde
"Unit Type: Elite Archer\nStrong at Range\n"
END


Now you could do this as you go along. The easiest way to do it is just copy and paste then rename the text-strings from the ranger, but I decided to do them all at once. (That way all of the text-strings are gouped together without having to worry about it.)


4) So now open up the morthondbowman.ini.

5) For display name, change this to
              
Code

OBJECT:MorthondBowman


6) Close and open the souternfiefdomshordes.ini

7) For DisplayName, DisplayNameStrategic, & DescriptionStrategic, change the values to:
              
Code

DisplayName = OBJECT:HordeMorthondBowman

DisplayNameStrategic = CONTROLBAR:LW_Unit_MorthondBowmanHorde

DescriptionStrategic = CONTROLBAR:ConstructMorthondBowmanHorde


8) Close the file and open up the commandbutton.ini file.

9) Locate your Command_ConstructMorthondBowmanHorde

10) Change the textlabel and descriptlabel to:
              
Code

TextLabel = CONTROLBAR:ConstructMorthondBowmanHorde
DescriptLabel = CONTROLBAR:ToolTipBuildMorthondBowmanHorde


11) Close and open up the livingworldbuildings.ini file.

12) Fine your MorthondBowmanArmy entry

13) Change the ConstructButtonTitle and ConstructButtonHelp entries to:
              
Code

ConstructButtonTitle = CONTROLBAR:LW_Unit_MorthondBowmanHorde

ConstructButtonHelp = CONTROLBAR:LW_ToolTipBuild_MorthondBowmanHorde


All right, now basically you are up and running. All images, text, buttons, etc. are ready to go.

Next Page: Packing the .big file

Links / Downloads

 HitsAdded
Sample Finished Mod2397July 2, 2007 - 21:22
Morthond Bowman model & Texture5015July 2, 2007 - 11:36

Comments

Display order: Newest first | Page: 1, 2

modboy451 - Friday December 3, 2010 - 13:04

you could be a little for clear on where to place the .tga and.w3d files(maybe add spme space inbetween lines) otherwise It was a great tutorial!

--------

http://forums.revora.net/index.php?showtopic=80461
im having trouble like kingeragon007 was,
model not appearing!

BigBrainiac - Monday October 25, 2010 - 16:27

This is a good, well written article.

Following this extremely slowly and not just copying what it says (the first time) helps a great deal.

If your unit doesn't appear, you are probably doing something wrong in the asset.dat (like not putting the texture or model in it).

Rob38 (Team Chamber Member) - Monday September 6, 2010 - 18:53

Some of the material such as the AI and WOTR mode will not work for BfME1. Most of the general information though should be applicable to BfME1 modders.

Souske22 - Monday September 6, 2010 - 17:58

Ok rather stupid question buuut I was wondering would this Tutorial also work for BFME1 to replace models? Asking so I dont kinda waste time reading this and following the steps to replace regular gondor soldiers with Numenorian Models.

--------

whao well first off disregard the replace part, small typo on my end so I dont get posts saying I'm asking the wrong question, second sorry for the 5 times repost my browser had a refresh spaz

acidRain - Wednesday June 23, 2010 - 7:33

Hmm...well, I followed all the instructions - to the letter - and my model's still invisible. If it helps, I attempted xxxMr. Xxxx's Aragorn bow/sword model. I'm no novice to coding, but modeling and skinning absolutely baffles me.

{AE}Manveru - Tuesday September 1, 2009 - 12:08

@Kingeragon007, did you compile your asset.dat properly? And add it into the .big file?

@Centurion, that's normal. Happens to me every time I run assetcachebuilder. The program should still work anyway. Just ignore it unless it's not creating your asset.dat.

*Kingeragon007* - Saturday August 9, 2008 - 20:17

hey im new around here,
i just copied your finsihed sample mod and i added the Pelargir Spearmen too it. I did everything the same way but changed it to be the Pelargir Spearmen but when i play ROTWK the spearmen are invisable. and i put the .w3d files and the .tga in the asset file. Can someone please tell me what i did wrong or how to fix this.
Thanks,
Kingeragon007

Tar-Palantir - Tuesday May 6, 2008 - 18:36

@ lycan, Robnkarla's using RoTWK, you're probably using BFME I or BFME II so the locomotors have diferent names, I suggest you check some other file to see what they're called.

Centurion - Monday March 24, 2008 - 22:46

I keep getting this message:
!debug.io flat add
======================================================================
You are using an older version of the DBGHELP.DLL library.
Please update to the newest available version in order to
get reliable stack and symbol information.

Hint: The DLL got loaded as:
C:\WINDOWS\system32\DBGHELP.DLL

How can i fix this?

lycan - Monday October 1, 2007 - 12:45

i did everything,
when i loaded up BFME2 it said

error Foot Speed _MED error thing wtf why is it like this

Go to top

 

"One site to rule them all, one site to find them,
one site to host them all, and on the network bind them."

 
11:26:32