Modding Union

[en] - Modding Corner => General Modding Questions => Thema gestartet von: KingThranduil am 13. Apr 2013, 13:04

Titel: Spell Books (coding)
Beitrag von: KingThranduil am 13. Apr 2013, 13:04
How to replace in Edain Mod (3.8.1) spell books?
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 16. Apr 2013, 08:16
In Imladris I added Gil-Galad. He is in SpellBook(Last Alliance).

I want to remove he from the SpellBook, but I don't know how to do it.
Titel: Re:Spell Books (coding)
Beitrag von: Lostir am 16. Apr 2013, 08:56
In FinalBig you mau find the obhectcreationlist.inc
In this file search for Gil-Galad and if you find his code-lines then just comment it out with ";" like this:
; Object = Gil-Galad
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 16. Apr 2013, 10:33
In obhectcreationlist.inc about Gil-Galad I found the following lines:

1) ObjectCreationList OCL_GilGaladAeglos
CreateObject
ObjectNames = GilGaladAeglosSchockwelle
Count = 1
Disposition     = LIKE_EXISTING
End

2) CreateObject
ObjectNames = LothlorienGilGalad_Summoned
Count = 1
        FadeIn = Yes
        FadeTime = 2000
        UseJustBuiltFlag = Yes
        StartingBusyTime = 2000
IgnoreCommandPointLimit = Yes
    End
End

3) ObjectCreationList GilgaladBombardSeed
CreateObject
ObjectNames = GilgaladRainBombardSeed
Count = CREATE_A_HERO_BOMBARD_COUNT_L3
SpreadFormation = Yes
MinDistanceAFormation = 10.0
MinDistanceBFormation = CREATE_A_HERO_BOMBARD_RADIUS_L3
MaxDistanceFormation = CREATE_A_HERO_BOMBARD_RADIUS_L3
End
End

; ---------------------------------------------------------------------------------------
ObjectCreationList OCL_GilgaladBombardProjectile
CreateObject
ObjectNames = GilgaladBombardProjectile
Disposition = RELATIVE_ANGLE USE_WATER_SURFACE ; same angle as parent.
DispositionAngle = 0
IssueMoveAfterCreation = No
IgnoreAllObjects = Yes ; Don't try and adjust position according to existing objects.
End
End

4) CreateObject
ObjectNames = LothlorienGilGalad_Summoned
Count = 1
FadeIn = Yes
FadeTime = 8000
IgnoreCommandPointLimit = Yes
Disposition = SPAWN_AROUND
DispositionAngle = 90 ;SpawnAround uses this as the arc between guys
DispositionIntensity = 50 ; and this for distance from center
End
End

5) ObjectCreationList OCL_SpawnGilGalad
CreateObject
ObjectNames = LothlorienGilGalad
Count = 1
FadeIn = Yes
FadeTime                 = 4000
;IgnoreCommandPointLimit = No
Disposition = LIKE_EXISTING
DispositionAngle = 120 ;SpawnAround uses this as the arc between guys
DispositionIntensity = 200 ; and this for distance from center
End
End

6) CreateObject
ObjectNames = ArnorGilGalad_Summoned
        Count                    = 1
        FadeIn                    = Yes
        FadeTime                = 8000
        IgnoreCommandPointLimit    = Yes
        Disposition                = ABSOLUTE_ANGLE
        DispositionAngle        = 270
        UseJustBuiltFlag        = Yes
        StartingBusyTime        = 5000
        Offset                    = X:-30 Y:-60 Z:0
        ForbiddenUpgrades = Upgrade_ImladrisFaction
        RequiredUpgrades  = Upgrade_ArnorFaction
    End
    CreateObject
ObjectNames = BruchtalGilGalad_Summoned
        Count                    = 1
        FadeIn                    = Yes
        FadeTime                = 8000
        IgnoreCommandPointLimit    = Yes
        Disposition                = ABSOLUTE_ANGLE
        DispositionAngle        = 270
        UseJustBuiltFlag        = Yes
        StartingBusyTime        = 5000
        Offset                    = X:-30 Y:-60 Z:0
        ForbiddenUpgrades = Upgrade_ArnorFaction
        RequiredUpgrades  = Upgrade_ImladrisFaction
    End
Titel: Re:Spell Books (coding)
Beitrag von: Lostir am 16. Apr 2013, 10:40
Number 1 and 3 are abillities of Gil-Galad.
Number 2,4,5 and 6 are all posible.
But because the spell is nearly the same for Imladris and Arnor, I believe it is 6 and the other ones are older versions.

So just change Nr. 6 to this. Just set the count of the Gil-Galads for Bruchtal to 0:
Zitat
CreateObject
    ObjectNames = ArnorGilGalad_Summoned
        Count                    = 1
        FadeIn                    = Yes
        FadeTime                = 8000
        IgnoreCommandPointLimit    = Yes
        Disposition                = ABSOLUTE_ANGLE
        DispositionAngle        = 270
        UseJustBuiltFlag        = Yes
        StartingBusyTime        = 5000
        Offset                    = X:-30 Y:-60 Z:0
        ForbiddenUpgrades = Upgrade_ImladrisFaction
        RequiredUpgrades  = Upgrade_ArnorFaction
    End
    CreateObject
    ObjectNames = BruchtalGilGalad_Summone d
        Count                    = 0
        FadeIn                    = Yes
        FadeTime                = 8000
        IgnoreCommandPointLimit    = Yes
        Disposition                = ABSOLUTE_ANGLE
        DispositionAngle        = 270
        UseJustBuiltFlag        = Yes
        StartingBusyTime        = 5000
        Offset                    = X:-30 Y:-60 Z:0
        ForbiddenUpgrades = Upgrade_ArnorFaction
        RequiredUpgrades  = Upgrade_ImladrisFaction
    End

It would be also possible to delete the whole part for Imladris, but if you want to rechange it, it is better have the old codes still there.
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 16. Apr 2013, 10:47
Remove? CreateObject
    ObjectNames = BruchtalGilGalad_Summone d
        Count                    = 0
        FadeIn                    = Yes
        FadeTime                = 8000
        IgnoreCommandPointLimit    = Yes
        Disposition                = ABSOLUTE_ANGLE
        DispositionAngle        = 270
        UseJustBuiltFlag        = Yes
        StartingBusyTime        = 5000
        Offset                    = X:-30 Y:-60 Z:0
        ForbiddenUpgrades = Upgrade_ArnorFaction
        RequiredUpgrades  = Upgrade_ImladrisFaction
    End
or replace these lines on ; Object = Gil-Galad
Titel: Re:Spell Books (coding)
Beitrag von: Lostir am 16. Apr 2013, 10:52
I think setting the count to 0 is quite fine, but if you want, it you can remove the whole code, by commenting it out with ;
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 16. Apr 2013, 11:31
I did as you said, but there was a problem:
(http://i5.pixs.ru/storage/4/0/9/Dwm2013041_2972233_7726409.jpg)
Titel: Re:Spell Books (coding)
Beitrag von: Lostir am 16. Apr 2013, 11:37
This error hasn't to do anything with the codes above.
The error just states that you have twice the same name for a module, but this name has to be unique.
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 16. Apr 2013, 12:16
I did what I wanted. Thanks for the help.
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 16. Apr 2013, 12:56
I want to add in Rohan Aragorn, Legolas and Gimli, but they are in SpellBook. How do I change this ability to another? (I do not want to remove the time. I want to replace it with another)
Titel: Re:Spell Books (coding)
Beitrag von: Lostir am 16. Apr 2013, 17:58
With which ability do you want to replace the Spell? That is the most important thing.
It would be easiest to just change the effect an summon something else instead.
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 16. Apr 2013, 19:18
1) I want to replace with spell "Friends of the Old Forest"(Tom Bombadil and Goldberry).

2) possible instead them(Aragorn, Legolas and Gimli) do Gandalf for a while?
Titel: Re:Spell Books (coding)
Beitrag von: Lostir am 16. Apr 2013, 20:13
1 and 2 are the same for coding.
The easiest way is, you look for the OCL of the Spell with Aragorn Legolas un Gimli:
ObjectCreationList OCL_SpawnBandderGefährten
CreateObject
ObjectNames = GondorAragornEntwicklung2_Summoned
Count = 1
FadeIn = Yes
FadeTime = 10000
IgnoreCommandPointLimit = Yes
Disposition = SPAWN_AROUND
DispositionAngle = 90 ;SpawnAround uses this as the arc between guys
DispositionIntensity = 0 ; and this for distance from center
End
CreateObject
ObjectNames = LothlorienLegolas_SummonedGefährten
Count = 1
FadeIn = Yes
FadeTime = 10000
IgnoreCommandPointLimit = Yes
Disposition = ABSOLUTE_ANGLE
DispositionAngle = 90 ;SpawnAround uses this as the arc between guys
                Offset                          = X:30 Y:-30 Z:0
End
CreateObject
ObjectNames = DwarvenGimli_SummonedGefährten
Count = 1
FadeIn = Yes
FadeTime = 10000
IgnoreCommandPointLimit = Yes
Disposition = ABSOLUTE_ANGLE
DispositionAngle = 90 ;SpawnAround uses this as the arc between guys
                Offset                          = X:-30 Y:30 Z:0
End
End

And you replace everything, but the OCL name with the OCL of Tom Bombadil so you get:
ObjectCreationList OCL_SpawnBandderGefährten
    CreateObject
        ObjectNames                    = TomBombadil_Summoned
        Count                        = 1
        FadeIn                        = Yes
        FadeTime                    = 4000
        IgnoreCommandPointLimit        = Yes
        Disposition                    = LIKE_EXISTING
        DispositionAngle            = 120    ;SpawnAround uses this as the arc between guys
        DispositionIntensity        = 200 ; and this for distance from center
    End
    CreateObject
        ObjectNames                    = GasthausGoldbeere_Summoned
        Count                        = 1
        FadeIn                        = Yes
        FadeTime                    = 4000
        IgnoreCommandPointLimit        = Yes
        Disposition                    = LIKE_EXISTING
        DispositionAngle            = 120    ;SpawnAround uses this as the arc between guys
        DispositionIntensity        = 200 ; and this for distance from center
        Offset = X:20.0 Y:0.0 Z:0.0
    End
End

And in addition you replace the Image and the Label in the Commandbutton:
CommandButton Command_SpellBookBandderGefährten
    Command = SPELL_BOOK
    SpecialPower = SpellBookBandderGefährten
    ButtonImage         = HSGoldbeereandBombadil
    Options = NEED_TARGET_POS ; Huh, you can't have this flag and a radius cursor: CONTEXTMODE_COMMAND
    TextLabel         = CONTROLBAR:SummonTomBombadilundGoldbeere
    ButtonBorderType         = ACTION
    DescriptLabel = CONTROLBAR:TooltipSummonTomBombadilundGoldbeere
    RadiusCursorType         = DunedainAlliesRadiusCursor
    CursorName                  = AttackObj
    InvalidCursorName           = GenericInvalid
End

CommandButton Command_PurchaseSpellBandderGefährten
    Command = PURCHASE_SCIENCE
    ButtonBorderType         = UPGRADE
    ButtonImage = HSGoldbeereandBombadil
    Science = SCIENCE_DieDreiJäger
    TextLabel = CONTROLBAR:SummonTomBombadilundGoldbeere
    DescriptLabel = CONTROLBAR:TooltipSummonTomBombadilundGoldbeere
End

All in all you get the exactly the other spell, but the reload time stays the same.
Titel: Re:Spell Books (coding)
Beitrag von: Lostir am 16. Apr 2013, 23:02
The OCL is in the data\ini\includes\objectcreationlist.inc
The Commandbuttons are in the  data\ini\includes\commandbutton.inc
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 16. Apr 2013, 23:35
Thanks you for help
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 26. Jun 2013, 18:28
How to pour in Edain a new spell book from another mod? (Which operations are necessary, which programs)
Titel: Re:Spell Books (coding)
Beitrag von: Prinz von Dol Amroth am 26. Jun 2013, 19:29
You need Final Big
You have to copy the Codes of the other mod and paste the Codes in Edain Mod.
For coding a new spell you need this files:
data\ini\science.ini
data\ini\object\system\system.ini
data\ini\specialpower.ini
data\ini\commandbutton.ini
data\ini\commandset.ini
maybe data\ini\fxlist.ini and data\ini\fxparticlesystem.ini, but only if there is a new fx.
If your spell is a modifier, you'll need the attributemodifier.ini or if your spell is ocl, you'll need the objectcreationlist.ini.
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 26. Jun 2013, 20:31
Suladan on the fourth level builds Mumakil pen. How to replace this ability on the    
healing from spellbook?
Titel: Re:Spell Books (coding)
Beitrag von: Prinz von Dol Amroth am 26. Jun 2013, 21:02
In the science.ini you have to change the name of the spell, which you want to replace into the name you want.
Science SCIENCE_forKingThranduil
[...]
End
And you have to change other spells, which need your spell for beeing able to buy, the old name into you name you want.
For example:
Science SCIENCE_Anduril
  PrerequisiteSciences = SCIENCE_GOOD OR SCIENCE_MEN SCIENCE_Heal
  SciencePurchasePointCost = 7 ;GOOD_RANK_2_COST
  SciencePurchasePointCostMP = 7 ;10
  IsGrantable = Yes
End
If you want to change the spell Heal you have to change by all other Spells, like Anduril in line "PrerequisiteSciences "SCIENCE_Heal" to for example "SCIENCE_ForKingThranduil" , but the thame name you have already chosen.


Then you look for a spell, which is alike your spell, you want to do. For example the LoneTowerSpell, which is a summon of a structure, too.
You have to look the alike spell in the files, I have already written and in the objectcreatiolinst.ini ,because you have a summon.
After that you can do your own spell, with new Commandbuttons.
At the end you have to change the Commandset of the Spellbook and there you replace the Commandbutton of the old spell with the new Commandbutton of your own spell.
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 26. Jun 2013, 22:28
Thank you but I couldn't do it all.
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 8. Jul 2013, 01:13
How to make so that Radagast was hired without a spell book?
Titel: Re:Spell Books (coding)
Beitrag von: Ealendril der Dunkle am 8. Jul 2013, 09:28
Change this button like this:

CommandButton Command_RadagastReviveSlot
    Command                = REVIVE
    Options                = CANCELABLE HIDE_WHILE_DISABLED       ;Hides button while disabled.
    TextLabel            = CONTROLBAR:GenericReviveHero
    ;ButtonImage        = ***Filled in automatically! No need to specify a button image.
    ButtonBorderType    = BUILD
    DescriptLabel        = CONTROLBAR:ToolTipGenericReviveHero
    InPalantir            = No
    Radial                = Yes
End

And King Thranduil.....plz try something for you own!
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 8. Jul 2013, 10:01
Thank you!

Zitat
plz try something for you own!

I'm writing here after I was unable to do or don't know how to do

You that it is hard to answer my questions?

If I knew how to do I didn't ask for help
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 11. Jul 2013, 09:01
I can not find OCL_ of Elven Wood(SpellBook).

Help please.
 
(http://i5.pixs.ru/storage/6/3/1/123jpg_1991589_8430631.jpg)
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 11. Jul 2013, 13:29
I changed the spell book of Lorien, in place  riders of Mirkwood put Elven Forest. That's all I did in the Commandbutton.inc

But in ObjectCreationList not found OCL_ of Elven Forest.

Tell me what to do. where do I find OCL_ of Elven Forest.

I do not know the code name of OCL_ Elven Forest.

Help please!
Titel: Re:Spell Books (coding)
Beitrag von: Prinz von Dol Amroth am 13. Jul 2013, 20:30
The Elven Forest is an old spell from RotW so the OCL is in the objectcreationlist.ini not inc.
The name is: OCL_ElvenWoodSeed
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 13. Jan 2014, 08:50
Added repair in Rohan, but doesn't work. Help fix

CommandButton Command_PurchaseSpellBaumeisterRohan
    Command = PURCHASE_SCIENCE
    ButtonBorderType = UPGRADE
    ButtonImage = SBGood_Baumeister
    Science = SCIENCE_RebuildMenRohan
    TextLabel = CONTROLBAR:BaumeisterRohan
    DescriptLabel = CONTROLBAR:TooltipBaumeisterRohan
End

CommandButton Command_SpellBookBaumeisterRohan
Command = SPELL_BOOK
    SpecialPower = SpellBookRebuildRohan
    ButtonImage = SBGood_Baumeister
Options = NEED_TARGET_POS
TextLabel = CONTROLBAR:BaumeisterRohan
ButtonBorderType = ACTION
DescriptLabel = CONTROLBAR:TooltipBaumeisterRohan
RadiusCursorType        = WiederaufbauEdainRadiusCursor
InvalidCursorName = GenericInvalid
End

SpecialPower SpellBookRebuildRohan
    Enum                    = SPECIAL_SPELL_BOOK_REBUILD
    Flags                    = WATER_OK RESPECT_RECHARGE_TIME_DISCOUNT
    ReloadTime                = SPELL_RECHARGE_TIME_TIER_2
    RadiusCursorRadius        = SPELL_REBUILD_RADIUS_CURSOR
    RequiredSciences        = SCIENCE_RebuildMenRohan
    InitiateAtLocationSound = SpellRebuild
End

    Behavior = SpecialPowerModule    SpellBookRebuild_ModuleTag2
        SpecialPowerTemplate        = SpellBookRebuildRohan
        AttributeModifier            = SpellBookBuildingHeal
        AttributeModifierRange        = 200
        AttributeModifierAffects    = ANY +STRUCTURE
        TriggerFX                    = FX_Industry
        UpdateModuleStartsAttack    = No
        AvailableAtStart            = No
        RequirementsFilterMPSkirmish = SPELL_BOOK_REQUIREMENTS_FILTER
        RequirementsFilterStrategic = SPELL_BOOK_REQUIREMENTS_FILTER_STRATEGIC
    End

ModifierList SpellBookBuildingHeal
    Category = SPELL
    Modifier = AUTO_HEAL 50   
    Modifier = PRODUCTION 200%        // Production increased 2x
    Duration = 120000                // 2 min worth of modifiers
    //ModelCondition = UPGRADE_ECONOMY_BONUS            // UPGRADE_ECONOMY_BONUS is used in draw module to fire particle FX
End
Titel: Re:Spell Books (coding)
Beitrag von: Ealendril der Dunkle am 13. Jan 2014, 10:14
Science.ini?
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 13. Jan 2014, 11:21
Science SCIENCE_RebuildMenRohan
  PrerequisiteSciences = SCIENCE_GOOD OR SCIENCE_ROHAN
  SciencePurchasePointCost = GOOD_RANK_1_COST
  SciencePurchasePointCostMP = 5
  IsGrantable = Yes
End
Titel: Re:Spell Books (coding)
Beitrag von: KingThranduil am 13. Jan 2014, 11:24
The ability to buy, but does not repair buildings