ID:145937
 
Code:
                                                                        client.eye = locate(usr.x+1,usr.y,usr.z)
sleep(5)
client.eye = locate(usr.x+1,usr.y+1,usr.z)
sleep(5)
client.eye = locate(usr.x,usr.y+1,usr.z)
sleep(5)
client.eye = locate(usr.x-1,usr.y+1,usr.z)
sleep(5)
client.eye = locate(usr.x-1,usr.y,usr.z)
sleep(5)
client.eye = locate(usr.x,usr.y,usr.z)
sleep(20)
sight = 1


Problem description: Screen doesn't move, and user doesn't go blind o.o
I really can't see what's wrong about this :/


What are you trying to do, bud?
In response to CaptFalcon33035
Euh.. Give a screen-shake effect like used in Dragonball Live 2 o.o

It's a proc, I tryed changing it all to "src", but it didn't work n'either.
I can't really say what is wrong with it, because I have no idea how this is getting called. All I know is that you're setting sight wrong. Sight has settings you use with bit flags, so you use the | operator to turn on the BLIND bit.

Here's an example on how to "shake" your screen randomly. If you don't want it random, though, you can use your original system. Make sure you use src, though.

mob/proc
effect()
var/list/L = orange(src, 1)
var/num = 5 // number of times to shake
for(var/i = 1 to num)
client.eye = pick(L)
sleep(3) // change this to whatever delay you want
client.eye = src // return the eye to the mob
sleep(10)
src.sight |= BLIND // turn on the BLIND bit flag


If you want to unblind the person, use the bitwise AND and complement operator.

mob/proc
unblind()
src.sight &= ~BLIND


~~> Dragon Lord
In response to Unknown Person
Ty dragon, I've read about the sight var in the F1 help menu thingy, but I was practically sure that you could also use 1 / 0... Guess not then.
In response to Mysame
runtime error: Cannot modify null.eye.
proc name: effect (/mob/proc/effect)
source file: battle_system.dm,559
usr: Mysame (/mob)
src: Vegeta (/mob/monsters/Vegeta)
call stack:
Vegeta (/mob/monsters/Vegeta): effect()
Vegeta (/mob/monsters/Vegeta): SSJ()
Vegeta (/mob/monsters/Vegeta): Die(Vegeta (/mob/monsters/Vegeta))
Vegeta (/mob/monsters/Vegeta): KO()
Mysame (/mob): Attack(Vegeta (/mob/monsters/Vegeta))


Vegeta = mob I killed to get enraged o.o
This could also be caused that a monster vegeta was transforming -.- (Gotta fix this.. Lots of runtime errors with NPC's trying to transform :/ )
In response to Mysame
You must've used 'src' somewhere in your code where you shouldn't have, or in the eye procedure thing you have, you may have not checked for the client. eye is a client.variable, and you are bound to get runtimes if you try to use an NPC's eye variable that doesn't even exist.
In response to CaptFalcon33035
I've fixed the runtime, but the screen still won't "shake".. :/

Tried switching usr/src everywhere in the proc
In response to Mysame
How can you tell if the screen is shaking or not? You're blinded.
In response to CaptFalcon33035
You're not actually, I removed that :/
In response to Mysame
Try something like this.
mob/proc/Shake_Screen()
var/shake=10 //number of times to move
var/turf/last
for(var/i=1,i<=shake,i++)
var/r=rand(1,4)
var/turf/T=locate(/turf/) in orange(r)
while(last==T) {T=locate(/turf/) in orange(2);sleep()}
src.client.eye=T
last=T
sleep()
src.client.eye=src


To make up for the time that the while proc may take, we make it shake 10 times only sleeping when the proc is stressed. you may need to make a loop through the turfs around you and then take out the last turf if this doesn't work or takes too long. I think that there is a good chance that this proc will pick the same turf over and over, so I added the random argument in orange(), reguardless of it it may help.