- Joined
- Dec 26, 2013
- Messages
- 1,613
- Solutions
- 11
- Reaction score
- 846
Ok so this might seem like a super noobie question, but I am stuck, and I can't seem to find the technique or the method I'm trying to use anywhere out there on stackexchange or reddit or anything... So first the code.
So in this example, what I'm trying to do, is use "self" to reference the values in this table entry. IE. self:level should = 1, as defined in the table (value of "Mining"). As well as pull the rate from the same table or anything else I would like to pull. Yes I already know I can't use "self" this way, as TFS keeps telling me in console errors but I'm looking for something that can help me achieve same end result.
Is this possible? There has to be a super easy way to do this that I'm overlooking right?
The reason I need it to pull the information from itself, ofc, I plan on adding methods for this system that could and would alter the values of those variables inside that table on the fly, or when needed.
Any help would be appreciated, I am having some issues relearning this lua stuff after having used C# now for so many years
I still find myself wanting to type the word Void
Lua:
CustomSkills =
{
["Mining"] = {rate = 1, level = 1, tries = 0, maxLevel = 100, triesToNextLevel = (((self:level * 10) + (self:level * 10)) / self:rate), maxed = false},
}
So in this example, what I'm trying to do, is use "self" to reference the values in this table entry. IE. self:level should = 1, as defined in the table (value of "Mining"). As well as pull the rate from the same table or anything else I would like to pull. Yes I already know I can't use "self" this way, as TFS keeps telling me in console errors but I'm looking for something that can help me achieve same end result.
Is this possible? There has to be a super easy way to do this that I'm overlooking right?
The reason I need it to pull the information from itself, ofc, I plan on adding methods for this system that could and would alter the values of those variables inside that table on the fly, or when needed.
Any help would be appreciated, I am having some issues relearning this lua stuff after having used C# now for so many years
I still find myself wanting to type the word Void