Retrieveing the Creator of an Object
|
|
Okay here's the deal. Mobs in my game can shoot ki blasts. The verb creates the ki blast as an object and tells it to walk forward. Simple Enough? Well in the code for the ki blast object, I made a variable called shooter. When the Ki blast is made the shooter is saved to that variable so if it kills the person it can announce to the world that the creator has killed whoever it hit. Now that works fine but i'm also trying to give the person who shot the blast experience points via the shooter variable like this:
obj/Ki_Blast var/mob/shooter as mob var/damage icon= 'Ki Blast.dmi' density= 1 //blah blah blah so more code
if(M.Death_Check()) world<< "[BATTLEINFOFONT][M] has been killed by [shooter]![FONTCLOSURE]" shooter.exp+= M.expgiven
But sadly the experience is not given to the shooter. What should I do to fix this?
|
to
var/mob/shooter = null
then check to see if all mobs have access to the exp var
and then add a message telling them they got the exp
oh yer add some checks in to make sure that shooter is not null and make sure your setting shooter when you fire it <+<