ID:270265
 
Code:


Problem description:





i need to figure out how to equipt armor so it makes my def go up and so it has overlay it wont work for me plz tell me code.
Stone_Cold_Oven wrote:
Code:


Problem description:
i need to figure out how to equipt armor so it makes my def go up and so it has overlay it wont work for me plz tell me code.

Well, it probably doesn't work because... it's not even there. You need to provide something for people to work off of if you're asking for help on something like this. Most people create their games differently, and, because of that, an answer I could give you would probably have no use to you in your game.
In response to DerDragon
here is something i took strait from my game i havent edited it. It dhould help you with overlay.


mob/var/hair// this is what the hair icon is in
mob/var/wearing=0// this is for the verb

mob/Login()
usr.icon='man.dmi'
usr.Move(locate(1,1,1))
usr << "<font color=white>Welcome to Your New Fate</font>"
usr << "<font color=white>You are The Last Hero</font>"
world << "<font color=red><b><u><i>[usr] has entered</font></b></i></u>"








turf/grass
icon='grass.dmi'

mob/verb/Wear_or_Remove_Chest_Plate()
if(usr.wearing==1)//this is just a var to see if the helm is being worn you will probly have to improvize
usr.overlays-='chestpl8.dmi'// this is the helm icon
usr.overlays+= usr.hair// this is your hair
usr.wearing=0// this makes it to where it will make it remove the next time you click this verb
else// this is else like ummm hmmm a good what to explane this... if else you wearing dont = 1 it will do that
usr.overlays+='chestpl8.dmi'
usr.wearing=1
Stone_Cold_Oven wrote:
Code:
>

Problem description:





i need to figure out how to equipt armor so it makes my def go up and so it has overlay it wont work for me plz tell me code.

Here is a code to equpit a weapon. Hope it becomes useful.

obj
bladeover
icon = 'wepons.dmi'
icon_state = "Iron Blade"
obj/Isword
icon = 'wepons.dmi'
icon_state = "sword"
verb
Get()
set src in oview(1)
if(usr.Ssword == 0)
new/obj/Isword(usr)
usr.Ssword = 1
usr << " YOU ACQUIRED THE IRON BLADE !"
else
usr << " Your own blade stops you from approaching "
Click()
if(usr.Ssword == 1)
if(usr.sword == 0)
usr.STR += 50
usr.overlays += 'wepons.dmi'
usr << "You equip the Iron Blade !"
usr.sword = 1
else
usr.overlays -= 'wepons.dmi'
usr << " you unequipped the sword !"
usr.STR -= 50
usr.sword = 0
In response to Bamrulez
Ugh. No no no. There are several right ways and many more wrong ways to equip things, and you've picked one of the wrong ones.

Wrong:
usr.sword = 1


Right:
usr.sword = src


In any equipment system, knowing whether an item is equipped is next to useless, but knowing which item is equipped is very helpful. In any good equipment system, you'll have a null value for nothing equipped, or a reference to the actual item equipped.

I implore you to check out Wizkidd0123's equipment system.

Lummox JR
In response to Mxjerrett
Since I don't feel much like repeating myself, go read [link], which applies equally well to your code. So very wrong.

Lummox JR
In response to Bamrulez
this is what i got:


obj
Weapons
var
add = 0
cost = 5
icon = 'E - Wepons.dmi'
verb
Get()
set src in oview(1)
src.Move(usr)
Drop()
set src in usr.contents
src.Move(usr.loc)
Equip()
set src in usr.contents
if(usr.weponon == 1)
usr<<"You have a weapon equiped already!"
return
else
usr.weponon = 1
usr.attackadd += src.add
UnEquip()
set src in usr.contents
if(usr.weponon == 0)
usr<<"You dont a weapon equiped!"
return
else
usr.weponon = 0
usr.attackadd = 0
Ice_Dagger
icon_state = "Ice Dagger"
add = 10
cost = 5
Fire_Blade
icon_state = "Fire Blade"
add = 35
cost = 10
Ice_Blade
icon_state = "Ice Blade"
add = 65
cost = 15



i have it bring up my str and stuuf but i cant make it over lay.
In response to Lummox JR
this is what i got:


obj
Weapons
var
add = 0
cost = 5
icon = 'E - Wepons.dmi'
verb
Get()
set src in oview(1)
src.Move(usr)
Drop()
set src in usr.contents
src.Move(usr.loc)
Equip()
set src in usr.contents
if(usr.weponon == 1)
usr<<"You have a weapon equiped already!"
return
else
usr.weponon = 1
usr.attackadd += src.add
UnEquip()
set src in usr.contents
if(usr.weponon == 0)
usr<<"You dont a weapon equiped!"
return
else
usr.weponon = 0
usr.attackadd = 0
Ice_Dagger
icon_state = "Ice Dagger"
add = 10
cost = 5
Fire_Blade
icon_state = "Fire Blade"
add = 35
cost = 10
Ice_Blade
icon_state = "Ice Blade"
add = 65
cost = 15



i have it bring up my str and stuuf but i cant make it over lay.
In response to Stone_Cold_Oven
As I noted in that other post, you must not set your weapon var to just 1 when you equip a weapon. Set it to the weapon itself. Set it to null when you unequip.

Lummox JR