ID:145715
 
Code:


Problem description:

i dont have the code because i dont think there would be a code to connect map to whole game..see the map is in the DM and so is alll the file's but you see when i compile then run the map doesent show up,im thinking i need a starting spot code but i cant remember the code for it
This belongs under Developer How-To.
usr.loc=locate(1,1,1)

This makes the user located x_1, y_1, and on Z_1.

->Calus CoRPS<-
There is no 'starting spot code'

At login, your player should be shunted along to the first nondense space Dreamseeker finds.

A better way to run it would be like this:

area/starting

mob/player/Login()
..() //Call the parent proc. Otherwise, we might have funny things occuring.
spawn(1) loc=locate(/area/starting) //Wait until everything is done, then set the mob's location to a free space in /area/starting.


You then just put some /area/starting on a piece of the map, somewhere. A 3x3 block should be sufficient.

EDIT: If you want to drop players off in a nondense space in /area/starting, you'd do it like this.

area/starting

mob/player/Login()
..() //Call the parent proc. Otherwise, we might have funny things occuring.
spawn(1) while(!Move(locate(/area/starting))) sleep(5)
// Attempt to move the player into somewhere in /area/starting. If this fails (i.e., the entire area is full of dense stuff) then sleep for 5 ticks then try again. Keep going until the player gets in.
In response to Calus CoRPS
There is no 'the user'. There is only 'usr'.
In response to Jp
I know, but when you are not programming it is called user.

->Calus CoRPS<-
In response to Jp
Jp do you include the part at the top of your desc of what to put in?
In response to Calus CoRPS
You're just going to teach him bad habits. He should be thinking in programming terms when he's thinking about programming. And that means not knowing who 'the user' is, but knowing what 'usr' is.
In response to VolksBlade
I'm not quite sure what you mean.

You'd need all the stuff in the 'white box', and then you'd put some /area/starting on the map. At login, players will be dropped off in a space in /area/starting.
In response to Jp
That is why I put usr in the code.

->Calus CoRPS<-
In response to Calus CoRPS
Calus i got 6 error's when i tryed your's,when i tryed Jp's i still got black screen
In response to Calus CoRPS
Which was probably a bad idea, given that he's likely to call it from mob/player/New(), or mob/player/Login().

(Actually, usr will probably work in Login(), but only so long as mobs don't login to other mobs during the progress of the game. It's just bad practice to use usr there when src works better)
In response to VolksBlade
Did you put any /area/starting on your map?
mob
Login()
usr.loc=locate(4,6,1)

I thought you had a login code, but here it is.

->Calus CoRPS<-
In response to Calus CoRPS
Calus thanks you helped me out but im going to change the number's to 102,1,1 since thats where i wanted them to start