ID:177581
 
turf/mysterybox
var/list/prizes = newlist(/obj/anthrax,/obj/gun)

mob/verb/getprize()
prize()

proc/prize()
for(var/turf/mysterybox/T in orange(1,src))
if(T)
var/obj/item = pick(T.prizes)
world << "The item is [item]!!"
new item(src)
else
world << "Nothing here!"


It's giving me this:

runtime error: Cannot create objects of type /obj/gun.
proc name: search (/proc/prizes)
source file: testing.dm,27

Help, please.
Sariat wrote:
turf/mysterybox
var/list/prizes = newlist(/obj/anthrax,/obj/gun)

mob/verb/getprize()
prize()

proc/prize()
for(var/turf/mysterybox/T in orange(1,src))
if(T)
var/obj/item = pick(T.prizes)
world << "The item is [item]!!"
new item(src)
else
world << "Nothing here!"
</dm>

It's giving me this:

runtime error: Cannot create objects of type /obj/gun.
proc name: search (/proc/prizes)
source file: testing.dm,27

Help, please.

You are trying to give your 'item' var a new type.

var/item = pick(T.prizes)
var/obj/O = new item(src)
world << "The item is [O]!"

In response to Malver
Its still giving me the same error.

roc/prize()
for(var/turf/mysterybox/T in orange(1,src))
if(T)
var/obj/item = pick(T.prizes)
world << "The item is [item]!!"
var/obj/O = new item(src)
world << "The Item is [O]"
else
world << "Nothing here!"
In response to Sariat
Maybe because you have

roc/

LOL
In response to Super16
......... I mis-copied that...
Maybe

var/obj/O = new pick(T.prizes)(src.loc)
In response to Sariat
Sariat wrote:
Its still giving me the same error.

> roc/prize()
> for(var/turf/mysterybox/T in orange(1,src))
> if(T)
> var/obj/item = pick(T.prizes)
> world << "The item is [item]!!"
> var/obj/O = new item(src)
> world << "The Item is [O]"
> else
> world << "Nothing here!"


Read over the code I posted again, and fix what you left out.
In response to Malver
Still don't get it...

I tried

var/O = new item(src)

But it gives me the same error...
In response to Sariat
do this

make the list var/obj/prizes = list()

then make
new pick(T.prizes)(src.loc)

it may work
In response to Super16
Super16 wrote:
do this

make the list var/obj/prizes = list()

then make
new pick(T.prizes)(src.loc)

it may work

Its not going to work... your making nothing new!!!

its saying like new "nothing" (blah blah)
In response to Sariat
You didn't try
In response to Sariat
Sariat wrote:
Still don't get it...

I tried

var/O = new item(src)

But it gives me the same error...

Read the code over again. That line isn't in the code I gave you. Come on, this isn't too hard, Sariat. :P
In response to Malver
Okay, I found a solution : I quit.

I busted my toe on a damn brick that some idiot left on my driveway, I can't solve this damn piece of crap, and now I got my mom bitching at me to help some guy out in some homework (First it was Algebra, then it was Geography, now its Geometry, make up your damn mind!!!)

In response to Sariat
Sariat wrote:
Okay, I found a solution : I quit.

I busted my toe on a damn brick that some idiot left on my driveway, I can't solve this damn piece of crap, and now I got my mom bitching at me to help some guy out in some homework (First it was Algebra, then it was Geography, now its Geometry, make up your damn mind!!!)


Why on earth are you quitting? The answer is right there in front of you Sariat! I gave you the code! All you have to do is actually read it, and put it into your code. It's not that hard. :P
In response to Malver
Whatever... my 10 minutes of trying are up.
In response to Sariat
Sariat wrote:
Whatever... my 10 minutes of trying are up.

Well, at least I know what level of dedication you give to your projects now. :P
In response to Malver
Malver wrote:
Sariat wrote:
Whatever... my 10 minutes of trying are up.

Well, at least I know what level of dedication you give to your projects now. :P

Damn right. If its worth more than 10 minutes of my time, it ain't worth it.
In response to Sariat
Damn right. If its worth more than 10 minutes of my time, it ain't worth it.

Ive never actually seen you give up Sariat, considering youve made all those code snippets you are really good at coding and respect your skill at coding.
In response to Mrhat99au
Mrhat99au wrote:
Damn right. If its worth more than 10 minutes of my time, it ain't worth it.

Ive never actually seen you give up Sariat, considering youve made all those code snippets you are really good at coding and respect your skill at coding.

I know...but that's genneraly how it goes down. I work on it, find a bug, try the allotted 10 minutes of trying. Do something else... get bored, come back, and fix it.
In response to Sariat
Sariat wrote:
Mrhat99au wrote:
Damn right. If its worth more than 10 minutes of my time, it ain't worth it.

Ive never actually seen you give up Sariat, considering youve made all those code snippets you are really good at coding and respect your skill at coding.

I know...but that's genneraly how it goes down. I work on it, find a bug, try the allotted 10 minutes of trying. Do something else... get bored, come back, and fix it.

Yeah i do that too, but half the time i do something else and forget about it and then bring it back after a week.