|
Post by nerdares on Mar 7, 2017 1:39:06 GMT
I think a good example of what I'm trying to achieve can be best explained by looking at the ItemListData in invector's melee combat.
If you go to the package, find "ItemListData". There's a button where you can add items. In my case, I'd like to do the same thing, but just add subsystems.
If you click on any item in the ItemListData, you can edit some properties. I would like to do the similar approach with my subsystems.
What are the scripts I should look at for all the stuff that deals with ItemListData?
|
|
|
Post by jorg3n3gr3iros on Mar 7, 2017 15:53:42 GMT
I think a good example of what I'm trying to achieve can be best explained by looking at the ItemListData in invector's melee combat. If you go to the package, find "ItemListData". There's a button where you can add items. In my case, I'd like to do the same thing, but just add subsystems. If you click on any item in the ItemListData, you can edit some properties. I would like to do the similar approach with my subsystems. What are the scripts I should look at for all the stuff that deals with ItemListData? Hi man. The items and ItemList are in the vItemListWindow and ItemEditor. The ItemListDataEditor open the vItemListWindow. vItemListWindow create itemDrawers using a subclass of ItemEditor. To create new Items, The vItemListWindow make a instance of ScriptableObject vItem and save this like subAssets child of Scriptable ItemList, hidden in from the hierarchy. The scriptableObject vItem can be cloned using Instantiate like a gameObject. I'm used to hide from the Hierarchy because the order of the subassets is not correct. hidden is more beautiful.
|
|
|
Post by uberwiggett on Mar 8, 2017 10:09:33 GMT
|
|
|
Post by nerdares on Mar 10, 2017 0:41:10 GMT
Thanks for that. Ok so I have a plan: I already made it so you can create a ScriptableObject which will serve as templates for the character. Inside the code for the scriptable object: It needs to have a static enumeration of the types of subsystems the user already has. This enum needs to be dynamic. That means that if the user creates another subsystem, then maybe he's gonna click a custom menu item that I have made that will make a subsystem for him. If he clicks this menu item ( this menu item im talking about is hypothetical), then it will add the new subsystem to the enumeration. It needs to contain a list of subsystems. (this list of course will not be static. Every Template-ScriptableObject you create is like a new instance, so every list should be different than the other Template-ScriptableObject). This list will contain relevant subsystems that the user intends for the Template-ScriptableObject to have. ^There is a problem with this though. Every subsystem derives from a class called BaseSystem. If we have a list of BaseSystem then how does the computer know what each individual element actually is? If each subsystem, whether it's health or stamina, derives from BaseSystem, then how are we going to be able to edit the unique properties of each subsystem if the list is limited to what BaseSystem can do? The inspector for the Template-ScriptanleObject: It will be formatted as so: At the top: Enum drop down list where you can select what subsystem you want to add. On the right will be a Button to add Below will be a list of subsystems. The properties of each subsystem will be collapsed in a drop down, list-like display, with the name of the subsystem as the name of the drop down list (much like how a seralized array in the inspector would display itself). Expanding each individual subsystem list will show unique properties that can be editable. Additionally on the right of each subsystem will be a button to remove
|
|
|
Post by nerdares on Mar 17, 2017 5:25:14 GMT
Just put up a quick update!
You should now be able to adjust values of a vSurvivalPlayer's subsystems before run time You shouldn't be getting an error of "v3rdPersonCamera is undefined" anymore with this current update
|
|
|
Post by nerdares on Mar 17, 2017 23:34:35 GMT
InvectorHey man, what do you think would be a viable solution for an automatic script replacer. As you may have known, in my package, it requires some necessary script manipulating (Im talking about vCharacter, vThirdPersonMotor, vThirdPersonInput, etc.) I was thinking I just just include the modified scripts within my package. Then, I can make a menu item button that will automatically replace the scripts. Would this be counted as infringement or anything because users have free access to those scripts? Here are the scripts that will need to be modified and potentially included in the package : vCharacter vThirdPersonMotor vThirdPersonInput vCharacterStandalone v_AI_Controller vInput
|
|
|
Post by Invector on Mar 18, 2017 0:24:30 GMT
Hmmm is there a way for you to do without exposing those scripts? Our code is the main asset of the template, it's best if you don't share the core of the package.
|
|
|
Post by nerdares on Mar 18, 2017 3:04:38 GMT
Hmmm is there a way for you to do without exposing those scripts? Our code is the main asset of the template, it's best if you don't share the core of the package. Well maybe what I could do is when the menu button is pressed, it will actually edit the lines of code for each of those c# scripts as if it were a text document. Then again that is going to be quite a challenge, especially with future updates and all.
|
|
|
Post by tharindu on Apr 1, 2017 12:06:16 GMT
well to be honest I couldn't tell yah lol. I just found it in some code and thought it might work for you. I don't really know why you are having trouble finding the player with the previous code either. I know that its a property and when you use the get function it well check if instance is null if so it will find its self and return vCharacter. Why vCharacter probably because its the last inheritance for the vThirdPersonController.... I think and that it linked to the game object player. Sorry saw this a long time later. The purpose I believe is to implement a singleton pattern. The pattern makes sure that only one instance of an object will be initialized and exists through out the system. This object is referred to by the instance. Read more on this pattern. I would suggest that you guys follow C# 3.0 Design Patterns book by Oreilly. I don't know the latest books but for it's a book that will give you a fair understanding of general design patterns that can help you code better.
|
|
|
Post by nerdares on Apr 2, 2017 10:42:19 GMT
well to be honest I couldn't tell yah lol. I just found it in some code and thought it might work for you. I don't really know why you are having trouble finding the player with the previous code either. I know that its a property and when you use the get function it well check if instance is null if so it will find its self and return vCharacter. Why vCharacter probably because its the last inheritance for the vThirdPersonController.... I think and that it linked to the game object player. Sorry saw this a long time later. The purpose I believe is to implement a singleton pattern. The pattern makes sure that only one instance of an object will be initialized and exists through out the system. This object is referred to by the instance. Read more on this pattern. I would suggest that you guys follow C# 3.0 Design Patterns book by Oreilly. I don't know the latest books but for it's a book that will give you a fair understanding of general design patterns that can help you code better. oh yes, after I looked more into Invector's code a while back, I realized what the singleton pattern was. It's very useful when you only need one object that can be globally referenced
|
|
kendall
Junior vMember
EQUIP
Posts: 48
|
Post by kendall on Jan 2, 2018 22:08:05 GMT
hi did anyone know how fix this errors?
Assets/Invector Survival System Addon/Survival System/GUI/vCustomGUI.cs(135,36): error CS0246: The type or namespace name `Damage' could not be found. Are you missing an assembly reference?
Assets/Invector Survival System Addon/Survival System/GUI/vCustomGUI.cs(69,5): error CS0246: The type or namespace name `vTriggerAction' could not be found. Are you missing an assembly reference?
|
|
|
Post by uberwiggett on Jan 2, 2018 22:30:37 GMT
This addon was written for an older version of the tpc so not surprising it needs some work. The damage error is because it's changed to vDamage now. Find the error on the script and add the v. The other one I'm not sure what it's called but again it's a matter of changing the name.
|
|
kendall
Junior vMember
EQUIP
Posts: 48
|
Post by kendall on Jan 3, 2018 1:37:01 GMT
This addon was written for an older version of the tpc so not surprising it needs some work. The damage error is because it's changed to vDamage now. Find the error on the script and add the v. The other one I'm not sure what it's called but again it's a matter of changing the name. thanks for the idea i gonna fix that
|
|
|
Post by zrocweb on Feb 6, 2018 13:23:30 GMT
vTriggerAction has been replaced with vTriggerGenericAction. Just change the code to reflect:
Line 69:
Change From: vTriggerAction currentTriggerAction;
To: vTriggerGenericAction currentTriggerAction;
Also, entire addon needs major overhaul as it's written for an older version of the melee and shooter templates. Good Luck!!!
|
|
|
Post by game4fun on Jun 30, 2018 12:27:29 GMT
|
|