Thomas Die Posted January 14, 2021 Share Posted January 14, 2021 Is there any way to alter any of the code in constants? Link to comment Share on other sites More sharing options...
penguin0616 Posted January 14, 2021 Share Posted January 14, 2021 (edited) Yep. You alter it the same way you alter any other variable. Examples: GLOBAL.ANCHOR_MIDDLE = 999 -- break all the UIs GLOBAL.EQUIPSLOTS.LEG = "leg" Edited January 14, 2021 by penguin0616 1 1 Link to comment Share on other sites More sharing options...
Thomas Die Posted January 14, 2021 Author Share Posted January 14, 2021 local PIGTRADE_ONE = { PIGTRADE = 1 } local PIGTRADE_TWO = { PIGTRADE = 2 } --print(GLOBAL.constants) table.insert(GLOBAL.TECH, PIGTRADE_ONE) table.insert(GLOBAL.TECH, PIGTRADE_TWO) Sorry, so it there anything i'm doing wrong TECH = { NONE = TechTree.Create(), SCIENCE_ONE = { SCIENCE = 1 }, SCIENCE_TWO = { SCIENCE = 2 }, SCIENCE_THREE = { SCIENCE = 3 }, -- Magic starts at level 2 so it's not teased from the start. --bit of refrence print(GLOBAL.TECH.PIGTRADE_ONE) will always come as nil for some reason Link to comment Share on other sites More sharing options...
penguin0616 Posted January 14, 2021 Share Posted January 14, 2021 Since you are using table.insert, it would end up as: TECH = { NONE = TechTree.Create(), SCIENCE_ONE = { SCIENCE = 1 }, SCIENCE_TWO = { SCIENCE = 2 }, SCIENCE_THREE = { SCIENCE = 3 }, [1] = { PIGTRADE = 1 }, [2] = { PIGTRADE = 2 }, } Change table.insert(GLOBAL.TECH, PIGTRADE_ONE) table.insert(GLOBAL.TECH, PIGTRADE_TWO) to GLOBAL.TECH.PIGTRADE_ONE = PIGTRADE_ONE GLOBAL.TECH.PIGTRADE_TWO = PIGTRADE_TWO Which will leave you with TECH = { NONE = TechTree.Create(), SCIENCE_ONE = { SCIENCE = 1 }, SCIENCE_TWO = { SCIENCE = 2 }, SCIENCE_THREE = { SCIENCE = 3 }, PIGTRADE_ONE = { PIGTRADE = 1 }, PIGTRADE_TWO = { PIGTRADE = 2 }, } 2 Link to comment Share on other sites More sharing options...
Thomas Die Posted January 14, 2021 Author Share Posted January 14, 2021 beautiful ones, thanks 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now