Author Topic: Global Objects  (Read 506 times)



For my BASM32 Add-On I am creating all of the registers in a processor. These registers hold values, much like variables, so in effect, that's how I am creating them.

My question is: For the sub objects of $regsAll, should I make them global, or should I keep them local to the $regsAll object? Each client in the server will be assigned this object, and will have his/her very own special register variables to use in conjunction with wrench events. Different registers will be created by placing bricks and naming them with a special naming handle, so if these bricks are not placed, I have just given them a value of "NULL" (since when initialized, they have obviously not placed).

Bricks will "talk" to each other, and calculations will be preformed on different registers as long as events are being executed for the BASM32 mod.

Is this the best way to go along doing this, like to be assigning all this information to the client? Should I be using all global objects, being methods or not? Feedback would be strongly supported.
« Last Edit: March 20, 2010, 09:33:17 PM by Radial543 »

Registers should be either part of the brick-group or entirely contained within the bricks, otherwise it'll get messed up if more than one person tries to access the same one from different builds.

Registers should be either part of the brick-group or entirely contained within the bricks, otherwise it'll get messed up if more than one person tries to access the same one from different builds.
Sounds good, I'll do that. I just noticed how it was horribly flawed. Thanks so much :D

You realize "NULL" is just a string saying NULL right?

You realize "NULL" is just a string saying NULL right?
Yes. In the finished script its going to mean that certain register bricks have not been planted yet.