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.
ID:270265
Feb 22 2006, 2:15 pm
|
|
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 |
Stone_Cold_Oven wrote:
Code: > Problem description: Here is a code to equpit a weapon. Hope it becomes useful. obj |
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 |
Code:
Problem description:
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.