new().
Say something like
proc/Make(obj/makeable/T)
new T(usr)
T.skillvarthing = usr.skillofmaking
That would provide me with runtime errors.
Thanks
-ST
ID:177925
![]() Jul 15 2002, 11:58 am
|
|
Its changing vars to things that have been created with
new(). Say something like proc/Make(obj/makeable/T) That would provide me with runtime errors. Thanks -ST |
![]() Jul 15 2002, 12:45 pm
|
|
Don't use usr in procs. I'm not sure if that's the problem, but it's not a safe habit.
|
Sariat wrote:
Its changing vars to things that have been created with proc/Make(obj/makeable/T) Aside from what ACWraith said about usr, you forgot that "new T" won't work unless T is a type path; if T is an object, then you need it to be "new T.type". Lummox JR |
Hrmmm, didn't do much either.
mob/verb/create(A in typesof(/turf) - /turf) runtime error: Cannot read /turf/water (/turf/water).type Thats what I'm getting. -ST |
Sariat wrote:
Hrmmm, didn't do much either. > mob/verb/create(A in typesof(/turf) - /turf) runtime error: Cannot read /turf/water (/turf/water).type A is a type. You pass A to Create() and inside that proc, T is now a type. A type does not have a "type" variable. |
Sariat wrote:
Hrmmm, didn't do much either. mob/verb/create(A in typesof(/turf) - /turf) My advice was based on the idea that when you were defining T as an atom, you actually were passing an atom, not a type. If you're passing a type, then don't call T an atom and don't use T.type; just use T as you did before. The real problem appears to be in your calling routine, the verb. Why, exactly, did you think a type path is allowable as an argument to a verb, and why did you think it could be restricted to an arbitrary list of your choosing? NO VERB works this way. DS has no idea what to do with this, so the create verb doesn't ask for a type; it merely thinks A is null, and you're calling Create(null). What you need to do instead is this: mob/verb/create() And then change your Create() proc back to what it was before, but don't call T a turf or an atom or anything; just make it Create(T). Lummox JR |
I still can't change the var after it has been created...
runtime error: Cannot modify /turf/grass.somevar I tried: proc/Create(atom/T) Sorry if I missed something, I'm just not seeing how I can chage a var of something after it has been created in this example... -ST |
Sariat wrote:
I still can't change the var after it has been created... proc/Create(atom/T) and proc/Create(atom/T) You didn't read through my post, did you? I said for one thing, atom/T is totally wrong in the argument, and it should just be T, since you're passing a type path, not an atom. And I said that since you're intending to pass a type path along, T.type is obviously wrong, because again, T is a type, not an atom. I originally only suggested you use T.type when I thought T was in fact an atom, until I saw the verb you used to call it; then I realized you just totally botched the argument to Create(), and explained that telling you exactly what to change, and you just paid zero attention and botched it even worse. Gads. Now the rest of the problem: You're never assigning the new atom to a var. proc/Create(T) That's it. That's all there is to it. Lummox JR |