Modding Union
[en] - Modding Corner => General Modding Questions => Thema gestartet von: DropItLikeItsDogg am 30. Aug 2022, 18:14
-
Greetings, I'm not into modding things, and also I play the game singleplayer, so can someone explain me how can I add Gandalf's bubble shield to Saruman? I want it to be active automatically like Gandalf's, not a button. And how can I make Saruman's staff glow after a strike? I tried some but I couldn't manage. Thanks already for your help.
-
What did you try so far? It would be very helpful to know how experienced you are to be able to give you some pointers.
-
Like I said I'm not experienced in those things. I tried gandalf.ini bubble shield code copy
to saruman.ini, but it didn't work. I searched commandset, and special powers etc. but I couldn't manage. As for the glowing staff, I didn't do anything, I just wanted to know is it possible or not and how. Also can you help me adding a hero to another faction if it is possible? :)
-
Ok, so step by step. This is the code for the ability that you need to copy to Saruman's .ini:
;-----------------------------------------------------
; Automatische Lichtsphere (Ohne Ring) aus Sum1
;-----------------------------------------------------
Behavior = SpecialPowerModule ModuleTag_ShieldBubbleStarter
SpecialPowerTemplate = SpecialPowerShieldBubbleEdain ;aus Sum1
UpdateModuleStartsAttack = No
AttributeModifier = GandalfShieldBubbleBonusEdain ;aus Sum1
AttributeModifierRange = 1
AttributeModifierAffectsSelf = Yes
AttributeModifierAffects = ANY +CAVALRY +INFANTRY
SetModelCondition = ModelConditionState:USER_3
SetModelConditionTime = 2.5
End
Behavior = SpecialAbilityUpdate ModuleTag_ShieldBubbleUpdate
SpecialPowerTemplate = SpecialPowerShieldBubbleEdain
UnpackTime = 0
PreparationTime = 0.1
PackTime = 0.15
AwardXPForTriggering = 0
End
Behavior = AutoAbilityBehavior ModuleTag_AutoAbilitySpecialPowerShieldBubble
SpecialAbility = SpecialPowerShieldBubbleEdain
StartsActive = Yes
MaxScanRange = 50
Query = 1 ANY ENEMIES +MONSTER +HERO
End
Behavior = SpecialPowerModule ModuleTag_Leadership
SpecialPowerTemplate = SpecialAbilityFakeLeadership
UpdateModuleStartsAttack = No
StartsPaused = No
End
If you want Saruman to also get the visual indicator (the white bubble around him), you need to also copy the W3DScriptedModelDraw module. You can see in the code above that the ability uses the ModelCondition USER_3, so we look for that in Gandalf's ini and find this:
Draw = W3DScriptedModelDraw ModuleTag_ShieldBubble
DefaultModelConditionState
Model = None
End
ModelConditionState = USER_3
Model = GUGANDALFCRSTL
ParticleSysBone = ROOTTRANSFORM GandalfCrystalSphere FollowBone:Yes
ParticleSysBone = ROOTTRANSFORM GandalfBeamGlow2 FollowBone:Yes
End
End
Copy this as well. The ParticleSysBone you see at the bottom are the FX.
In the last step, add a commandbutton to Saruman's commandset - you can once again simply copy one from Gandalf's commandset: 8 = Command_GandalfShieldBubbleEdain
With that, Saruman should be good to go.
If you want to add a hero to another faction, simply add him to the list BuildableHeroesMP of the new faction in the playertemplate.ini. You might have to add GenericReviveSlots to the commandset of the fortress in order to recruit the hero. As long as you don't exceed the limit (our dwarves in Edain are at the limit, for example), this is relatively simple.
Good luck!
-
I added those to Saruman.ini but the bubble only activates when I throw a fireball on top of the citadel to enemy. I want it to be activated automatically like Gandalf's. Am I doing something wrong? And, I added 3 heroes to Imladris, but they disappear and come back time to time in the buildings. Heroes replaces heroes in buildings and change again. Is that about GenericReviveSlots ?
-
I added 3 heroes to Imladris, but they disappear and come back time to time in the buildings. Heroes replaces heroes in buildings and change again. Is that about GenericReviveSlots ?
Yes. The heroes you add in the playertemplate need their own GenericReviveSlot. Which slot they need depends on their spot on the list: If they are the third hero, they will use the third spot; if they are the fifth hero, they will use the fifth spot and so on. It will be easiest to add them at the end of the list and then add three more GenericReviveSlots to the end of the commandset of your fortress.
I added those to Saruman.ini but the bubble only activates when I throw a fireball on top of the citadel to enemy. I want it to be activated automatically like Gandalf's. Am I doing something wrong?
It seems like it^^
The autoability is responsible for automatically triggering the bubble, this part here:
Behavior = AutoAbilityBehavior ModuleTag_AutoAbilitySpecialPowerShieldBubble
SpecialAbility = SpecialPowerShieldBubbleEdain
StartsActive = Yes
MaxScanRange = 50
Query = 1 ANY ENEMIES +MONSTER +HERO
End
Make sure there is no other code interfering with it.
-
Here are the codes. I really can't see anything wrong, can you? The bubble only appears when I throw a fireball on top of the citadel, which is strange. :D And it appears like 1-2 minutes then disappear until the next fireball.
(https://i.hizliresim.com/3dhs5ne.png) (https://www.hizliresim.com/3dhs5ne)
(https://i.hizliresim.com/4rvnli2.png) (https://www.hizliresim.com/4rvnli2)
-
Assuming you are modding Edain, you are editing the wrong commandset.
-
I also tried to edit commandset.inc but it always restarts when I open the game. How can I save the changes I've made? Sorry for too many questions, I searched but I couldn't.
-
What are you using to mod the game? You can use Notepad++ to edit .inc files.
1) Extract the .big file into a folder.
2) Change stuff.
3) Save them as a new .big file.
4) Replace the old .big with the new one.
-
Thanks! It worked. :)
-
Happy to help :)