ID:159113
 
How do i Create a Level Cap for my Game? So they can't get past level 250.
if(level >=250)
text
return this is only an example lol
I suggest making a global variable that will hold the "level cap" value. That way, you won't have to go in an modify all those if() checks manually if you decide to change the level cap later on.

You could even make a movable atom variable of it, unless you want your turfs to have the variable too >_>

var/level_cap = 250

//or

atom/movable/var/level_cap = 250
In response to Spunky_Girl
Spunky_Girl wrote:
That way, you won't have to go in an modify all those if() checks manually if you decide to change the level cap later on.

That would ideally only be one or two if() checks, :P but sure, a [constant] global var (or more preferably a #define at the top of the first file if it doesn't need to change in runtime) couldn't hurt.

You could even make a movable atom variable of it, unless you want your turfs to have the variable too >_>

You mean you could make it a certain mob var (preferably on a mob subtype, not base type), unless you want all mobs and objs to have it too. ;P If it doesn't need to vary between different mobs, you could even make it a global var with the global modifier, though of course this is the same as a regular global var, only accessed differently.