|
Post by nerdares on Oct 31, 2016 23:35:13 GMT
I think this is a common question for those who want to really customize the controller.
For each update that comes out in the future, there will be performance or stability updates etc. That means that there will be a change of code. Before that update, some people may have modified the code (like vThirdPersonController for example) for their liking. Now keep in mind, the new update will revert them back to the original changes of the vThirdPersonController code, with some extra stuff.
So bottom line is: What is an efficient way of implementing the updates into our modified code? Because I don't think anyone is going to want to compare the modified and the updated script side by side and see what to put in
|
|
|
Post by Chronicman on Nov 1, 2016 4:16:51 GMT
The best method I can think of is creating a new script and make all of you modifications via your script, a bridge if you will. Now this does not work for every thing, so some manual changes might have to be done, but at least most of the code changes are handled by your bridge script. Another thing you could look into is inheriting and overriding methods. Unity docs has a pretty good example of this.
|
|
|
Post by Chronicman on Nov 1, 2016 16:31:50 GMT
Also a third party script merging tool might be a viable option.
|
|
|
Post by nerdares on Nov 1, 2016 22:37:43 GMT
The best method I can think of is creating a new script and make all of you modifications via your script, a bridge if you will. Now this does not work for every thing, so some manual changes might have to be done, but at least most of the code changes are handled by your bridge script. Another thing you could look into is inheriting and overriding methods. Unity docs has a pretty good example of this. Not too sure about this bridge idea. Let's say I modify lots of things in vCharacter and vThirdPersonMotor (more specifically, I removed some of the health and stamina methods in vThirdPersonMotor, since I made my own survival system. Also, in vCharacter, changed all the health and stamina values to properties so that they can get and set the values from a my survival system script in which I am using for health and stamina values). What would I do then?
|
|
|
Post by nerdares on Nov 1, 2016 22:57:26 GMT
The best method I can think of is creating a new script and make all of you modifications via your script, a bridge if you will. Now this does not work for every thing, so some manual changes might have to be done, but at least most of the code changes are handled by your bridge script. Another thing you could look into is inheriting and overriding methods. Unity docs has a pretty good example of this. Acutally, I think I believe what you are going through with this. I can make a script called vModdedThirdPersonController, and what I can do is override those health methods and stamina methods and not implement them right? Because that would bring out the same effect as just removing those methods. And then after that, I must override the updating method in third person motor and make sure it doesn't call those non-implemented methods. Now I just have to deal with the fields in vCharacter and force them into properties....
|
|
|
Post by Chronicman on Nov 1, 2016 23:18:19 GMT
Yep that's correct if you override a method and leave it blank it would be the same as removing it(* if I understood the question correctly). The fields in properties should not be to much work to rewrite them.You could also pull the edited script out of you project before installing the newest version and copy paste the small stuff. That is where the third party script merging tool would come in handy.
|
|
|
Post by nerdares on Nov 1, 2016 23:42:54 GMT
Ah, another problem. Methods like ReduceStamina and HealthRecovery will not be able to get overriden. Is there a way I can force it?
|
|
|
Post by Chronicman on Nov 1, 2016 23:58:44 GMT
Yea it must contain the virtual type. * I'm not sure what the technical term is called but I can give you an example. public virtual void ChangeMaxStamina(int value) { } This will allow you to override the function. There might be another thing. Its been so long mate. Check out the link below for better instructions because I'm just horrible. unity3d.com/learn/tutorials/topics/scripting/overriding
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Nov 4, 2016 2:14:46 GMT
So is it possible to add scripts for addons, then when Invector updates, nothing much will change?
|
|
|
Post by Chronicman on Nov 4, 2016 18:42:39 GMT
Could you please rephrase your question I'm not certain on what your asking...
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Nov 21, 2016 18:47:43 GMT
hey Chronicman, whenever you get mods/addons from the forum, whenever Invector releases a new update, will it make the mod unplayable?
|
|
|
Post by Chronicman on Nov 22, 2016 1:05:21 GMT
That depends on how much they have changed, for instance the Exp level system should be good for a long time while the saving ad-don might need an update if they change the inventory. With the 2.0 version quite a bit changed so allot of the old add-ons might be useless. I think all mine are up to date though.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Nov 22, 2016 12:24:18 GMT
|
|
|
Post by dreadlord on Nov 22, 2016 16:12:35 GMT
That depends on how much they have changed, for instance the Exp level system should be good for a long time while the saving ad-don might need an update if they change the inventory. With the 2.0 version quite a bit changed so allot of the old add-ons might be useless. I think all mine are up to date though. Huh? What Exp level system? 😊
|
|
|
Post by Chronicman on Nov 22, 2016 17:27:43 GMT
That depends on how much they have changed, for instance the Exp level system should be good for a long time while the saving ad-don might need an update if they change the inventory. With the 2.0 version quite a bit changed so allot of the old add-ons might be useless. I think all mine are up to date though. Huh? What Exp level system? 😊 invector.proboards.com/thread/10/xp-leveling-survival-addon-scriptsthis one made by jgiroux
|
|