ID:271470
 
Okay what i want is when ever you choose prisioner it assigns you a cell #, but i don't want everyone having cell one, how can i make it where it sets it where like where i have Cell: 1 the next person would have Cell: 2?

so itd be like this

A logs in and makes a prisoner
A gets cell 1
B logs in and makes prisoner
B gets cell 2
Make an area for each cell, or use Block(), and check for a player mob.
var/cell = rand(1,3)//based on a coin toss, it's random from 1 to 3.

view() << "Bob logs in and makes a prisoner!"
sleep(10)
view() << "Bob gets cell [cell]!"

Edit: this is an example and it might or might not work for your game. use it as a stencil, figuratively speaking of course.
In response to Jman9901
Jman9901 wrote:
> var/cell = rand(1,3)//based on a coin toss, it's random from 1 to 3.
>
> view() << "Bob logs in and makes a prisoner!"
> sleep(10)
> view() << "Bob gets cell [cell]!"
>
> Edit: this is an example and it might or might not work for your game. use it as a stencil, figuratively speaking of course.

one this isnt what i wantted...

two. people say dont listen to you

three. Iwant it where it gose UP not random...
In response to Pyro_dragons
Pyro_dragons wrote:
Make an area for each cell, or use Block(), and check for a player mob.


say what?

Okay i got the area made... but this isnt exactly helping me figure out how to make the cell# go up from one.
var/list/cells = new/list()

cell
var/num = 0
New(n)
num = n

mob
var/cell/Cell
Login()
..()
var/cell/c = new/cell(cells.len+1)
Cell = c
cells += c
world << "You are in cell [c.num], grats?"


I made cell a datum because I have no idea what all information you'll need each cell to have or what-not. That and I love datums.

If you want anything else specific (ie: replace cells that have become empty due to logging out) you could have the New() check for a break in the numbers in the cells list.

If you have any questions on anything else feel free to page me questions.
In response to Delgertome
*sigh* It's really not that difficult....

area
cells
layer = MOB_LAYER //this way its above the turfs and where a mob could be in it
cell1
cell2
//you can give them vars and whatnot.
//Place them on the map wherever you want the cells to be

//then just check at login or char creation, whichever

mob
Login()
var/area/A = /area/cells/cell1
var/area/B = /area/cells/cell2
for(var/mob/M in world)
if(locate(M) in A)
if(!locate(M) in B)
src.loc = B
else
src.loc = A
..()
///this is kind of crude though. There's probably a much easier way to do this, but its 3:07 am where i'm at. I'm tired =/


or you can use block()

mob
Login()
var/mob/M = /mob
if(locate(M) in block(locate(x,y,z),locate(x,y,z)))
//etc etc
..()


Again, probably easier and more efficient ways to do this, but this is what first comes to mind at 3am >_>
In response to Pyro_dragons
You're requiring a lot of hardcoding here with little flexibility. And in your Login() you should use a for() loop for the areas. (Just put them in an array.) The best functions are the ones that adapt to your needs with as little added work as possible.

I'll admit my way does get a bit excessive because it uses datums for something he probably only touches a couple of times, but it also allows for more dynamic uses since I have no idea what the cells are going to be used for in the game. (Also datums are neat.)
In response to Delgertome
The cells are going to be used for a verb to check waht cell the prisoner is in
In response to Black Wolf Production
i see... oh and one tip, if someone told you to jump into an ocean of fire where everyone that does burns alive and dies, would you?

and soz idk how to make it go up.
In response to Jman9901
Jman9901 wrote:
i see... oh and one tip, if someone told you to jump into an ocean of fire where everyone that does burns alive and dies, would you?

and soz idk how to make it go up.

no, but ive seen you try to help and i see why people say don't listen to you.
In response to Black Wolf Production
Because he's newbie at coding of course!
In response to LucifersHellion
that really dosn't take a whole lot of coding...and he was giving you a sketch
In response to Fautzo
well...Jman was
In response to Fautzo
all I asked for was how to make a number go up from 1 not a sketch or anything just a bas way to get a number to count up.
In response to Black Wolf Production
I'm not sure exactly how you want this, but heres one example:

var/global/cells = 0
mob
var/cellnum = 0 //not really needed unless you want a reference to their cell #

Login()
cells ++
src.cellnum = cells

src.loc=locate("[src.cellnum]")

//or if you want to call movement procs when your teleported into the cell:

//src.Move(locate("[src.cellnum]"))

Then you would have to make turfs with the tags; 1,2,3 etc.