ID:268470
 
[EDIT]IGNORE ALL OF THE DOWNWARD PARTS]
    Wood_Shield
icon = 'Items.dmi'
icon_state = "Wood Shield"
name = "Wood Shield"
verb
Get()
set category = "Item Commands"
set src in oview(1)
src.Move(usr)
Drop()
set category = "Item Commands"
src.Move(usr.loc)
Equip()
set category = "Item Commands"
if(src.Left_Hand)
usr << "You already have a shield equipped!"
return
src.Left_Hand = 1

mob
var
MaxHP
HP
MP
MaxMP
Strength
MinStrength
EXP
EXPNeeded
Level
Def
Gold = 0
bank_Gold = 0
src.Left_Hand = 0
src.Right_Hand = 0
src.Head = 0
src.Body = 0

Now, I get the "weirdest" error...
Slime Warrior.dm:281:error:src.Left_Hand:undefined var
Slime Warrior.dm:284:error:src.Left_Hand:undefined var

:O
I have it right there, defined in both of them..

mob
var
MaxHP
HP
MP
MaxMP
Strength
MinStrength
EXP
EXPNeeded
Level
Def
Gold = 0
bank_Gold = 0
src.Left_Hand = 0
src.Right_Hand = 0
src.Head = 0
src.Body = 0


to

mob
var
MaxHP
HP
MP
MaxMP
Strength
MinStrength
EXP
EXPNeeded
Level
Def
Gold = 0
bank_Gold = 0
Left_Hand = 0
Right_Hand = 0
Head = 0
Body = 0

In response to Siientx
I still get...
Slime Warrior.dm:291:error:src.Left_Hand:undefined var
Slime Warrior.dm:294:error:src.Left_Hand:undefined var

=/
Thanks for trying to help.
In response to Hell Ramen
Copy the bottom code, and compile.
In response to Siientx
Wood_Shield
icon = 'Items.dmi'
icon_state = "Wood Shield"
name = "Wood Shield"
verb
Get()
set category = "Item Commands"
set src in oview(1)
src.Move(usr)
Drop()
set category = "Item Commands"
src.Move(usr.loc)
Equip()
set category = "Item Commands"
if(usr.Left_Hand)
usr << "You already have a shield equipped!"
return
usr.Left_Hand = 1
In response to Siientx
Thanks Siientx :P
In response to Hell Ramen
No problem. :)
In response to Hell Ramen
_>
<_<
Not to waste space, but...(I don't want to make another topic :P)
In a variable, how do you make it have an icon and an icon state?
I tried this...
mob
var
Wood_Shield = 'Armor.dmi',"Wood Shield"

=/ Help will be appreciated.

[Edit]Doh, nevermind >_<, Ignore this post.
In response to Hell Ramen
    Wood_Shield
icon = 'Items.dmi'
icon_state = "Wood Shield"
name = "Wood Shield"
verb
Get()
set category = "Item Commands"
set src in oview(1)
src.Move(usr)
usr << "You pick up [src]."
Drop()
set category = "Item Commands"
src.Move(usr.loc)
usr << "You drop [src]."
Equip()
set category = "Item Commands"
if(usr.Left_Hand)
usr.underlays += usr.Wood_Shield
usr << "You already have a shield equipped!"
return
usr.underlays += usr.Wood_Shield

mob
var
MaxHP
HP
MP
MaxMP
Strength
MinStrength
EXP
EXPNeeded
Level
Def
Gold = 0
bank_Gold = 0
Left_Hand = 0
Right_Hand = 0
Head = 0
Body = 0
Wood_Shield = 'Armor.dmi'
icon_state = "Wood Shield (under)"

=/ The underlay does NOT happen, help will be appreciated... =/ Thanks.
=/ Thank you for helping(if you do :P)...
In response to Hell Ramen
When you want an overlay you shouldn't really add it as a variable. What you should do is this.

    Wood_Shield
icon = 'Items.dmi'
icon_state = "Wood Shield"
name = "Wood Shield"
verb
Get()
set category = "Item Commands"
set src in oview(1)
src.Move(usr)
usr << "You pick up [src]."
Drop()
set category = "Item Commands"
src.Move(usr.loc)
usr << "You drop [src]."
Equip()
set category = "Item Commands"
if(usr.Left_Hand)
usr.underlays += src
usr << "You already have a shield equipped!"
return
usr.underlays += src

mob
var
MaxHP
HP
MP
MaxMP
Strength
MinStrength
EXP
EXPNeeded
Level
Def
Gold = 0
bank_Gold = 0
Left_Hand = 0
Right_Hand = 0
Head = 0
Body = 0

In response to Hell Ramen
The reason is that src in that case is the shield not the usr. And you're obj's dont have the variable Left_Hand assigned to them which is why its not defined. Change it to usr.Left_Hand.
In response to DeathAwaitsU
Yes, but I have the item centered, and the sheild isn't, it's in a different file... /_\
In response to Hell Ramen
Dont know what you're trying to say but all you have to do to add different overlay files is this:

var/icon/I = 'icon.dmi'
I.icon_state = "state"
usr.overlays += I


I remember reading a shorter version once but forgot it :)

EDIT:

Here is the shorter version:

var/icon/I = icon('icon.dmi',"state")
usr.overlays += I
In response to Hell Ramen
    Wood_Shield
icon = 'Items.dmi'
icon_state = "Wood Shield"
name = "Wood Shield"
verb
Get()
set category = "Item Commands"
set src in oview(1)
src.Move(usr)
usr << "You pick up [src]."
Drop()
set category = "Item Commands"
src.Move(usr.loc)
usr << "You drop [src]."
Equip()
set category = "Item Commands"
if(usr.Left_Hand)
usr.underlays += usr.Wood_Shield
usr << "You already have a shield equipped!"
return
usr.underlays += usr.Wood_Shield


The equip verb is totally rubbish

    Wood_Shield
icon = 'Items.dmi'
icon_state = "Wood Shield"
name = "Wood Shield"
verb
Get()
set category = "Item Commands"
set src in oview(1)
src.Move(usr)
usr << "You pick up [src]."
Drop()
set category = "Item Commands"
src.Move(usr.loc)
usr << "You drop [src]."
Equip()
set category = "Item Commands"
if(usr.Left_Hand)//if its already equipped
usr.underlays -= src//take the shield off
usr << "You remove the shield"
usr.Left_Hand = 0
else if(!usr.Left_Hand)
usr.underlays += src
usr << "You eqip the shield"
usr.Left_Hand = 1


My ones better unless i've misunderstood what you need.
In response to DeathAwaitsU
    Wood_Shield
icon = 'Items.dmi'
icon_state = "Wood Shield"
name = "Wood Shield"
verb
Get()
set category = "Item Commands"
set src in oview(1)
src.Move(usr)
usr << "You pick up [src]."
Drop()
set category = "Item Commands"
src.Move(usr.loc)
usr << "You drop [src]."
Equip()
set category = "Item Commands"
if(usr.Left_Hand)
usr << "You already have a shield equipped!"
return
var/icon/Wood_Shield = icon('Armor.dmi',"Wood Shield (under)")
usr << "You equipped a [src]!"
usr.underlays += Wood_Shield
usr.Def += 5
usr.Left_Hand = 1
Unequip()
set category = "Item Commands"
if(usr.Left_Hand)
var/icon/Wood_Shield = icon('Armor.dmi',"Wood Shield (under)")
usr.underlays -= Wood_Shield
usr.Def -= 5
usr << "You unequipped the [src]!"
usr.Left_Hand = 0
return
usr << "You don't have the [src] equipped!"

Still no underlay, now no text... No text! >_<
So it's like..
*presses equip*
No defense added? Must not of equipped... it doesn't have a message.
*presses equip again*
No Defense added still, and no message?
*presses equip again*
Screw this game.
Just to make sure you don't get another error like this; When you click on an object or use one its verbs, it will be the src. That goes for most other things, too.
In response to Devourer Of Souls
I will... >_<
In response to Hell Ramen
well if u would bother reading the post above what you just posted and bothered reading my post about overlays/underlays you wouldn't be struggling.
You should never set a var like usr.Left_Hand to 1 in your equipment system. The reason is obvious: Wouldn't you like to know what's actually in that hand?

usr.Left_Hand--and Right_Hand--should be null by default, and set to the weapon itself when it's in use.

Lummox JR
In response to DeathAwaitsU
DeathAwaitsU wrote:
well if u would bother reading the post above what you just posted and bothered reading my post about overlays/underlays you wouldn't be struggling.
As I stated before, ".src" will not help me, as it relates to the main icon. I have the underlay in a different file.
Page: 1 2