ID:151132
 
What I'm trying to do is make it so when you equip and item, stats and graphics of your character change, stats isn't that hard to do, but how do I make it so you equip an item and then your graphic changes? That's my secons biggest problem, but I don't think anyone out there can help with my main one...any ways, if you have any idea's, POST em!
Thanks,
Gilser

P.S.
For a funny pic, go to http://www.geocities.com/hh_cerberus/Smile.jpg
Don't worry, not porn, just weird!
What I'm trying to do is make it so when you equip and item, stats and graphics of your character change, stats isn't that hard to do, but how do I make it so you equip an item and then your graphic changes? That's my secons biggest problem, but I don't think anyone out there can help with my main one...any ways, if you have any idea's, POST em!

Try using the overlays list. For example:

mob/verb/equip(O as obj in usr)
usr.overlays += O

P.S.
For a funny pic, go to http://www.geocities.com/hh_cerberus/Smile.jpg
Don't worry, not porn, just weird!

Erm, now I'm wondering about your mental stability... =)
In response to Spuzzum
For a funny pic, go to http://www.geocities.com/hh_cerberus/Smile.jpg

Erm, now I'm wondering about your mental stability... =)

I knew my high school yearbook photo would come back to haunt me.
In response to Guy T.
On 3/14/01 9:09 pm Guy T. wrote:
For a funny pic, go to http://www.geocities.com/hh_cerberus/Smile.jpg

Erm, now I'm wondering about your mental stability... =)

I knew my high school yearbook photo would come back to haunt me.

;)
In response to Guy T.
Try using the overlays list. For example:

mob/verb/equip(O as obj in usr)
usr.overlays += O

It almost works! This is my prob, this works but when they equip the obj, it appears below them, how do I fix that? I've tried and just can't get it to work!
Thanks
Gilser
In response to Gilser
It almost works! This is my prob, this works but when they equip the obj, it appears below them, how do I fix that? I've tried and just can't get it to work!

Ah, forgot about this... this is probably due to the "layer" var, which is lower for objs than for mobs. Try adding this:

mob/verb/equip(O as obj in usr)
O.layer = FLOAT_LAYER
usr.overlays += O

...and then in your unequip verb, set the obj's layer back to OBJ_LAYER. See the Reference for more info. Sorry for the confusion!
In response to Guy T.
mob/verb/equip(O as obj in usr)
O.layer = FLOAT_LAYER
usr.overlays += O

...and then in your unequip verb, set the obj's layer back to OBJ_LAYER. See the Reference for more info. Sorry for the confusion!


Now I getthe warning O.layer BAD VAR! not good! CURSE THE BAD VARS!!! but anyways, any ideas on that one?
My code now looks like this:
obj/mech1
verb/equip(O as obj in usr)
O.layer = FLOAT_LAYER
usr.overlays += obj

But using just yer code said the same error!

Thanks
Gilser
In response to Gilser
See the FAQ section on "bad var"--the answer is there.
In response to Guy T.
On 3/18/01 12:31 pm Guy T. wrote:
See the FAQ section on "bad var"--the answer is there.

Yes. Even if you get an error with someone's posted code, try to see if you can't find the error yourself, first. In this case, the problem is rather visible, but I'll let you find it.
In response to Spuzzum
On 3/18/01 3:56 pm Spuzzum wrote:
On 3/18/01 12:31 pm Guy T. wrote:
See the FAQ section on "bad var"--the answer is there.

Yes. Even if you get an error with someone's posted code, try to see if you can't find the error yourself, first. In this case, the problem is rather visible, but I'll let you find it.

I thought this would work:
mob/var
var/layer

or

mob/var
var/O.layer

but I just get layer, duplicate definition and it doesn't tell me where the first one is! WHAAAA!
Thanks
Gilser
In response to Gilser
but I just get layer, duplicate definition and it doesn't tell me where the first one is! WHAAAA!


Layer is a predefined variable. Look at the verb itself; there's a problem with the arguments.