ID:178714
 
Yes, I know I have posted about this before and I have spent 3 days on this problem but still don't see what is wrong. I have just but it back to its original state becuase that was working for me. If you can fixed the problem tell me what I did wrong, since I see nothing wrong with this.Sorry for being annoying, but thats my job :P

proc/mission()
var/mission_area = pick("parkinglot","house")
var/obj/missions/note/note
note = /obj/missions/note
var/obj/missions/brokenglass/brokenglass
brokenglass = /obj/missions/brokenglass
var/obj/missions/hammer/hammer
hammer = /obj/missions/hammer
var/list/locations = list()
if(mission_area == "parkinglot")
for(var/turf/parkinglot/T in world)
locations += T
for(var/turf/parkinglot/T in world)
new note(pick(locations))
new hammer(pick(locations))
new brokenglass(pick(locations))
note.owned = usr.key
hammer.owned = usr.key
brokenglass.owned = usr.key
usr << "Yor mission is at [mission_area]. Check around for clues."
if(mission_area == "house")
for(var/turf/house/T in world)
locations += T
for(var/turf/house/T in world)
new note(pick(locations))
new hammer(pick(locations))
new brokenglass(pick(locations))
note.owned = usr.key
hammer.owned = usr.key
brokenglass.owned = usr.key
usr << "Yor mission is at [mission_area]. Check around for clues."


This creates the objects, but I get this run-time error:

runtime error: Cannot modify /obj/missions/note.owned.
proc name: mission (/proc/mission)
usr: Sariat (/mob/kid)
src: null
call stack:
mission()
the inspector (/mob/inspector): getmission()


And it doesn't give me the "Yor mission is at [mission_area]. Check around for clues." message. And it doesn't set the objects owned variable. Sorry for re-posting about my problem, and tell what I have done wrong with this since I see nothing wrong.

-ST



You don't really have a reference to a note object in the line: note.owned = usr.key

Here's a small change:

for(var/turf/parkinglot/T in world)
var/obj/note/N = new(pick(locations))
N.owned = usr.key
var/obj/hammer/H = new(pick(locations))
H.owned = usr.key
var/obj/brokenglass/BG = new(pick(locations))
BG.owned = usr.key