Problems with client eye... in Developer Help
|
|
Code:
proc tablecheck() if(player1&&player2) var/mob/battledecoy/b=new() var/mob/battledecoy/c=new() for(var/turf/marker/m in world) if(m.id==id) b.z=2 c.z=2 b.y=m.y c.y=m.y b.x=m.x-4 c.x=m.x+4 player1.client.eye=locate(m.loc) player2.client.eye=locate(m.loc) player1.client.perspective = EYE_PERSPECTIVE player2.client.perspective = EYE_PERSPECTIVE b.icon=player1.Digimon.icon c.icon=player2.Digimon.icon b.icon_state=player1.Digimon.icon_state c.icon_state=player2.Digimon.icon_state else spawn(5) tablecheck()
|
Problem description:
Excuse the super messy code, not going for performance or readability here. Why doesn't the eye move to the marker? I read tons of posts like this, and rather than giving an actual answer, they just ctrl+v "Read up on client.perspective". Well, so I did, but apparently this doesn't work either? D:
|
Note 1: Setting coordinates individually doesn't work when the object has a null location. When either x, y, or z are 0 at any point in the code, they are all 0. This means if you set one to 2 and the rest are still 0, they all become 0. To fix this you use locate(), which returns a turf when given the 3 coordinates together.
Note 2: A slightly more advanced example