obj
Fire
proc
Spread(M as turf in oview(1))
sleep(10)
if(M.flamable == 1)
var/obj/Fire/F = new
F.loc = locate(M)
Whenever I run this code I get the error:
Fire.dm:6:error:M.flamable:undefined var
Could someone please help me.
ID:269644
Aug 21 2005, 10:28 pm
|
|
Here is the code I have made:
obj Whenever I run this code I get the error: Fire.dm:6:error:M.flamable:undefined var Could someone please help me. |
Aug 21 2005, 10:36 pm
|
|
Do turfs have a 'flamable' var? (It's spelt 'Flammable', by the way. Synonomous with 'inflammable', by a quirk of English)
|
In response to Jp
|
|
The flamable(flammable) variable is my own that I made up.
|
ADT_CLONE wrote:
Here is the code I have made: > obj Whenever I run this code I get the error: You haven't defined the turfs 'flamable' var.
turf/var/flamable
~Sinyc. |
In response to Sinyc
|
|
Ok. I did actually define the variable. Here is all my code:
obj Could you please help me |
In response to Sinyc
|
|
I did actually define that varible elseware in my code.
|
In response to ADT_CLONE
|
|
You've defined it within turf/Grass not turf as a whole.
|
In response to Sinyc
|
|
oh thanks
|
In response to ADT_CLONE
|
|
Its still not working.
|
In response to Sinyc
|
|
Ill change that to compile code.
|
In response to ADT_CLONE
|
|
My question was, is it defined for turfs?
EDIT: Oh, and the 'm as turf in oview(1) makes no sense. You want the proc to be defined like this: Spread(var/turf/m) And then you just call it with a turf as an argument. If you use view() or range() in procs, be aware that they default to the view or range of usr, so you'll need to override that in the proc. |
In response to Jp
|
|
The proc is defined for the Fire object. Ive now got this code:
obj Could you please correct this. Oh and I get this runtime error: runtime error: Cannot read null.flamable proc name: Spread (/obj/Fire/proc/Spread) usr: ADT_CLONE (/mob) src: Fire (/obj/Fire) call stack: Fire (/obj/Fire): Spread(null) Fire (/obj/Fire): New() Grass (1,1,1) (/turf/Grass): Light() |
In response to ADT_CLONE
|
|
ADT_CLONE wrote:
obj That is because you called Spread() without any arguments. You need to call it with it's location as the argument. You also don't need to call Spread() in the Spread proc when it already gets called in New(). You'd basically be calling it twice. New() Though I'm willing to bet that isn't what you want to do. If you put this in right now, you'd get no actual "Spread" since it's only spreading in one location. This will make it "spread" around all of the locations. Spread(turf/Grass/M) Basically what it does is that it creates flames everywhere around (and at) the turf, only if it is flamable and there isn't already a fire in that location. If I didn't add that check, the place would be spammed with useless fire. (Since it is on top of each other.) If you want to delete the fire after a few seconds, just do it in the New() proc. obj/fire ~~> Dragon Lord |
In response to Unknown Person
|
|
Thanks
|
In response to Unknown Person
|
|
It still comes up with the same error.
ill add on to that that it runs the proc but doesnt create the fire in the first place. |
In response to ADT_CLONE
|
|
This is the error I get:
runtime error: Cannot read null.flamable proc name: Spread (/obj/Fire/proc/Spread) usr: ADT_CLONE (/mob) src: Fire (/obj/Fire) call stack: Fire (/obj/Fire): Spread(null) Fire (/obj/Fire): New() Grass (2,1,1) (/turf/Grass): Light() |