ID:162707
 
I'm trying to find a way to make it so that for each armor and weapon to don't have to add a verb to equip, for example:
obj
blah
verb
equip()
if(usr.equiped==1)
src<<"you already have something equipped"
else
usr.overlay+="blah"
usr.str+=25
usr.equiped+=1
drop()
if(usr.equiped==1)
src<<"you can not drop this while its equiped"
unequip()
if(usr.equiped==0)
src<<"you dont have anything on"
else
usr.equiped=0
usr.overlay-="blah"

i want it so you can do all that with just making one verb, can someone help? I've been thinking of making it a proc but i'm not sure how to make it or if it will work.
I don't think you can drop/equip/unequip all in one....maybe equip/unequip in one verb but drop nope
In response to Lundex
Lundex wrote:
I don't think you can drop/equip/unequip all in one....maybe equip/unequip in one verb but drop nope


Well im trying to make it so that with one lil proc you can equip, unequip, look at info, and drop and give all those items those verbs without having to code them seperetly
In response to Scarymonkeys623
Hmm, still don't think that possible.
In response to Lundex
Lundex wrote:
Hmm, still don't think that possible.

actually while looking through my old post if found this, I'm not sure if it will work for a universal verb or not but I'm pretty sure it will.
obj
item
verb
get()
set src in oview(1)
if(Move(usr)) usr << "You get [src]"
drop()
set src in usr
if(Move(usr.loc)) usr << "You drop [src]"
equipment
verb
equip()


p.s. thnx for this garthor :)
In response to Scarymonkeys623
I was about to say that that was exactly right. Then I noticed that you got it from me, so of course it is.

The other stipulation here is that, in order for your equip verb to be universal, you're going to have to give variables to your equipment to track what they should change. For example:

obj/item/equipment
var/strengthmod = 0
var/healthmod = 0
verb/equip()
usr.strength += strengthmod
usr.health += healthmod
In response to Garthor
Once again thanks for that lol, but i wanted to ask you something, I'm trying to get it to have a verb for all equipment so it will do this
obj/item/equipment
Verb
Info()
src<<"[obj]\
Strength:
[Wstr]\
Defense:
[Wdef]\
Damage:
[WDO]-[WDT]\
Armor:
[Warm]\
Type:
[Wtype]"

thats just a quick example i made in 3min, I dont even know it if works, but instead of him seeing it in the text screen i want it to come up in browser, but i never knew how to put things in the browser, can u help?
In response to Scarymonkeys623
In response to Garthor
Garthor wrote:
http://developer.byond.com/docs/ref/info.html#/proc/browse

so i have to make it a .html file????
In response to Scarymonkeys623
No. You just browse() the text that you want to display.
In response to Garthor
Garthor wrote:
No. You just browse() the text that you want to display.

obj/item/equipment
Verb
Info()
usr<<browse("obj]\
Strength:
[Wstr]\
Defense:
[Wdef]\
Damage:
[WDO]-[WDT]\
Armor:
[Warm]\
Type:
[Wtype])

like that?