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
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