I just wanted to clear up some basic syntax questions I have as I read over the plethora of material both in the assets and on this site:
1) Normally I would have thought that if you say "TestVariable = 3", that would set the value of that variable to 3....but I have used a code from Archer01 (that works) which does the following: "local supportTeam = 3", which means that 3 is indeed a variable in this case; and if that is the case, how then, can one store a new variable with a value of 3?
2) What is the purpose of using "local" before defining a variable?
I probably had more questions, but I'm too tired to remember them at the moment.
Some LUA syntax help
Moderator: Moderators
- jangoisbaddest
- Lieutenant General

- Posts: 661
- Joined: Mon Feb 27, 2006 12:10 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: All Along The Watchtower
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
- jangoisbaddest
- Lieutenant General

- Posts: 661
- Joined: Mon Feb 27, 2006 12:10 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: All Along The Watchtower
As I said, it appears to me that 3 is meant to be taken as the 3rd team, rather than an actual value for the variable. That is what is confusing me (it may have something to do with the "local" statement though).Maveritchell wrote:Not sure what the confusion is, since in both cases the variable is on the left side of the equality.
-
Ace_Azzameen_5
- Jedi

- Posts: 1119
- Joined: Sat Apr 23, 2005 8:52 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
The number "3" is still just a numeric value. It's just that when the game asks for a team and is given a variable equal to 3, it equates it to the third team.jangoisbaddest wrote:As I said, it appears to me that 3 is meant to be taken as the 3rd team, rather than an actual value for the variable. That is what is confusing me (it may have something to do with the "local" statement though).Maveritchell wrote:Not sure what the confusion is, since in both cases the variable is on the left side of the equality.
