ID:139974
 
Code:
obj
Fire_Release
icon='Bigger Objects.dmi'
icon_state="Fire Release"
layer = 52
density=0
//pixel_y=-48
pixel_x=-48
Maker=""
New()
spawn(20)
var/D=new/obj/Kirin(src.loc)
D.Maker=src.Maker
walk(D,SOUTH,1)
del(src)
..()


Problem description: I am getting the errors:

Objects.dm:108:error: D.Maker: undefined var
Objects.dm:109:error: D: undefined var
Objects.dm:107:warning: D: variable defined but not used


What I'm trying to accomplish is having the release of fire shoot up, then after 2 seconds, create the object "Kirin" which will take the same maker as the fire. The "Kirin" will then fly downward and crash into any enemies. I have everything listed accomplished so far beside having these errors.

Am I doing something wrong?

Replace

var/D=new/obj/Kirin(src.loc)


with

var/obj/Kirin/D = new(src.loc)


and tell me if you get any errors.
In response to PrinceVegeta122
PrinceVegeta122 wrote:
Replace

> var/D=new/obj/Kirin(src.loc)
>

with

> var/obj/Kirin/D = new(src.loc)
>

and tell me if you get any errors.

same errors. I tried multiple different ways of putting that line of code.
Define 'Maker'. It's undefined.
In response to Warlord Fred
Warlord Fred wrote:
Define 'Maker'. It's undefined.

Maker is defined or I would have a variable error for

Maker=""
You are misusing spawn(). Code meant to be spawned off is supposed to be indented past the spawn(), like so:

spawn()
world << "inside spawn()"
world << "outside spawn()"


If you fail to do this, the default is that only the first line after the spawn() is within the spawn() block. So, in this case, only the line "var/D = blah" is within the spawn() block. As a result, it's out of scope in the rest of the proc.
In response to Garthor
Garthor wrote:
You are misusing spawn(). Code meant to be spawned off is supposed to be indented past the spawn(), like so:

spawn()
> world << "inside spawn()"
> world << "outside spawn()"

If you fail to do this, the default is that only the first line after the spawn() is within the spawn() block. So, in this case, only the line "var/D = blah" is within the spawn() block. As a result, it's out of scope in the rest of the proc.

Thank you, problem fixed ( :