Ok. I'm trying to get tiems (eg/armour) that you can pick up and equip. When equiped the item will appear on your body and alter your stats. Pretty standard RPG requirements.
I have FIREkings library code, which I modified slightly (do'h I here you say) to work with my program. Heres the problem. I can get the code working fine, but not the overlays. This is my code so far, and you will see that it's set so that, no matter what armour is equiped, the Leather_Armour overlay will be displayed. How can I change it so that whatever item is equiped will be displayed.
NOTE: The inserts arn't right in this code cause it didn't copy paste right. But they are all fine in my actual code.
//////////
obj/armour
var
def
description
locname
typew
verb
Look()
set src in view(1)
alert("[description]","Armour")
Pickup()
set new src in oview(1)
usr.contents += new locname
del src
Drop()
Move(usr.loc)
usr.chest = ""
usr.overlays -= /obj/armour/Leather_Armour
if(usr.defence >= src.def)
usr.defence -= src.def
Equip()
if(usr.chest == "")
usr.chest = src
usr.defence += src.def
usr.overlays += new /obj/armour/Leather_Armour
else
alert("You already have something equiped here!!","Sorry")
Unequip()
if(usr.chest == "")
alert("There is nothing to unequip!","Sorry")
else
usr.chest = ""
usr.overlays -= /obj/armour/Leather_Armour
if(usr.defence >= src.def)
usr.defence -= src.def
******************************************************
obj/armour
Leather_Armour
icon = 'armour.dmi'
icon_state = "leather"
layer = 5
def = 3
description = "Thick cloth armour. Defense = 3"
locname = /obj/armour/Leather_Armour
typew = "armour"
Studded_Armour
icon = 'armour.dmi'
icon_state = "studded"
layer = 5
def = 5
description = "Thick cloth armour with steel studds. Defense = 5"
locname = /obj/armour/Studded_Armour
typew = "armour"
//////////
ID:180396
Jul 6 2001, 9:44 pm
|
|
In response to Spuzzum
|
|
All atomic (area turf obj mob -ic) objects already have a predefined 'desc' var. You're basically sticking one more variable and seven more letters in for nothing. ;-) That's what I thought. But when you click the Look verb it actually makes the message appear in a text box (you know, the ones with the "close" button. I think thats what were talking about... =) |
In response to Botman
|
|
On 7/7/01 2:14 am Botman wrote:
All atomic (area turf obj mob -ic) objects already have a predefined 'desc' var. You're basically sticking one more variable and seven more letters in for nothing. ;-) Yeah, and you'd use alert(desc,"Armour") ;-) |
In response to Spuzzum
|
|
Once again I have figured it out for myself, not long after posting fo help. What's with that? Oh well. :)
|
I'll avoid answering your actual question because I really am too tired tonight. =)
But you're missing one small fact:
All atomic (area turf obj mob -ic) objects already have a predefined 'desc' var. You're basically sticking one more variable and seven more letters in for nothing. ;-)