By EdGann Date Created: 5/5/2002
Many of you may want to change the augmentations or skills in the DX system. This requires several steps. What I'm going to do is explain how the system works currently, then explain how to change it. Both the Augs and Skills in DX work in the same way. The Class DeusExPlayer creates and AugmentationManager and a SkillManager that controls these functions. Both of these managers are created in:
Function InitializeSubSystems
Which is called from the PostBeginPlay Function.
When the managers are created, they also create all of the Augs and all of the Skills for the player. The Augs and Skills that are created are set in the default properties section.
This may be a little confusing though, all of the Augs are actually created for the player when the game starts, but there is a field in each aug called:
bHasIt
For most of the augs this is set to False and only changed when the Aug is actually found in the game. But the Default Properties section of the AugmentationManager also has selections for the Default Augs that JC Starts with.
Once the Managers are created, they handle all the Display, Upgrades, etc. There is also a Augmentation and a Skill Class that is the root for both the augs and skill classes, these classes control the amount of energy each aug uses and the effect of each of the augs and skills. (Some of the code for the effects of the augs and skills is in DeusExPlayer.)
Now lets talk about changing these systems. What you need to do is create a subclass of the
AugmentationManager and a subclass of the SkillManager. You also need to create the new Augs and Skills that you want to use, but the details of that will come in a later topic.
In the Default Properties of the managers, you need to change the Augs and Skills that are created to the ones that you want created. Then you need to tell DeusExPlayer to use your new managers.
To do this, you need to SubClass JCDentonMale. By definition, this is also a subclass of DeusExPlayer. In your SubClass of JCDentonMale, you need to create a function called InitializeSubSystems. This will replace the InitializeSubSystems in DeusExPlayer, which is not actually a good thing because that function does a lot of things.
So the first thing you need to do is run the InitializeSubSystems in DeusExPlayer by executing the function:
Super.InitializeSubSystems();
Now that you have done that, you have created a copy of the old managers for DeusExPlayer with all the old Augs and Skills, these need to be destroyed. You need to execute the following functions:
AugmentationSystem.Destroy();
SkillSystem.Destroy();
Notice that these are not called managers, they are called systems. If you look in the declarations section in DeusExPlayer, you will see that the actual variables that point to the Aug manager and Skill Manager are AugmentationSystem and SkillSystem. Now lets use these variable to create our managers by executing the code:
AugmentationSystem = Spawn(class'YourAugmentationManager', Self);
YourAugmentationSystem.CreateAugmentations(Self);
YourAugmentationSystem.AddDefaultAugmentations();
SkillSystem = Spawn(class'YourSkillManager', Self);
SkillSystem.CreateSkills(Self);
This is all basically a cut and paste from the IntializeSubSystems in DeusExPlayer with a couple of changes so it creates YourManagers instead of the original ones.
And that's basically it. But this doesn't mean that your new Skill or Augmentation will work. The system is looking for the old skills and Augs, so you need to change the system so it looks for your new and improved augs and skills.
BTW, if you want to see a sample of this in action, check out the UC Mod. Look at the class UCMe for the code that is changed to recreate the Aug Manager and to make the new Augs work. (The Skills aren't changed in that system.) You will notice that I use a slightly different system there. But that's cause it was the first change to the system and I wasn't sure how to do it.
|