ID:142208
 
Code:
mob
proc
projectile(obj/projectile,var/dir,var/delay)
sleep(1)
walk(projectile,dir)
sleep(delay)
del(projectile)

obj
PK_Fire
icon='bullet.dmi'
density=1
Bump(var/mob/M)
if(ismob(M))
var/damage = src.PSI + 19 - M.defense
if(M.defense >= damage)
damage = 0
M.hp -= damage
M.death_check(src)
del(src)


mob
verb
fire()
usr.projectile(new/obj/PK_Fire(usr.loc),usr.dir,40)

Umm, in the Bump Usr is should not be used... because Usr is not really Defined.

-SubZeroChaos
In response to SubZeroChaos
I'm sorry but i'm still a little confused on as what to do. Do you mind elaborating or walking me through it?
In response to Bluebook
mob
proc
projectile(obj/projectile,var/dir,var/delay)
sleep(1)
walk(projectile,dir)
sleep(delay)
del(projectile)

obj
PK_Fire
icon='bullet.dmi'
density=1
Bump(var/mob/M)
if(ismob(M))
var/damage = src.PSI + 19 - M.defense
if(M.defense >= damage)
damage = 0
M.hp -= damage
M.death_check(src)
del(src)


mob
verb
fire()
usr.projectile(new/obj/PK_Fire(usr.loc),usr.dir,40)
In response to Bluebook
It works ?
In response to Andre-g1
Projectile.dm:15:error:src.PSI:undefined var

i updated the first post.
In response to Bluebook
obj/var/OwnerOfMe
mob
proc
projectile(obj/projectile,var/dir,var/delay,owner)
projectile.OwnerOfMe = owner
sleep(1)
walk(projectile,dir)
sleep(delay)
del(projectile)

obj
PK_Fire
icon='bullet.dmi'
density=1
Bump(var/mob/M)
if(ismob(M))
var/mob/Fip = src.OwnerOfMe
var/damage = Fip.PSI + 19 - M.defense
if(M.defense >= damage)
damage = 0
M.hp -= damage
M.death_check(src)
del(src)


mob
verb
fire()
usr.projectile(new/obj/PK_Fire(usr.loc),usr.dir,40,usr)


Try this, i havent tested this out... tell me if it works or not?

-SubZeroChaos
In response to Bluebook
The error is self-explanatory. src, or more accurately its type (/obj/PK_Fire), doesn't have a variable named PSI. Therefore, it is undefined.
If that's all there is to it, you really need to read the blue book to learn this basic stuff.

The straightforward solution would obviously be to define the variable. But we can't be accurate since you haven't in any way described what you're trying to do.
In response to Kaioken
Kaioken, i think he was trying to get the users PSI not the src/objects. So thats why he has to pass through the user has a var/mob through arguments...

Is that right because earlier he had put in usr so from that view, this is what i think.

-SubZeroChaos
In response to SubZeroChaos
Like I said, he didn't say what he actually wanted, so you can't do more than guess. Indeed he has likely tried to access a var of a player. Of course, that doesn't really changed what I've said.
In response to Kaioken
Alright, im just trying to get Deeper into this Simplistic(my view) problem by talking about it and hopefully blue book is reading what we are saying.

-SubZeroChaos
In response to SubZeroChaos
Yes that works perfectly but i'm going to try to get it to work myself. Thanks though. PSI is a variable that the player has and i think i figured out how to get it to work. Thanks for the help guys

And also. I'm not named after the Coding bluebook :P. I get that alot.
In response to Bluebook
Yeah, I think he knows, Hes just playing with words :P

-SubZeroChaos