ID:170800
 
everytime i compile this piece of coding its perferct and ready but when i test it.

runtime error: Cannot modify null.LockMovement.
proc name: Body Copy (/mob/swap/verb/Finalpash)
source file: skills.dm,3376
usr: the game crasher (/mob/player/Sayain)
src: the game crasher (/mob/player/Sayain)
call stack:
the game crasher (/mob/player/Sayain): Body Copy(null)


but heres the coding

mob
swap
verb
Finalpash(mob/M in oview(6))
set name = "Body Copy"
set category = "Fighting"
if(M.PowerLevel <= 0)
if(usr.ki >= 19)
if(usr.stamina >= 50)
if(usr.swapping == 0)
var/dam = usr.maxPowerLevel
if(dam == usr.maxPowerLevel)
view(6) << "<font size = 1><B>[usr] creeps under [M] skin and steals [M] body"
usr.loc = M.loc
M.LockMovement = 1
usr.LockMovement = 1
sleep(35)
usr.swapping = 1
usr.icon = M.icon
usr.icon_state = M.icon_state
M.PowerLevel -= dam
M.DeathCheck()
usr.firing = 0
M.LockMovement = 0
usr.LockMovement = 0
usr.stamina -= 50
usr.ki -= 20
else
usr << "Chill [usr] you already stolen a body"
else
usr << "You need to rest"
else
usr << "Your out of ki"
else
usr << "[M] powerlevel must be below 0"


Which line is: 3376. That will help us narrow the problem down.
is the last piece of coding on the skills page
In response to N1ghtW1ng
it could be the lockmovement usr.lockmovement and M.lockmovement thats the whole problem. but my other attacks work fine like
mob
flare
verb
Finalpash(mob/M in oview(6))
set name = "Solar Flare"
set category = "Fighting"
if(M.pk == 1)
if(usr.ki >= 0)
if(usr.stamina >= 2)
if(usr.firing == 0)
var/dam = usr.str||usr.defense||usr.Level
if(dam == usr.str||usr.defense||usr.Level)
view(6) << "<B><font color = gray>[usr]<font color = white> : SOLAR FLARE!!!!!"
view(6) << "<font size = 1><B>[usr] blinds [M]"
M.LockMovement = 1
usr.LockMovement = 0
usr.icon_state = "meditate"
M.overlays += 'join1.dmi'
sleep(5)
usr.icon_state = ""
sleep(55)
usr.icon_state = ""
M.overlays -= 'join1.dmi'
usr.firing = 0
M.LockMovement = 0
usr.LockMovement = 0
M.PowerLevel -= dam
usr.stamina -= 10
usr.icon_state = ""
else
usr << "Chill [usr] your already attacking"
else
usr << "You need to rest"
else
usr << "Your out of ki"
else
usr << "There not PK"
In response to Jiamind
Designate it with a // or something, I can't tell what you mean.
In response to Jiamind
Ah, I think I know your problem. Make a sanity check to see if the other mob is still active.
In response to N1ghtW1ng
// ?
In response to N1ghtW1ng
i never seen a sanity check so what would that look like ?
is that like a loop_check = 0 ?
In response to Jiamind
Nevermind that post.
In response to N1ghtW1ng
ok so.. ? wats sanity ?
In response to Jiamind
No, you don't want to do that. That prevents infinite loops from showing up, which end up crashing the server. You want them to show up, so you can fix them. Here, I edited the spaces to tabs, so it would work right in my compiler...and made it easier to read.

mob
swap
verb
Finalpash(mob/M in oview(6))
set name = "Body Copy"
set category = "Fighting"
if(M.PowerLevel <= 0)
if(usr.ki >= 19)
if(usr.stamina >= 50)
if(usr.swapping == 0)
var/dam = usr.maxPowerLevel
if(dam == usr.maxPowerLevel)
if(M)//Sanity Check, it checks to see if M is still active
view(6) << "<font size = 1><B>[usr] creeps under [M] skin and steals [M] body"
usr.loc = M.loc
M.LockMovement = 1
usr.LockMovement = 1
sleep(35)
usr.swapping = 1
usr.icon = M.icon
usr.icon_state = M.icon_state
M.PowerLevel -= dam
M.DeathCheck()
usr.firing = 0
M.LockMovement = 0
usr.LockMovement = 0
usr.stamina -= 50
usr.ki -= 20
else
usr << "Chill [usr] you already stolen a body"
else
usr << "You need to rest"
else
usr << "Your out of ki"
else
usr << "[M] powerlevel must be below 0"


I did not try it out, but it should work. Also a few of those things, like Icon = Icon and loc = loc and Icon_State = Icon_State won't work I think. You might need to store each of the original vars, into a different var and then call that var into the new one...or something like that.
In response to N1ghtW1ng
thanks i got it nightwing now you can play as all monsters
In response to Jiamind
No problemo, but did that make it work?
In response to N1ghtW1ng
yeah no runtime errors