- Home /
Connecting Things to Weapon "Open Slot"
I'm stuck on trying to figure out some pseudoCode for this game I've been trying to put together with unity.
The language is c#.
The goal is to have the player switch weapons that have individual stats. For example: Sword of blah: may have the stats of +5 Dexterity +6 Health etc.
But we are attempting to add the feature of an "open slot" where the player can attach a certain crystal or something that would make the item more personalized.
The crystal would have similar stats. Example: +5 Strength +3 Dexterity
My issue is that I plan on having all of the stats run through a SQL database. So if the player switches to a weapon, the game engine looks up the data and pulls the stats that it adds to the player.
If I manipulate the object, it would no longer match what is in the database......
I was thinking about having it check the database for similar items and if there wasn't a like item, it would generate a new line for it in the database.
The reason I am reluctant to do this is because I don't know if having each player adding things to the database could somehow mess things up. And I need to make sure the database ID or SKU for the item stays with it during game save cycles and/or if another player picks up the item. (I'm hoping I can eventually make it multiplayer)
I'm not sure if this is the proper way to go or if there is an easier way... Any ideas that you might have would really be appreciated.
I'm open to anything.
thanks in advance, -Andrew Zwicker
Your answer
![](https://koobas.hobune.stream/wayback/20220613072631im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Slot Prefab instantiating outside of set parent 1 Answer
My script for pick up items work is wrong! Help please 1 Answer
Inventory Dragging Item Problem 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers