Jump to content


Photo

Adding a Summon Allies Spell (For Heros)


  • This topic is locked This topic is locked
31 replies to this topic

#1 Ayden

Ayden
  • Project Team
  • 51 posts
  • Location:California
  • Projects:Drums in the Deep, A Moria faction mod for BFME

Posted 23 February 2005 - 02:47 AM

Adding a Summon Allies Spell (For Heros)

Written by: Ayden aka Shawn
-------------

Hello The3rdAge community.

I have had requests to make a guide that teachs you how to make a "Summon Allies" spell that heros can use once they reach a certian rank. Be prepared, this is a hard and complicated code and it took me many days to work flawlesly.

We will be editing the following .ini files in this tutorial:
Legolas.ini
Commandbutton.ini
Commandset.ini
Specialpower.ini
Objectcreationlist.ini
upgrade.ini
Experiencelevels.ini

1: (Legolas.ini)
First off, we are going to need to choose the Hero that you want the spell to be given too. I want everyone to be on the same page during this tutorial so I will pick a hero for you. Legolas.

We are going to give Legolas a ability to summon some elven allies to battle once he gets to rank 3. So lets open Legolas' .ini file in GoodFaction/Units/Rohan.

Scroll down until you find the abilitys he has already, such as the HawkEye behavior. Under that, we are going to add this paragraph of code:

Behavior = UnpauseSpecialPowerUpgrade ModuleTag_MirkwoodElvesEnabler
SpecialPowerTemplate = SuperweaponMirkwoodElves
TriggeredBy = Upgrade_LegolasMirkwoodElves
End

Behavior = OCLSpecialPower ModuleTag_OCLSpecialPower
SpecialPowerTemplate = SuperweaponMirkwoodElves
OCL = OCL_MirkwoodElves
CreateLocation = USE_OWNER_OBJECT
StartsPaused = yes
SetModelCondition = ModelConditionState:USER_1
SetModelConditionTime = 8.1
End


This code contains much information about the allies we will be summoning to our aid when the button on the hero's plantir is clicked.

2: (SpecialPower.ini)
This .ini has actions that the game uses when a spell is activated. We need to add our summon elves spell in here for the spell to work in the game. Copy and paste the following line in the bottom of the specialpower.ini file.

;------------------------------------------------------------------------------
SpecialPower SuperweaponMirkwoodElves
Enum = SPECIAL_SPAWN_ORCS
ReloadTime = 200000 ; in milliseconds
PublicTimer = No
InitiateAtLocationSound = SpellElvenSummon
RadiusCursorRadius = 100.0
End


There is something that you need to know that is VITAL to making any spell work in the game. A faction may only use a "Enum" ONCE! If you try to use the enum "SPECIAL_SPELL_BOOK_ELVEN_ALLIES" for this spell IT WILL NOT WORK. I spent days wondering why my spell was not working, and then I found out it was because I was using a enum that the good faction already uses.

3: (Upgrade.ini)
We don't want Legolas to start off with this ability, so we need to make him "Earn it" through rank levels. For that to work, we need to add a upgrade into this database so the game will know what it is. Add the following code to the bottom of the upgrade.ini file.

Upgrade Upgrade_LegolasMirkwoodElves
Type = OBJECT
End


3 1/2: (Break)
Ok, feel free to take a break now, and get something to drink, your looking thirsty. :grin:

4: (CommandButton.ini)
Now that we have the basis of our code layied out, we need to make the button it. If we don't have the button made, the spell will not show up in game and the hero will not be able to use it.

CommandButton Command_MirkwoodElves
Command = SPECIAL_POWER
SpecialPower = SuperweaponMirkwoodElves
TextLabel = CONTROLBAR:SummonElvenAllies
ButtonImage = SBGood_ElvenAllies
ButtonBorderType = ACTION ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:TooltipSummonElvenAllies
InPalantir = Yes
End


The command button has all the information the game needs to make the button appear in the hero's plantir. You are allowed to change the buttonimage to whatever you like, but to avoid a headach I recomend you don't change anything in this tutorial until you have experienced the spell ingame.

5: (Experiencelevels.ini)
In this .ini we will be able to select what rank we want Legolas to be able to unleash this new power of the elves. Find Legolas' experience section, and under level3 look for the "Rank" string. Under that string, add this following code.

Upgrades = Upgrade_LegolasMirkwoodElves

6: (Objectcreationlist.ini)
Now we have this code almost finished but we still have to add the most important part. We have to tell the game what units we want made! open up the objectcreationlist.ini file and add this following code at the end of the file.

ObjectCreationList OCL_MirkwoodElves
CreateObject
ObjectNames = RohanElvenWarriorHorde_Summoned
Count = 1
SpreadFormation = Yes
MinDistanceAFormation = 0.0
MinDistanceBFormation = 0.0
MaxDistanceFormation = 5.0
FadeIn = Yes
FadeTime = 4000
IgnoreCommandPointLimit = Yes
End
End


You can change how many units you want to be created, or what unit you want to be created in this code. I set it to "Count = 1" so that only one horde of elvenwarriors are made, however feel free to change it to 2 or more.

7: (CommandSet.ini)

Now that we have all the information the game needs for the ability to work, lets give it to our hero. Add the following code to the commandset of the hero you added the behaviors into:

Command_MirkwoodElves

7: (Congradulations)
Congradulations! you have made a summon allies code for a hero instead of a spellbook. Give yourself a pat on the back and try out the new, awsome spell.

//Ayden

Edited by Ayden, 25 February 2005 - 02:47 AM.

Master Modding Maiar

#2 Guest_THESSEUS_*

Guest_THESSEUS_*
  • Guests

Posted 23 February 2005 - 04:58 PM

When I do all this procedures to add a summon haldir to my mod my game crashes when I build to Haldir (Armond) :grin:

#3 Ayden

Ayden
  • Project Team
  • 51 posts
  • Location:California
  • Projects:Drums in the Deep, A Moria faction mod for BFME

Posted 23 February 2005 - 09:40 PM

What does this error say the problem is?
Master Modding Maiar

#4 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 24 February 2005 - 02:42 AM

I get a game.dat error when trying to add this to Haldir too.

I added it to the command set, which was not mentioned in the tutoral. Could this cause the crash?

#5 Ayden

Ayden
  • Project Team
  • 51 posts
  • Location:California
  • Projects:Drums in the Deep, A Moria faction mod for BFME

Posted 24 February 2005 - 05:02 AM

Did you make the Upgrade in upgrade.ini?
Master Modding Maiar

#6 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 24 February 2005 - 04:40 PM

Did you make the Upgrade in upgrade.ini?

<{POST_SNAPBACK}>

Yes. I followed the tutorial exactly.

#7 Ayden

Ayden
  • Project Team
  • 51 posts
  • Location:California
  • Projects:Drums in the Deep, A Moria faction mod for BFME

Posted 24 February 2005 - 09:10 PM

Ok, it might be the commandset. I added commandset section to the tutorial. copy it and paste it to the Hero's command set that you added the behavior to:

Command_MirkwoodElves
Master Modding Maiar

#8 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 24 February 2005 - 10:49 PM

Ok, it might be the commandset. I added commandset section to the tutorial. copy it and paste it to the Hero's command set that you added the behavior to:

Command_MirkwoodElves

<{POST_SNAPBACK}>

That's exactly what I put in originally. I'll have a look through the files again to make sure they all match up.

#9 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 25 February 2005 - 01:20 AM

Might this be the problem?

Behavior = UnpauseSpecialPowerUpgrade ModuleTag_MirkwoodElvesEnabler
SpecialPowerTemplate = SuperweaponMirkwoodElves
TriggeredBy = Upgrade_LegolasMirkwoodElves
End

Behavior = OCLSpecialPower ModuleTag_OCLSpecialPower
SpecialPowerTemplate = SuperweaponMirwoodElves
OCL = OCL_MirkwoodElves
CreateLocation = USE_OWNER_OBJECT
StartsPaused = yes
SetModelCondition = ModelConditionState:USER_1
SetModelConditionTime = 8.1
End

Surely Mirkwood, like all other references?

#10 Ayden

Ayden
  • Project Team
  • 51 posts
  • Location:California
  • Projects:Drums in the Deep, A Moria faction mod for BFME

Posted 25 February 2005 - 02:47 AM

LOL, I am so sorry. That must have been the problem. I am going to watch my spelling from now on. :sleep:
Master Modding Maiar

#11 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 25 February 2005 - 10:21 AM

LOL, I am so sorry. That must have been the problem. I am going to watch my spelling from now on. :p

<{POST_SNAPBACK}>

Not to worry, I've got it working now. It's a really nice power - thanks!

#12 Ayden

Ayden
  • Project Team
  • 51 posts
  • Location:California
  • Projects:Drums in the Deep, A Moria faction mod for BFME

Posted 25 February 2005 - 09:49 PM

Your welcome. I am glad you like the power.
Master Modding Maiar

#13 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 27 February 2005 - 07:55 PM

I'll be codinng this is the site over thex few days. :) NIce work.

#14 Peristalsis

Peristalsis
  • Members
  • 7 posts
  • Location:Alberta, Canada
  • Projects:Digesting Man-Flesh...

Posted 01 March 2005 - 05:55 PM

Thanks Ayden for all your work on this. It is much appreciated as I'm going to pillage your code to grant Sauron the ability to summon Orcs and Saruman the ability to summon Berzerkers.

I do have a question though...

Under the section -> 6: (Objectcreationlist.ini)

Could I add Haldir into the ObjectNames code along with the RohanElvenWarriorHorde_Summoned so that he is also summoned with them? And if I change the Count to 2, will it produce 2 Haldir's?

Normally, I'd try the code first and then ask the question if it didn't work but I'm on a business trip and am dying to know!!!

ie: changes below

ObjectCreationList OCL_MirkwoodElves
CreateObject
ObjectNames = RohanElvenWarriorHorde_Summoned ElvenHaldir
Count = 2
SpreadFormation = Yes
MinDistanceAFormation = 0.0
MinDistanceBFormation = 0.0
MaxDistanceFormation = 5.0
FadeIn = Yes
FadeTime = 4000
IgnoreCommandPointLimit = Yes
End
End

#15 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 01 March 2005 - 08:57 PM

Actually you can add any object code. If you look at my tutorial on adding a summon spell it shows you the OCL I used to summon Sauron and some goblin hordes.

The principal is the same. Add the object types and quanity you want. You could summon a guard tower if you chose. Which allows you to build buildings without having a building plot. :unsure:

Another question is how does one limit how far from the hero who is summoning? So it can only summon within a small area around the hero.

#16 Ayden

Ayden
  • Project Team
  • 51 posts
  • Location:California
  • Projects:Drums in the Deep, A Moria faction mod for BFME

Posted 01 March 2005 - 11:41 PM

Actually you can add any object code. If you look at my tutorial on adding a summon spell it shows you the OCL I used to summon Sauron and some goblin hordes.

The principal is the same. Add the object types and quanity you want. You could summon a guard tower if you chose. Which allows you to build buildings without having a building plot. :unsure:

Another question is how does one limit how far from the hero who is summoning? So it can only summon within a small area around the hero.

<{POST_SNAPBACK}>


That is exactly what I was wondering. I don't remember seeing any area limits for the summon radias cursor.
Master Modding Maiar

#17 Peristalsis

Peristalsis
  • Members
  • 7 posts
  • Location:Alberta, Canada
  • Projects:Digesting Man-Flesh...

Posted 02 March 2005 - 12:00 AM

Hmm... I was wondering that too actually.

I want to make Haldir appear in the middle of my Elven Archer's and assign him a leadership bonus as to strengthen them.

The other thing I was thinking of, but am not sure how to do it, is to make a modified Elven Wood special power that would have the Elves and Haldir in it. Would it be possible to make that part of the summoned objects? I'm guessing not and that I'd have to create a modified special power to allow for this....

Edited by Peristalsis, 02 March 2005 - 12:02 AM.


#18 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 02 March 2005 - 12:15 AM

No actually the original summon elves does create elven woods under it. Actually making the elves appear around the hero would only require you to not use the cursor at all but create an OCL based on the location of the existing unit.

See the OCL for building debris. That is created right from the structure being hit.

; The Bits that are thrown off from the damaged buildings
ObjectCreationList OCL_Gen01_Chunk1
  CreateObject
    ObjectNames = BuildingGen01BitA
    Offset = X:7.3272 Y:3.872 Z:45.7192
    Count = 1
    Disposition = SEND_IT_FLYING BUILDING_CHUNKS LIKE_EXISTING
    DispositionIntensity = 6.0
    VelocityScale = 2.0
  End
End

I believe the answer lies with OCL's generated from debris.

#19 Flame Of Udûn

Flame Of Udûn

    Lord of Everything

  • Members
  • 172 posts
  • Location:UK
  • Projects:My hero/faction/other stuff mod.

Posted 31 March 2005 - 10:52 PM

Hmm for my FIRST mod I want my hero Sauron (yes I know, in many others but I'm just testing stuff out) to be able to summon some hordes of Orcs. I want the power to be called Summon The Horde. Here is what I THINK I need to change from the tutorial above.
The Sauron INI:

Behavior = UnpauseSpecialPowerUpgrade ModuleTag_MordorOrcsEnabler
SpecialPowerTemplate = SuperweaponMordorOrcs
TriggeredBy = Upgrade_SauronMordorOrcs
End

Behavior = OCLSpecialPower ModuleTag_OCLSpecialPower
SpecialPowerTemplate = SuperweaponMordorOrcs
OCL = OCL_MordorOrcs
CreateLocation = USE_OWNER_OBJECT
StartsPaused = yes
SetModelCondition = ModelConditionState:USER_1
SetModelConditionTime = 8.1
End


All I changed was MirkwoodElves to MordorOrcs.

Then for the specialpower.ini:

SpecialPower SuperweaponMordorOrcs
Enum = SPECIAL_SPAWN_ORCS
ReloadTime = 200000 ; in milliseconds
PublicTimer = No
InitiateAtLocationSound = ???SpellElvenSummon???
RadiusCursorRadius = 100.0
End

Not too sure what to put instead of SpellElvenSummon as there is no spell to summon orcs....

Obviously in upgrade.ini just change

Upgrade Upgrade_LegolasMirkwoodElves
Type = OBJECT
End


into

Upgrade Upgrade_SauronMordorOrcs
Type = OBJECT
End


This bit I'm not too sure on either:

CommandButton Command_MordorOrcs
Command = SPECIAL_POWER
SpecialPower = SuperweaponMordorOrcs
TextLabel = CONTROLBAR:SummonTheHorde
ButtonImage = MUOrc????
ButtonBorderType = ACTION ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:TooltipSummonTheHorde
InPalantir = Yes
End



ExperienceLevels.ini

Upgrades = Upgrade_SauronMordorOrcs


And now I have no idea at all what to do in the objectcreationlist.ini but the commandset.ini is easy.
The dark fire shall not avail you, Flame of Udûn!

-~= Gandalf =~-

Posted Image

#20 pabtyf

pabtyf

    T3A Forum Moderator

  • Project Team
  • 209 posts
  • Location:wales, uk
  • Projects:Finally finished my degree!!!!
  • Division:T3A Staff

Posted 01 April 2005 - 01:24 PM

Hmm for my FIRST mod I want my hero Sauron (yes I know, in many others but I'm just testing stuff out) to be able to summon some hordes of Orcs. I want the power to be called Summon The Horde.


Why don't you just use saurons spawnorcs special power? The codes already there:
in saurons ini
 Behavior = OCLSpecialPower ModuleTag_08
    SpecialPowerTemplate = SuperweaponSpawnOrcs
    OCL                  = SUPERWEAPON_SpawnOrcs
    CreateLocation       = USE_OWNER_OBJECT
  End

in commandbutton.ini
;/// Spawn Orcs Command
CommandButton Command_SpawnOrcs
  Command           = SPECIAL_POWER
  SpecialPower      = SuperweaponSpawnOrcs
  TextLabel         = CONTROLBAR:SpawnOrcs
  ButtonImage       = SMSpawnOrcs
  ButtonBorderType  = ACTION; Identifier for the User as to what kind of button this is
  DescriptLabel     = CONTROLBAR:TooltipSpawnOrcs
End

in objectcreationlist.ini:
; ---------------------------------------------------------------------------------------
; Spawn Orcs
ObjectCreationList SUPERWEAPON_SpawnOrcs
  CreateObject
    ObjectNames = MordorFighter
    Count = 12
    SpreadFormation = Yes
    MinDistanceAFormation = 16.0
    MinDistanceBFormation = 24.0
    MaxDistanceFormation = 80.0
    FadeIn = Yes
    FadeTime = 200
  End
  CreateObject
    ObjectNames = BuildingDamageBits04
    Count = 30
    Disposition = SEND_IT_UP
    DispositionIntensity = 20
    SpreadFormation = Yes
    MinDistanceAFormation = 16.0
    MinDistanceBFormation = 24.0
    MaxDistanceFormation = 80.0
  End
  CreateObject
    ObjectNames = BuildingDamageBits01
    Count = 30
    Disposition = SEND_IT_UP
    DispositionIntensity = 25
    SpreadFormation = Yes
    MinDistanceAFormation = 16.0
    MinDistanceBFormation = 24.0
    MaxDistanceFormation = 80.0
  End
End

It's in special powers already.
all you need to do is add the button to his commandset.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users