ID:158480
 
im not sure how to make float layers, there is some my tries
var/const
HAT_L=FLOAT_LAYER-2
CHEST_L=FLOAT_LAYER-3
BOTTOM_L=FLOAT_LAYER-2
CAPE_L=FLOAT_LAYER-1

obj
chest
FLOAT_LAYER=CHEST_L
var
power = 0
verb
Drop()
set src in usr
if(src.suffix=="Equipped")
usr << "You can't drop equipped item, unequip it first"
else
src.Move(usr.loc)
Get()
set src in oview(1)
src.Move(usr)
Equip()
set src in usr
if(usr.cheston==0)
usr.cheston++
usr << "You equipped [src.name]"
usr.overlays+=src.icon
usr.defense+=src.power
src.suffix="Equipped"
else
usr << "You have something on"
Unequip()
set src in usr
if(usr.cheston==1)
usr.cheston--
usr << "You unequipped [src.name]"
usr.overlays-=src.icon
usr.defense-=src.power
src.suffix=""
else
usr << "You dont have it equipped"
newbie_robe
icon = 'newbie_top.dmi'
power = 5

obj
chest
FLOAT_LAYER=1
var
power = 0
verb
Drop()
set src in usr
if(src.suffix=="Equipped")
usr << "You can't drop equipped item, unequip it first"
else
src.Move(usr.loc)
Get()
set src in oview(1)
src.Move(usr)
Equip()
set src in usr
if(usr.cheston==0)
usr.cheston++
usr << "You equipped [src.name]"
usr.overlays+=src.icon
usr.defense+=src.power
src.suffix="Equipped"
else
usr << "You have something on"
Unequip()
set src in usr
if(usr.cheston==1)
usr.cheston--
usr << "You unequipped [src.name]"
usr.overlays-=src.icon
usr.defense-=src.power
src.suffix=""
else
usr << "You dont have it equipped"
newbie_robe
icon = 'newbie_top.dmi'
power = 5

obj
chest
layer=CHEST_L
var
power = 0
verb
Drop()
set src in usr
if(src.suffix=="Equipped")
usr << "You can't drop equipped item, unequip it first"
else
src.Move(usr.loc)
Get()
set src in oview(1)
src.Move(usr)
Equip()
set src in usr
if(usr.cheston==0)
usr.cheston++
usr << "You equipped [src.name]"
usr.overlays+=src.icon
usr.defense+=src.power
src.suffix="Equipped"
else
usr << "You have something on"
Unequip()
set src in usr
if(usr.cheston==1)
usr.cheston--
usr << "You unequipped [src.name]"
usr.overlays-=src.icon
usr.defense-=src.power
src.suffix=""
else
usr << "You dont have it equipped"
newbie_robe
icon = 'newbie_top.dmi'
power = 5


i have more not working codes, but i dont know to make it work. also can you help me make its layer change when its dir change. thanks for help

The easiest thing to do is for the mob to change layers in Move(). If they're facing north (dir & NORTH) then set their layer to MOB_LAYER+1. Otherwise, set their layer to MOB_LAYER. However, this precludes the use of FLOAT_LAYER (as that causes the overlay to always match the layer of whatever it's overlayed on), so you'd need to set the objects to be layer MOB_LAYER. You'd also have to add the objects themselves to overlays, not just the icon.

If you need multiple layers of equipped objects, you'll need to use a higher layer for mobs (like MOB_LAYER+10 for mobs) so you can go below it without objs and turfs appearing above your equipment.
In response to Garthor
Garthor wrote:
The easiest thing to do is for the mob to change layers in Move().

i want to ask is there difference if you use Move() with obj or with mob, if there is none then ill try to do it

If they're facing north (dir & NORTH) then set their layer to MOB_LAYER+1.

something like this?: layer=MOB_LAYER+1

You'd also have to add the objects themselves to overlays, not just the icon.

how should i do this? chest commands, vars and verbs are for all items that you wear on chest like robes,armors,clothes, so should i add equip and unequip vebs to all items, not 1 for whole chest items group?

If you need multiple layers of equipped objects, you'll need to use a higher layer for mobs (like MOB_LAYER+10 for mobs) so you can go below it without objs and turfs appearing above your equipment.

wont armor go below mob who wears it?

In response to Martys1103
Martys1103 wrote:
Garthor wrote:
The easiest thing to do is for the mob to change layers in Move().

i want to ask is there difference if you use Move() with obj or with mob, if there is none then ill try to do it

If they're facing north (dir & NORTH) then set their layer to MOB_LAYER+1.

something like this?: layer=MOB_LAYER+1

You'd also have to add the objects themselves to overlays, not just the icon.

how should i do this? chest commands, vars and verbs are for all items that you wear on chest like robes,armors,clothes, so should i add equip and unequip vebs to all items, not 1 for whole chest items group?

If you need multiple layers of equipped objects, you'll need to use a higher layer for mobs (like MOB_LAYER+10 for mobs) so you can go below it without objs and turfs appearing above your equipment.

wont armor go below mob who wears it?


No, he means mobs other than users, so turfs and objs don't go above you.
In response to Xyphon101
objs on map doesnt go above you but objs you wear does?

also, couldn't you paste that part you answered, its easier to read

also i have idea how to make obj to overlay without making equip verb for every item, but i need a bit help

obj
chest
var
power = 0
FLOAT_LAYER=1//didnt fix it yet
verb
Equip()
set src in usr
if(usr.cheston==0)
usr.cheston++
usr << "You equipped [src.name]"
usr.overlays+=/obj/chest/___
/*there should be newbie robe or other item,
but i need help how to make it automatically make obj you
equipped overlay, like when you right click it and press
equip,it writes that item name here(like i tried /obj/chest/src.name
*/

usr.defense+=src.power
src.suffix="Equipped"
else
usr << "You have something on"
newbie_robe
icon = 'newbie_top.dmi'
power = 5