ID:174456
 
Is there a way i can make it so the player isnt locked in the center of the screen? Like so i can walk to the edge of the screen then it scrolls over.. Is that possible?
look up the lazy eye proc
In response to Wanabe
It's a /client variable, not a proc, but that's otherwise correct.


For more advanced scrolling adjustments, there are more complicated methods, ranging from making each map the size of a screen and linking them together at the edges, to making special "eye attractors" which set the client's visible location (the /client 'eye' variable) to the nearest "attractor". Here's an example:

mob
var/tmp/obj/eye_attractor/cur_attractor

Move()
. = ..() //run default movement stuff
if(!.) return //if the default movement failed, stop here
if(!client) return //if not a PC mob, return here

//used to find the closest attractor
var/minimum_dist = world.view+1

//run through all of the attractors in visible range
// and set attractor to the closest one that is found first
var/obj/eye_attractor/attractor
for(var/obj/eye_attractor/O in view(src))
if(get_dist(src,O) < minimum_dist)
minimum_dist = get_dist(src,O)
attractor = O

//if there are no eye attractors, return the eye to the player's mob
if(!attractor) client.eye = src

//if the attractor is a new one,
else if(attractor != cur_attractor)

client.eye = locate(attractor.x, attractor.y, attractor.z) //jump view to its location
cur_attractor = attractor //and set the variable to the new attractor


obj/eye_attractor
icon = 'eye_attractor.dmi'
New()
. = ..()
//visible in the map editor, but disappears at run-time
icon = null


Then all you have to do is place eye attractors around the map, and players' views will jump to each one as they move around, returning to remain centred on the player if there are no attractors in range.
In response to Spuzzum
Isnt that an effect like in Resident Evil Games, where there are cameras in certian locations which get focused on when you go into the next area?
In response to Mrhat99au
Mrhat99au wrote:
Isnt that an effect like in Resident Evil Games, where there are cameras in certian locations which get focused on when you go into the next area?

Pretty similar, yup. =)
In response to Spuzzum
In response to The mothball
thx for the response usually my posts turn up blank =( That helped alot