Hi I’m working on a rts and I am trying to incorporate a skill tree to do building upgrades and I hit a road block. I already have my skill tree GUI set up and what i need help with is a way to check four things: player level, building level , amount of resources and if u have certain buildings already built and player owned. With that being said I want a way to check those when I want to upgrade a skill as prerequisites for that skill, and what is the best way to set up the prerequisites. I’m using c# and I appreciate any and all help . I was thinking about using struct to define each skill and the prereq and then use a if statement to check for the prereq. Please and thanks in advance for any help.
Hmmm i have to solve this problem right now as well… How should i best approach it?
Right now my idea is have a Empty GameObject called Player1
Player1
With an Script that can hold say 300 UNITS in an array. I would use a textual string… rather than storing the prefab without its children objects??? (Too much resources to do this???) <I don’t imagine a player would have anywhere more than 50 units in my game>
For example
Units Owned.
*Cottage
*Barracks
*Cottage
*Cottage
If you were to upgrade you would do this
*Cottage>Advanced Cottage (THIS means the most basic item is still there after the upgrade and a string search would find both cottage and Advance cottage)
*Barracks
*Cottage
*Cottage
OR it could be a 2D array that also holds the item uniqueID, which i don’t think is important.
If an object under Player1 control goes under Destroy(gameObject); then i don’t think it matter which Cottage gets removed.
Each time Player1 (you) select a Player1 Object it would show the GUI… and determine based on the text array which buttons to enable or disable
Any suggestions would be great…
I’m using JavaScript.