Hi all!
This is possible to add (replace) new body after some upgrade? like Gandalf gray turn on Gandalf white
#1
Posted 23 October 2016 - 08:21 PM
#2
Posted 24 October 2016 - 07:47 PM
Certainly; there are many things you can do to achieve that, 3 that I know of, depending on what you want.
First, the BFME 1 aproach.
In that game you can purchase a player upgrade via the spellbook store, the power is called "Gandalf the White" and upgrades Gandalf the Grey, so you can have a level 10 Gandalf the Grey or a level 1 Gandalf the White, and so on. The method they used, to change the texture is that in all the animation code there are some btis that are used as long as the object (Gandalf) has the flag "USER_2". Now, the moment when the code triggers the flag, is when you buy the "Gandalf the White" power in the spellstore, which grants you the upgrade "Upgrade_GandalfWhite"; once you have it, this happens in the code:
Behavior = ModelConditionUpgrade ModuleTag_TurnWhite TriggeredBy = Upgrade_GandalfWhite AddConditionFlags = USER_2 End
The Second method, and they also used thi in BFME 1, is if you want to change the health/armor/weapon of your object.
I made a hero which, as she levels up, she recieves armor, damage, and health boosts. Basically, as she levels up, she recieves upgrades that trigger the boosts, here's the code of that:
Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroToughnessEnabler SpecialPowerTemplate = SpecialAbilityIdrialToughness TriggeredBy = Upgrade_ObjectLevel5 End Behavior = SpecialPowerModule ModuleTag_CreateAHeroToughnessStarter SpecialPowerTemplate = SpecialAbilityIdrialToughness UpdateModuleStartsAttack = Yes StartsPaused = Yes End Behavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroToughnessUpdate // TODO figure out how to do this as a one time thing StartsActive = No ;If no, requires upgrade to turn on. BonusName = IdrialToughnessBonus TriggeredBy = Upgrade_ObjectLevel5 RefreshDelay = 2000 Range = 0 AllowSelf = Yes End Behavior = ArmorUpgrade ArmorUpgradeModuleTag TriggeredBy = Upgrade_ObjectLevel5 ArmorSetFlag = PLAYER_UPGRADE End Behavior = WeaponSetUpgrade WeaponSetUpgradeModuleTag TriggeredBy = Upgrade_ObjectLevel5 End
As you can see, I copied the code of the CaH toughness and changed the modifier that she receives. In case you are wondering, the armor set and weapon set change as they do with regular units.
The third and last option that I can think of, is by replacing the object entirely. Again, this is through an upgrade (which you can recieve by many means, including leveling up, spellstore, even attribute modifier, if you want to). After receiving an upgrade, you can use the ReplaceSelfUpgrade module like any wall segment in the game. This is how the walls do it:
Behavior = ReplaceSelfUpgrade ModuleTag_Replace_With_Hub ReplaceWith = ElvenCastleWallHub TriggeredBy = Upgrade_ElvenWallHub ConflictsWith = Upgrade_ElvenWallRegularGate Upgrade_ElvenWallTower //666 End
You can do the exact same thing, with the propper upgrades and objects, you can even delete the "ConflictsWith" part, I don't think you'll miss it.
Edited by malvack, 24 October 2016 - 07:48 PM.
#3
Posted 25 October 2016 - 04:53 PM
Thanks malvack)
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users