ID:268448
 
=/...
I want to learn how to make Clientside Variables, that only effect the client...
if someone can through a good tutorial or try to teach me, it will be appreciated... greatly.
EDIT: I basically need it so the stats are recgonized to one player... not all of them =/ A tutorial for this will be greatly appreciated, or if you try to help me =/
In BYOND, each different thing in the world - turf in a tile, mobs and objs on a turf, ect. - are objects. Each one is a different type of object, obviously. The client is just another object, one that represents the player. Many people tend to think of the player as being a mob, but the player is actually an object of type /client which has a variable called mob which is set to equal an object of type /mob which the client manipulates the world through.

Hopefully you understood the above, but even if you didn't you should be able to get the following.

Keep in mind that the player's client and the player's mob are two different objects, but each one has a variable that points to the other. Clients have a variable called mob which equals your mob, and your mob has a variable called client which equals your client. So if you give your client a variable and want to access it in a proc belonging to its mob, you could do something like the following.
client
var
loss_record=0
mob
proc
lose()
client.loss_record+=1

The same goes the other way around.
client
verb
rest()
mob.hp+=1
mob
var
hp=1

The above examples are not good code design since you don't usually want to split things up like that between the mob and client when they go together, but it does affect one object from a function belonging to the other.

What you need to do is stop thinking of things as being "clientside" and start thinking of them as belonging to the client object which is referenced by the client's mob. And to be technical, none of it is really clientside since that would mean the client's computer is handling the load.

To sum it all up, you can give the client variables and manipulate them just as you would between any other two objects.
In response to Loduwijk
Wow, you just helped me figure out, not one, but two problems, thank you! I'm just so use to... using certain programs... (*cough*<_<*cough*) that caused Client Side effects. Well, thank you :D
In response to Loduwijk
client
var
HP = MaxHP
MaxHP = rand(25,100)
MP = rand(20,30)
MaxMP = MP
Strength = rand(10,20)
EXP = 0
EXPNeeded = rand(125,200)
Level = 1
Def = rand(1,5)

X_X, it has to be a process, great...
Just because I used random variables...
Those aren't clientside variables. You want variables that belong to a client. Or mob.
In response to Hell Ramen
You cannot set variables to a variable amount at compile time. At compile time they must be static. If you want them to start variable, set them in New.
client/New()
.=..()
variable=rand(low_end,high_end)
In response to Loduwijk
I got it... X_X I think someone posted it and deleted their post, or else I was heavily dreaming... Thank you.