Possible problems caused by using Character as BoundGameObject of some StateObject on CharacterItem

WeiYiHua

Member
Hello, I'm working on a feature for CharacterItem that may rely on the StateSystem. I have to say that the StateSystem is very convenient to use, but I have encountered some issues when using it on CharacterItem.

Some StateObjects on CharacterItem use Character as a BoundGameObject, which is not a problem when there are only a few types of items because you can set a unique state name for each state of each item.

However, once the number of items increases, using Character as a BoundGameObject will cause two problems:
  1. It is difficult to manage to set a unique state name for each state of each item in a large number of items, so it is better for all items to share state names. In the current situation, this will cause interference between different items' states.
  2. Multiple instances of an item that can be equipped in both the left and right hands are equipped simultaneously in the left and right hands. In the current situation, this will cause interference between these two instances' states.
To solve the above two problems, it is necessary to set a unique state name for each state of an item, and the distinction between the left and right hands should also be added to the state name. This seems to be a big trouble.

In conclusion, using Character as a BoundGameObject for some StateObjects on CharacterItem is not a reliable approach, which will reduce the usability and scalability of the item system.

Perhaps these StateObjects should be directly bound to the GameObject of CharacterItem. If you need to let Character receive the state of CharacterItem, you can write a separate script that forwards the state of CharacterItem's GameObject to Character.

Do you think there is something wrong with my thinking? If you think my idea is good, please improve it. Thank you!
 
Im not entierly sure on your problem but I will throw this out there anyway, hope you dont mind. Have you checked closer on the ItemSetRule and CategorySetRules?
1682838333178.png
1682838347309.png


Could this system solve your issues with weapons equipped in both hands etc?
 
Thank you for your attention to this issue. However, this question describes the internal state of CharacterItem, such as "AssaultRifle_Trigger_Repeat", "AssaultRifle_Trigger_Simple", "AssaultRifle_Trigger_Burst", etc. This has nothing to do with the state on the ItemSet.
 
The BoundGameObject does have some restrictions such as the ones that you mentioned. I can add this to my list of things to look at but right now I don't have an ETA for when I'll be able to look at it.
 
Top