Dans ce tuto, je vous expliquerai comment modifier completement l'arbre des pouvoirs pour une faction, sans perturber les autres factions (ainsi, vous pourrez sans probleme avoir deux factions avec les meme pouvoirs mais à des prix ou places différentes).
Tout d'abord, voici l'arbre que l'on veut créer avec les pouvoirs numérotés de 1 à 12 :
- Code:
-
1 2 3
4 5 6 7
8 9 10
11 12
Ils sont dans cet ordre dans le commandset qu'on vera plus loin.
Je vous conseille d'écrire quelque part l'ordre des pouvoirs sur l'arbre que vous prévoyez de faire
Dans le bloc PlayerTemplate de votre faction (dans playertemplate.ini), il y a 3 lignes qui déterminent l'arbre des pouvoirs :
- Code:
-
IntrinsicSciencesMP = truc
SpellBookMp = bidule
PurchaseScienceCommandSetMP = machin
IntrinsicSciencesMP correspond à une science qui est donnée dès le départ à la faction
SpellBookMp correspond au spellBook de la faction, c'est un objet invisible qui comprend tout les modules des pouvoirs de l'arbre
PurchaseScienceCommandSetMP correspond à ce qu'on appelle le "spellstore" (magasin à pouvoir) c'est juste un commandset qui détermine les boutons qui sont affiché quand on ouvre l'arbre des pouvoirs
On va commencer par créer de toutes nouvelles valeurs pour ces lignes et on créera, la science, le spellbook et le commandset du spellstore
Donc pour votre faction, modifiez ces 3 lignes comme ceci :
- Code:
-
IntrinsicSciencesMP = SCIENCE_PERSO
SpellBookMp = SpellBookPerso
PurchaseScienceCommandSetMP = SpellStorePersoCommandSet
1 / les Sciences
Commencons par faire fonctionner la ligne IntrinsicSciencesMP = SCIENCE_PERSO, le jeu ne sais pas ce qu'est SCIENCE_PERSO donc on le crée :
Dans science.ini, copiez :
- Code:
-
Science SCIENCE_PERSO
PrerequisiteSciences = None
SciencePurchasePointCost = 0
IsGrantable = No
End
Il faudra aussi créer des sciences pour les 12 pouvoirs, donc copiez aussi a la suite :
- Code:
-
Science SCIENCE_Pouvoir1
PrerequisiteSciences = SCIENCE_PERSO
SciencePurchasePointCost = 5
SciencePurchasePointCostMP = 5
IsGrantable = Yes
End
Science SCIENCE_Pouvoir2
PrerequisiteSciences = SCIENCE_PERSO
SciencePurchasePointCost = 5
SciencePurchasePointCostMP = 5
IsGrantable = Yes
End
Science SCIENCE_Pouvoir3
PrerequisiteSciences = SCIENCE_PERSO
SciencePurchasePointCost = 5
SciencePurchasePointCostMP = 5
IsGrantable = Yes
End
Science SCIENCE_Pouvoir4
PrerequisiteSciences = SCIENCE_Pouvoir1
SciencePurchasePointCost = 10
SciencePurchasePointCostMP = 10
IsGrantable = Yes
End
Science SCIENCE_Pouvoir5
PrerequisiteSciences = SCIENCE_Pouvoir1 OR SCIENCE_Pouvoir2
SciencePurchasePointCost = 10
SciencePurchasePointCostMP = 10
IsGrantable = Yes
End
Science SCIENCE_Pouvoir6
PrerequisiteSciences = SCIENCE_Pouvoir2 OR SCIENCE_Pouvoir3
SciencePurchasePointCost = 10
SciencePurchasePointCostMP = 10
IsGrantable = Yes
End
Science SCIENCE_Pouvoir7
PrerequisiteSciences = SCIENCE_Pouvoir3
SciencePurchasePointCost = 10
SciencePurchasePointCostMP = 10
IsGrantable = Yes
End
Science SCIENCE_Pouvoir8
PrerequisiteSciences = SCIENCE_Pouvoir4 OR SCIENCE_Pouvoir5
SciencePurchasePointCost = 15
SciencePurchasePointCostMP = 15
IsGrantable = Yes
End
Science SCIENCE_Pouvoir9
PrerequisiteSciences = SCIENCE_Pouvoir5 OR SCIENCE_Pouvoir6
SciencePurchasePointCost = 15
SciencePurchasePointCostMP = 15
IsGrantable = Yes
End
Science SCIENCE_Pouvoir10
PrerequisiteSciences = SCIENCE_Pouvoir6 OR SCIENCE_Pouvoir7
SciencePurchasePointCost = 15
SciencePurchasePointCostMP = 15
IsGrantable = Yes
End
Science SCIENCE_Pouvoir11
PrerequisiteSciences = SCIENCE_Pouvoir8 OR SCIENCE_Pouvoir9
SciencePurchasePointCost = 25
SciencePurchasePointCostMP = 25
IsGrantable = Yes
End
Science SCIENCE_Pouvoir12
PrerequisiteSciences = SCIENCE_Pouvoir9 OR SCIENCE_Pouvoir10
SciencePurchasePointCost = 25
SciencePurchasePointCostMP = 25
IsGrantable = Yes
End
Une petite explication s'impose : pour pouvoir débloquer un pouvoir sur l'arbre il faut parfois en avoir acheté un autre
La ligne PrerequisiteSciences décrit les pouvoirs pouvant débloquer l'achat d'un autre pouvoir
Ici j'ai mis l'ordre par défaut comme dans le jeu
Pour le pouvoir 12 par exemple, j'ai mis SCIENCE_Pouvoir9 OR SCIENCE_Pouvoir10, cela signifie que pour débloquer ce pouvoir il faut le pouvoir 9 OU le pouvoir 10
Remarquez que les pouvoirs 1, 2 et 3 sont débloquables dès le départ, donc la science requise est SCIENCE_PERSO, c'est a dire la science que l'on a déjà au départ
Si on avait retirer le OR, ca aurait fait PrerequisiteSciences = SCIENCE_Pouvoir9 SCIENCE_Pouvoir10, et alors le jeu aurait compris qu'il faut le pouvoir9 ET le pouvoir 10 pour débloquer le pouvoir 12.
Juste pour le fun, vous pouvez essayer de retirer les OR pour les sciences des pouvoirs 4 à 12 et alors pour pouvoir débloquer un pouvoir il faut avoir acheté les deux d'au dessus de lui au lieu d'un seul.
2 / Le spell book
C'est l'objet, invisible dans le jeu, qui sert a conserver les modules des pouvoirs (car pour fonctionner un pouvoir a besoin d'un ou plusieurs modules).
Tout se passe maintenant dans system.ini,
Commencons par créer notre spellbook : copiez ceci pour l'instant dans system.ini :
- Code:
-
Object SpellBookPerso
EditorSorting = SYSTEM
; *** ART Parameters ***
Draw = W3DDefaultDraw ModuleTag_01
;nothing
End ; Never drawn
CommandSet = SpellBookPersoCommandSet
RadarPriority = NOT_ON_RADAR
KindOf = SPELL_BOOK IMMOBILE IGNORES_SELECT_ALL INERT
;; MODULES DE POUVOIRS
End
vous voyez que j'ai mis un commentaire, c'est là qu'il faut placer les modules de pouvoir.
Là c'est très simple, il suffit de partir à la pêche aux modules : dans ce meme fichier system.ini, il y a les object EvilSpellBook et GoodSpellBook qui correspondent aux spellbook du mal et du bien. Dans ces objets, il suffit de copier les modules des pouvoirs que vous voulez, et de les coller dans votre spellbookperso à la place de mon commentaire.
N'oubliez pas de modules sinon le pouvoir dont le module est oublié ne fonctionnera pas.
comme vous l'avez sans doutes remaqué, dans mon spellbook perso il y a la ligne
- Code:
-
CommandSet = SpellBookPersoCommandSet
Le jeu ne sais pas encore ce qu'est SpellBookPersoCommandSet donc il faudra le créer
3 / les commandSet
Donc si vous avez bien suivi, il faut créer 2 commandset
- celui pour le spellstore qu'on a utilisé dans le player template : SpellStorePersoCommandSet
- et le commandset du spellbook : SpellBookPersoCommandSet
Allez maintenant dans commandset.ini,
commencez par remplir SpellBookPersoCommandSet comme ceci
- Code:
-
CommandSet SpellBookPersoCommandSet
1 = Command_SpellBookPouvoir1
2 = Command_SpellBookPouvoir2
3 = Command_SpellBookPouvoir3
4 = Command_SpellBookPouvoir4
5 = Command_SpellBookPouvoir5
6 = Command_SpellBookPouvoir6
7 = Command_SpellBookPouvoir7
8 = Command_SpellBookPouvoir8
9 = Command_SpellBookPouvoir9
10 = Command_SpellBookPouvoir10
11 = Command_SpellBookPouvoir11
12 = Command_SpellBookPouvoir12
End
Maintenant vous allez modifier chaque commandbutton de ce commandset par celui du pouvoir que vous avez choisi pour cette place
Pour connaitre la liste des commandbuttons des pouvoirs déjà existants, cherchez les commandset EvilSpellBookCommandSet et GoodSpellBookCommandSet qui contiennent les commandbuttons des pouvoirs du mal et du bien. Je vous les ai copié pour vous ici, il vous suffit de copier coller les commanbuttons des pouvoirs que vous avez choisis :
- Code:
-
CommandSet EvilSpellBookCommandSet
1 = Command_SpellBookTaint
2 = Command_SpellBookEyeofSauron
3 = Command_SpellBookBarricade
4 = Command_SpellBookWarChant
5 = Command_SpellBookPalantirVision
6 = Command_SpellBookCrebain
7 = Command_SpellBookCaveBats
8 = Command_SpellBookBlight
9 = Command_SpellBookChillWind
10 = Command_SpellBookIndustry
11 = Command_SpellBookDevastation
12 = Command_SpellBookUntamedAllegiance
13 = Command_SpellBookArrowVolleyEvil
14 = Command_SpellBookWildMenAllies
15 = Command_SpellBookScavenger
16 = Command_SpellBookEvilEyeofSauron
17 = Command_SpellBookSpiderlingAllies
18 = Command_SpellBookFrozenLand
19 = Command_SpellBookSnowbind
20 = Command_SpellBookDarkness
21 = Command_SpellBookAwakenWyrm
22 = Command_SpellBookFreezingRain
23 = Command_SpellBookFueltheFires
24 = Command_SpellBookWatcherAlly
25 = Command_SpellBookSummonGiants
26 = Command_SpellBookSummonWights
27 = Command_SpellBookBalrogAlly
28 = Command_SpellBookRainOfFire
29 = Command_SpellBookDragonAlly
30 = Command_SpellBookDragonStrike
31 = Command_SpellBookSummonShadeOfWolf
32 = Command_SpellBookAvalanche
End
CommandSet GoodSpellBookCommandSet
1 = Command_SpellBookHeal
2 = Command_SpellBookElvenGifts
3 = Command_SpellBookLoneTowerDwarf
4 = Command_SpellBookEnshroudingMist
5 = Command_SpellBookRallyingCall
6 = Command_SpellBookTomBombadil
7 = Command_SpellBookHobbitAllies
8 = Command_SpellBookRebuild
9 = Command_SpellBookArrowVolleyGood
10 = Command_SpellBookElvenWood
11 = Command_SpellBookDwarvenRiches
12 = Command_SpellBookMenOfDaleAllies
13 = Command_SpellBookCloudBreak
14 = Command_SpellBookRohanAllies
15 = Command_SpellBookDunedainAllies
16 = Command_SpellBookEntAllies
17 = Command_SpellBookEagleAllies
18 = Command_SpellBookUndermine
19 = Command_SpellBookBombard
20 = Command_SpellBookArmyoftheDead
21 = Command_SpellBookEarthquake
22 = Command_SpellBookFlood
23 = Command_SpellBookSunflare
24 = Command_SpellBookCitadel
25 = Command_SpellBookFarsight
End
Par exemple, j'en ai créé un pour ma faction, le voici :
- Spoiler:
- Code:
-
CommandSet SpellBookPersoCommandSet
1 = Command_SpellBookPalantirVision
2 = Command_SpellBookRebuild
3 = Command_SpellBookChillWind
4 = Command_SpellBookArrowVolleyGood
5 = Command_SpellBookElvenWood
6 = Command_SpellBookAwakenWyrm
7 = Command_SpellBookRallyingCall
8 = Command_SpellBookCloudBreak
9 = Command_SpellBookEagleAllies
10 = Command_SpellBookBombard
11 = Command_SpellBookBalrogAlly
12 = Command_SpellBookSummonShadeOfWolf
End
C'est tout pour ce premier commandset, mais le suivant est aussi chiant que facile à créer...
pour le second copiez ceci dans commandset.ini :
- Code:
-
CommandSet SpellStorePersoCommandSet
1 = Command_PurchaseSpellPouvoir1
2 = Command_PurchaseSpellPouvoir2
3 = Command_PurchaseSpellPouvoir3
4 = Command_PurchaseSpellPouvoir4
5 = Command_PurchaseSpellPouvoir5
6 = Command_PurchaseSpellPouvoir6
7 = Command_PurchaseSpellPouvoir7
8 = Command_PurchaseSpellPouvoir8
9 = Command_PurchaseSpellPouvoir9
10 = Command_PurchaseSpellPouvoir10
11 = Command_PurchaseSpellPouvoir11
12 = Command_PurchaseSpellPouvoir12
End
Le probleme est que cette fois ci on ne va pas pouvoir utiliser les commandbutton déjà créés par EA, en effet dans commandbutton.ini si on en regarde un (vision d'isengard par exemple) :
- Code:
-
CommandButton Command_PurchaseSpellPalantirVision
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBEvil_PalantirVision
Science = SCIENCE_PalantirVision
TextLabel = CONTROLBAR:PalantirVision
DescriptLabel = CONTROLBAR:TooltipPalantirVision
End
on voit qu'il y a SCIENCE_PalantirVision, mais on ne peut pas modifier cela sinon ca perturerait l'isengard qui utilisent déjà ce pouvoir.
Moi par exemple je le veux en pouvoir 1 pour ma faction, et bien je fais un copier coller et je modifie le nom et la science :
- Citation :
- CommandButton Command_PurchaseSpellPouvoir1
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBEvil_PalantirVision
Science = SCIENCE_Pouvoir1
TextLabel = CONTROLBAR:PalantirVision
DescriptLabel = CONTROLBAR:TooltipPalantirVision
End
comme ca le bouton garde les autres propriétés du bouton original, entre autre l'image et la description
Il suffit de faire cela pour chacun des 12 pouvoirs que vous souhaitez ajouter
Voila un exemple de ce que j'ai obtenu pour ma faction (dans commandbutton.ini) :
- Code:
-
CommandButton Command_PurchaseSpellPouvoir1
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBEvil_PalantirVision
Science = SCIENCE_Pouvoir1
TextLabel = CONTROLBAR:PalantirVision
DescriptLabel = CONTROLBAR:TooltipPalantirVision
End
CommandButton Command_PurchaseSpellPouvoir2
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBGood_Rebuild
Science = SCIENCE_Pouvoir2
TextLabel = CONTROLBAR:Rebuild
DescriptLabel = CONTROLBAR:TooltipRebuild
End
CommandButton Command_PurchaseSpellPouvoir3
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = KUChillWindIcon
Science = SCIENCE_Pouvoir3
TextLabel = CONTROLBAR:ChillWind
DescriptLabel = CONTROLBAR:TooltipChillWind
End
CommandButton Command_PurchaseSpellPouvoir4
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBGood_ArrowVolley
Science = SCIENCE_Pouvoir4
TextLabel = CONTROLBAR:ArrowVolley
DescriptLabel = CONTROLBAR:TooltipArrowVolley
End
CommandButton Command_PurchaseSpellPouvoir5
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBGood_ElvenWood
Science = SCIENCE_Pouvoir5
TextLabel = CONTROLBAR:ElvenWood
DescriptLabel = CONTROLBAR:TooltipElvenWood
End
CommandButton Command_PurchaseSpellPouvoir6
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBEvil_AwakenWyrm
Science = SCIENCE_Pouvoir6
TextLabel = CONTROLBAR:AwakenWyrm
DescriptLabel = CONTROLBAR:TooltipAwakenWyrm
End
CommandButton Command_PurchaseSpellPouvoir7
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBGood_RallyingCall
Science = SCIENCE_Pouvoir7
TextLabel = CONTROLBAR:RallyingCall
DescriptLabel = CONTROLBAR:TooltipRallyingCall
End
CommandButton Command_PurchaseSpellPouvoir8
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBGood_CloudBreak
Science = SCIENCE_Pouvoir8
TextLabel = CONTROLBAR:CloudBreak
DescriptLabel = CONTROLBAR:TooltipCloudBreak
End
CommandButton Command_PurchaseSpellPouvoir9
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBGood_EagleAllies
Science = SCIENCE_Pouvoir9
TextLabel = CONTROLBAR:SummonEagleAllies
DescriptLabel = CONTROLBAR:TooltipSummonEagleAllies
End
CommandButton Command_PurchaseSpellPouvoir10
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBGood_Bombard
Science = SCIENCE_Pouvoir10
TextLabel = CONTROLBAR:Bombard
DescriptLabel = CONTROLBAR:TooltipBombard
End
CommandButton Command_PurchaseSpellPouvoir11
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = SBEvil_BalrogAlly
Science = SCIENCE_Pouvoir11
TextLabel = CONTROLBAR:SummonBalrog
DescriptLabel = CONTROLBAR:TooltipSummonBalrog
End
CommandButton Command_PurchaseSpellPouvoir12
Command = PURCHASE_SCIENCE
ButtonBorderType = UPGRADE
ButtonImage = KUShadeOfTheWolfIcon
Science = SCIENCE_Pouvoir12
TextLabel = CONTROLBAR:SummonShadeOfWolf
DescriptLabel = CONTROLBAR:TooltipSummonShadeOfWolf
End
Et voia c'est terminé pour les commandset c'est long (et encore, 5 minutes ca va...) mais c'était facile.
Il reste quand meme une derniere chose : les special power qui ne sont toujours pas reliés aux SCIENCE_PouvoirXX
4 / Les special powers :
allez dans specialpower.ini, il faut dire aux specialpower que nos sciences sont reliés à eux
par exemple j'ai utilisé le pouvoir de vision d'isengard en premier pouvoir :
je recherche le special power du pouvoir dans specialpower.ini,
comment je fais pour connaitre le nom du special power ? c'est très simple, dans mon SpellBookPersoCommandSet le commandbutton s'appelle Command_SpellBookPalantirVision, donc je cherche ceci dans commandbutton.ini et je tombe 2 lignes en dessous sur SpecialPower = SpellBookPalantirVision. C'est le nom du special power que je recherche dans specialpower.ini et dc'est aussi simple pour tout les autres.
Dans mon cas je trouve :
- Code:
-
SpecialPower SpellBookPalantirVision
Enum = SPECIAL_SPELL_BOOK_PALANTIR_VISION
Flags = WATER_OK RESPECT_RECHARGE_TIME_DISCOUNT
ReloadTime = SPELL_RECHARGE_TIME_TIER_1 ; in milliseconds
RadiusCursorRadius = 300.0
RequiredSciences = SCIENCE_PalantirVision
InitiateAtLocationSound = SpellPalantirVision
End
Je vais juste ajouter ma science à la ligne des sciences requises pour le pouvoir, comme ceci :
- Citation :
- SpecialPower SpellBookPalantirVision
Enum = SPECIAL_SPELL_BOOK_PALANTIR_VISION
Flags = WATER_OK RESPECT_RECHARGE_TIME_DISCOUNT
ReloadTime = SPELL_RECHARGE_TIME_TIER_1 ; in milliseconds
RadiusCursorRadius = 300.0
RequiredSciences = SCIENCE_PalantirVision SCIENCE_Pouvoir1
InitiateAtLocationSound = SpellPalantirVision
End
Faites pareils pour les autres pouvoirs de SCIENCE_Pouvoir2, SCIENCE_Pouvoir3, etc.... jusqu'a SCIENCE_Pouvoir12
Une fois ceci terminé, sauvegardez, lancez le jeu et profitez de votre nouvel arbre des pouvoirs
Ceci vous a permis d'utiliser des pouvoirs déjà existants, mais comment faire pour ajouter des tout nouveaux pouvoirs ? la suite dans un prochain
épisode tuto