Jump to content


Photo

HowTo: Adding GorgorothSpireFireball to CaH Spells


  • Please log in to reply
4 replies to this topic

#1 Imladhrim

Imladhrim
  • Members
  • 51 posts
  • Projects:Otherland

Posted 22 December 2006 - 12:16 PM

First of all I’d like to thank all the Guidewriters and Questionsolvers here.
Just by lurking and searching I found most of the info I needed..
The rest was trial and error.
I wanted to give something back.. maybe it will be of use for somebody.

This is my first guide (and my first mod (c;).
If you find any mistakes, have questions, want to clarify something I expressed wrong … Or can help me with my Questions.
I’ll welcome any input and will try to incorporate it into the guide as it stands.

Here it goes:

I did the mod for ROTWK, but it should work in the original as well.
(I’ll try to point out the things that won’t be needed in the Original)

The Values (Damage, Range etc. still need to be balanced)

What I wanted to accomplish:
  • The CaH Wizzards should get access to a new lvl 10 Spell that resembles the Fireball launched from the Gorgoroth Spire (Mordor Fortressupgrade)
  • The Spell should be nerfable without having to edit the Spire’s Fireball
  • the mod should get it’s own shortcut
Tools I used:
  • finalbig036b
  • notepad
What files I edited:
  • lotr.str
  • commandbutton.ini
  • weapon.ini
  • createaherospecialpowers.ini
  • createaheroupgrades.inc
  • object\createahero\createaheroaipowers.inc
  • object\createahero\createaheroobjects.inc
  • object\createahero\createaheropowers.inc
Preparations
  • Extract BfME2dir\ini.big using finalbig
  • Extract the lotr.str file from BfME2dir\lang\English.big
    (the name may vary depending on the language version you use I guess)
  • put all the Files in the following directory structure:

    "BfME2dir\Mods\Modname\data\ini\"
    (lotr.str must be in the data dir , the ini.big stuff (campaigns dir- windowtransitions.ini) in the ini dir)
  • Duplicate the BfME2 Shortcut, give it a nice name and change the target to
    DRIVE:\BfME2dir\lotrbfme2ep1.exe -mod "DRIVE:\BfME2dir \Mods\Modname"
    (In the Original BfME2 it’s lotrbfme2.exe not lotrbfme2ep1.exe)
Now we have all the files in the right place and a shortcut to test the Mod without braking the original game..

That was the easy part. Now let’s get cracking

Creating the new "Weapon"

We will need to define the new Meteor Weapon (took me a while to figure that one out) I simply copy pasted the MordorGorgorothSpireWeapon Entries in the weapon.ini and changed the Weapon Name to CreateaHeroMeteor
This "Weapon" consists of
  • the Projectile (MeteorProjectile) : the flying, burning Rock
    and
  • the Warhead (MeteorWarhead) : the Exploding Part, when it hit’s the ground
The Gorgoroth spire had some variables that were defined in the gamedata.ini, like
AttackRange = MORDOR_GORGOROTHSPIRE_ROCK_RANGE

But I couldn’t get my own Variables (I entered in the createaherogamedata.inc) to work (any hints?) so I simply entered numbers, like
AttackRange = 1000

complete changes in the weapon.ini



Now let’s add that new Projectile the the CaH Objects
I copied the MordorGorgorothSpireProjectile Entries from the object\evilfactions\evilfactionsubobjects.ini
and only named the new Object like the Projectile used in the new weapon.ini
(MeteorProjectile)
Complete changes in the objects\createahero\createaheroobjects.inc
//------------------------------------------------------------------------------//------------------------------------------------------------------------------Object MeteorProjectile; *** ART Parameters ***  Draw = W3DScriptedModelDraw ModuleTag_Draw	DefaultModelConditionState	  Model = EXLavaRock04	  ParticleSysBone = NONE MordorSpireFire FollowBone:Yes	  ParticleSysBone = NONE MordorSpireLava FollowBone:Yes	  ParticleSysBone = NONE MordorSpireLava02 FollowBone:Yes	End	IdleAnimationState	  Animation			  = EXLavaRock04		AnimationName		= EXLavaRock04.EXLavaRock04		AnimationMode		= LOOP	  End	End  End	;// *** AUDIO Parameters ***	SoundAmbient = GorgorothSpireFireballAmbient1	ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior		MaxUpdateRangeCap = 800		AnimationSound = Sound:GorgorothSpireFireballFlyBy1		Animation:EXLavaRock04.EXLavaRock04		Frames: 20	End;// ***DESIGN parameters ***	EditorSorting	 = SYSTEM		ArmorSet		Armor = NoArmor	End		VisionRange = 0.0;// *** ENGINEERING Parameters ***	KindOf = PROJECTILE	ShockwaveResistance = SHOCKWAVE_RESISTANCE_IMMUNE		Body = ActiveBody ModuleTag_03		MaxHealth	   = 100.0	End	Behavior = DestroyDie ModuleTag_04;nothing	End		Behavior = BezierProjectileBehavior ModuleTag_05		DetonateCallsKill				= Yes				FirstHeight						= 53;// Height of Bezier control points above highest intervening terrain		SecondHeight					= 53		FirstPercentIndent				= 20%;// Percentage of shot distance control points are placed		SecondPercentIndent 			= 80%		FlightPathAdjustDistPerSecond   = 0;// Can allow a max speed this can attempt to follow a target. Units are their velocity we can tag.		PreLandingStateTime				= 1000		PreLandingEmotion				= DOOM		PreLandingEmotionRadius			= 20.0		InvisibleFrames					= 100		FadeInTime						= 100	End	Behavior = PhysicsBehavior ModuleTag_06	End	Behavior = FXListDie ModuleTag_08		DeathTypes	= ALL		DeathFX		= FX_GorgorothSpireFireballDeath	End	Geometry = Sphere	GeometryIsSmall = Yes	GeometryMajorRadius = 3.0End


Integrating the new "Weapon"

So now we have created a new weapon called CreateaHeroMeteor
I say: let’s use it!

Tell the program that there is a new upgrade for the CaHs called CreateaHeroMeteor (I don’t think it needs to be the same as the weapon’s name.. I’m just lazy and it worked) by making a new entry in the createaheroupgrades.inc

complete changes in the createaheroupgrades.inc


Upgrade Upgrade_CreateAHeroMeteor
	Type = OBJECT
END


It’s a Special Power, so tell the Programm something about it, like the recharge time

complete changes in the createaherospecialpowers.ini


//------------------------------------------------------------------------------
SpecialPower SpecialAbilityCreateAHeroMeteor
	Enum				= SPECIAL_SPELL_BOOK_BOMBARD
	RadiusCursorRadius	= 200	
	ReloadTime	   	= 25000;// in milliseconds	
		InitiateSound			= GorgorothSpireFireballBuildUpMS
End


And now define the spell a little bit more

complete changes in the createaheropowers.inc

//--------------------------------------------------------------------------//	Meteor//--------------------------------------------------------------------------Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroMeteor	SpecialPowerTemplate = SpecialAbilityCreateAHeroMeteor	TriggeredBy = Upgrade_CreateAHeroMeteorEndBehavior = SpecialPowerModule ModuleTag_CreateAHeroMeteorStarter	SpecialPowerTemplate		= SpecialAbilityCreateAHeroMeteor	UpdateModuleStartsAttack	= Yes	StartsPaused			= YesEndBehavior = WeaponFireSpecialAbilityUpdate ModuleTag_CreateAHeroMeteorUpdate	SpecialPowerTemplate	= SpecialAbilityCreateAHeroMeteor	WhichSpecialWeapon		= 5							SkipContinue			= Yes	UnpackTime			  = 100	PreparationTime		 = 2500   	PersistentPrepTime	  = 1500 	PackTime				= 1100        TriggerSound			= GorgorothSpireFireballLaunchMS		FreezeAfterTriggerDuration	= 2500						AwardXPForTriggering	= 0			StartAbilityRange		= 1000	MustFinishAbility		= Yes	SpecialWeapon			= CreateaHeroMeteorEnd

Behavior= Unpause.. means The Power get’s useable, is no longer grayed out
The Spell will become available after I “purchase” (get the prerequisites lvl 10, fireball lvl 3) the upgrade (defined in createaheroupgrades.inc)

I think the SpecialPowerModule Behavior tells the Program “if he clicks on it, start the attackroutine” (Just my guess though)

WeaponFireSpecialAbilityUpdate Ah! So now we clicked on it!
WhichSpecialWeapon= Not sure what this one does
Unpacktime, PreparationTime, PersistentPrepTime= (It takes a bit to fire)
PackTime= It takes a bit to “reload” (get ready for recharging )
FreezeAfterTriggerDuration= we can’t do anything for 2.5 seconds after we fired the weapon. In fact the 2.5 seconds only start after the weapon hit’s the ground.
StartAbilityRange= How close must we be to the target to be able to launch our spell.
SpecialWeapon= Yes we will use our selfmade CreateaHeroMeteor


It's all about control

Now we have a new Weapon, and our CaH Wizards could use it.. but what good is power without control?
So we need a Command Button to actually learn and activate the skill
This will be done in the commandbutton.ini
(Don’t worry about the CONTROLBAR:… entries. We’ll come to those soon)

complete changes in the commandbutton.ini
//------------------- Create A Hero ----------------------------//--------------------------------------------------------------CommandButton Command_CreateAHero_Meteor	Command				= SPECIAL_POWER 	SpecialPower		= SpecialAbilityCreateAHeroMeteor	TextLabel			= CONTROLBAR:SpecialAbilityCAHMeteor	ButtonImage			= SBEvil_RainofFire	Options				= NEED_TARGET_POS	ButtonBorderType	= ACTION 	DescriptLabel		= CONTROLBAR:TooltipSpecialAbilityCAH_Meteor	RadiusCursorType		= RainOfFireRadiusCursor		CursorName			= AttackObj		InvalidCursorName	= GenericInvalid	InPalantir			= Yes	AutoAbility			= Yes	CreateAHeroUIAllowableUpgrades			  =	Upgrade_CreateAHero_ClassIstariWizard	CreateAHeroUIMinimumLevel				  = 10	CreateAHeroUIPrerequisiteButtonName = None	CreateAHeroUICostIfSelected				  = 2000End

With this entry we’ll create a command button using the same image as the Rain of Fire Spell. We also use the same Cursor (the white circle to define the area to attack)
InPalantir=Yes means, that the Power will be selectable in the small circles around our heroes image (like all spells and the stances button)
AutoAbility=Yes.. If we so want our Hero will cast this spell automatically

In the next few lines we’ll tell the program that only Wizards will be able to learn this spell and that they need to be lvl 10 to use the Meteor. This spell will cost us 2000 because it’s quite powerful.
I believe that you can leave the CreateAHeroUICostIfSelected one out, if you use the Original Game and not the Expansion pack.

If we would quit now, we could already learn the spell and use it ingame.
But all textwindows would give us error messages. So we will have to create a few descriptive texts in the string file (lotr.str)

Here is what I added:

CAH:Command_CreateAHero_Meteor_Name"Meteor"ENDCONTROLBAR:ToolTipSpecialAbilityCAH_Meteor"Launches a giant Meteor that scorches the Battlefield"ENDCONTROLBAR:ToolTipSpecialAbilityCAH_Meteor_Palantir"Launches a giant Meteor that scorches the Battlefield \n Left click icon then left click on target area"ENDCONTROLBAR:SpecialAbilityCAHMeteor"M&eteor"END

Finished.

Problems I stumbled upon:
I tried to make my own variables in the gamedata.ini and the createaherogamedata.inc files so I could easily access all variables I wanted to balance out from one place.
But I always got error messages while trying to launch the game.
What I wanted was

Gamedata.ini :

#define CAH_METEOR_COST 				2000

(to be used in the commandbutton.ini)

And in the createaherogamedata.inc

//	Meteor
#define	CREATE_A_HERO_METEOR_ROCK_RANGE				1000
#define	CREATE_A_HERO_METEOR_ROCK_DAMAGE			750
#define	CREATE_A_HERO_METEOR_FIRE_DAMAGE			750
#define CREATE_A_HERO_METEOR_PREATTACKDELAY 			800
#define CREATE_A_HERO_METEOR_DELAYBETWEENSHOTS 			6000
#define CREATE_A_HERO_METEOR_FIRINGDURATION 			1500


(to be used in the weapon.ini)
Any Ideas?
Also I'd like to know where I can define which string he uses as a tooltip for the Plantir, and which during character creation.
And another thing: Can I choose Fireball lvl 3 als a prerequisite and keep the Meteor from overwriting my fireball spell?


I hope my explanations are understandable and not toooo wrong (c;
If you have anything to add, feel free to do so.

Hope to have been of service,
Imladhrim

__________________________________
Edit:
I added the sound references so it plays the buildup and launch sounds

Edited by Imladhrim, 05 January 2007 - 04:53 PM.


#2 zimoo

zimoo

    Ecthelion of the Fountain

  • Project Team
  • 2,009 posts
  • Location:Devon, England
  • Projects:Lurking until the off topic begins...
  •  Guardian of the Books

Posted 22 December 2006 - 12:28 PM

Nice tutorial, looks very in depth :)
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image

Playing games? Ah, you'll never be a good modder if you get involved in actually playing them!


#3 MrRanck

MrRanck
  • Members
  • 15 posts

Posted 29 December 2006 - 04:51 PM

Nice work. But, I gotta ask: With these edits, does the Gorgoth Spire now appear in the Wizard powers CAH gui/menu?

#4 Solinx

Solinx

    .

  • Undead
  • 3,101 posts
  • Location:The Netherlands
  • Projects:Real Life
  • Division:Revora
  • Job:Retired Leader / Manager

Posted 30 December 2006 - 12:20 PM

Good guide Imladhrim, too much to read it all right now :huh: but looks very good.

MrRanck, yes the Gorgoth Spire appears in the CaH gui. It will be placed in the 10th level list of powers (for the wizards only.)

Solinx

Edited by Solinx, 30 December 2006 - 05:45 PM.

Posted Image

"An expert is a man who has made all the mistakes which can be made in a very narrow field." - Niels Bohr


#5 Imladhrim

Imladhrim
  • Members
  • 51 posts
  • Projects:Otherland

Posted 30 December 2006 - 04:35 PM

Nice work. But, I gotta ask: With these edits, does the Gorgoth Spire now appear in the Wizard powers CAH gui/menu?


Hmm.. I hope I understand you correctly:
The power is treated as a regular Istari (wizard)Power and
appears in the GUI for creating a Hero (the one where you select the powers your hero is gonna get) with description, button image and everything. And it appears ingame .. just like a regular CaH-power.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users