ok i got how to get overlays but now when i equipt one thing its over another. But if i unequipt armor and then reequipt it then the weapon is under the armor... ill show u how i have them done.
Ice_Sword
icon='Swords.dmi'
icon_state="Ice"
verb
Get_Item()
set src in oview(1)
src.loc = usr//user gets the object
view() << "[usr] picks up the [src]"//message desplayed
Drop_Item()
set src in usr
src.loc = usr.loc
view() << "[usr] drops the [src]"
Equip()
if(usr.equiped == 0)
usr.attack += 25
usr.equiped = 1
usr.overlays += icon('Swords.dmi', "IS")
usr << "You equip [src]"
src.suffix = "Equipped"
else
usr << "You already have something equipped..."
Un_Equip()
if(usr.equiped == 1)
usr.attack -= 25
usr.equiped = 0
usr.overlays -= icon('Swords.dmi', "IS")
usr << "You unequip [src]."
src.suffix = ""
else
usr << "You dont have anything equiped..."
thats the weapon and here is the armor
Water_Armour
icon='Clothing.dmi'
icon_state="waterarmour"
verb
Get_Item()
set src in oview(1)
src.loc = usr//user gets the object
view() << "[usr] picks up the [src]"//message desplayed
Drop_Item()
set src in usr
src.loc = usr.loc
view() << "[usr] drops the [src]"
Equip()
if(usr.armour == 0)
usr.defense += 4
usr.armour = 1
usr.overlays += icon('Clothing.dmi', "WA")
usr << "You equip [src]"
src.suffix = "Equipped"
else
usr << "You already have something equipped..."
Un_Equip()
if(usr.armour == 1)
usr.defense -= 4
usr.armour = 0
usr.overlays -= icon('Clothing.dmi', "WA")
usr << "You unequip [src]."
src.suffix = ""
else
usr << "You dont have anything equiped..."
i used usr.overlays += icon('Clothing.dmi', "WA") for both i know i need to get weapons and armor on seperate laysers. but how?
ID:144949
Jul 17 2006, 12:15 pm
|
|
In response to Loduwijk
|
|
ok ill try that thanks...... back and im lost... DM tags and image?
|
In response to Pyro170
|
|
DM tags are
layer
layer = MOB_LAYER+2 // remember to layer in order +2, +3,etc
|
In response to Pyro170
|
|
overlays += image('icon.dmi', ,"icon state", layer number here) |
In response to Talion Knight
|
|
hmmm..... well where do i set that in the code cuzz every where i try that it does the same thing the sword goes under the armor if i take off the armor ten re equipt it
|
In response to Loduwijk
|
|
Loduwijk wrote:
overlays += image('icon.dmi', ,"icon state", layer number here) is it like this overlays += image('icon.dmi',,"icon state", layer 1) or do i just set a number there like this overlays += image('icon.dmi',,icon state", 1) ? |
In response to Pyro170
|
|
The latter, just a number.
|
In response to Loduwijk
|
|
ok that worked but i got a new problem now.... when i go to unequipt the icon is still there..... what now?
this is what i have... Water_Armour icon='Clothing.dmi' icon_state="waterarmour" verb Get_Item() set src in oview(1) src.loc = usr//user gets the object view() << "[usr] picks up the [src]"//message desplayed Drop_Item() set src in usr src.loc = usr.loc view() << "[usr] drops the [src]" Equip() if(usr.armour == 0) usr.defense += 4 usr.armour = 1 usr.overlays += image('Clothing.dmi',"WA",-2) usr << "You equip [src]" src.suffix = "Equipped" else usr << "You already have something equipped..." Un_Equip() if(usr.armour == 1) usr.defense -= 4 usr.armour = 0 usr.overlays -= image('Clothing.dmi',"WA") usr << "You unequip [src]." src.suffix = "" else usr << "You dont have anything equiped..." and the weapon Wind_Sword icon='Swords.dmi' icon_state="Wind" verb Get_Item() set src in oview(1) src.loc = usr//user gets the object view() << "[usr] picks up the [src]"//message desplayed Drop_Item() set src in usr src.loc = usr.loc view() << "[usr] drops the [src]" Equip() if(usr.equiped == 0) usr.attack += 125 usr.equiped = 1 usr.overlays += image('Swords.dmi',"Ws",-1) layer = MOB_LAYER+2 usr << "You equip [src]" src.suffix = "Equipped" else usr << "You already have something equipped..." Un_Equip() if(usr.equiped == 1) usr.attack -= 125 usr.equiped = 0 usr.overlays -= image("Swords.dmi","WS",1) usr << "You unequip [src]." src.suffix = "" else usr << "You dont have anything equiped..." how do i make it so it overlay is removed while i unequipt it? |
In response to Pyro170
|
|
Try saving the image to a variable instead and then subtract that variable from the overlays list.
mob |
In response to Loduwijk
|
|
thanks ill try that
|
Use the image function instead of the icon function, as image has a parameter for layer.