ID:178936
Mar 16 2002, 8:41 pm
|
|
Okay, I figured out a way to live with my equipping problem, but now I don't want the verb to appear on the verb panel, but only when I right click on it. But, setting the category to null crashes the program (Dreamseaker) every time. Here is the first few lines of code. Any help will be appreciated. Thanks.
|
In response to Rubius
|
|
use this, but change it to your needs.
and set the vars. obj/weapon/Roller_Sword icon = 'swords.dmi' icon_state = "2" name = "Roller Sword" Money = 13 power = 2 verb Equip() set category = "Commands" if(usr.wep == src.name) usr << "Your already have somthing Equiped!" if(usr.wep == null) if(istype(usr, /mob/characters/wizard)) alert("your class cant Equip that!") else if(alert("Are you sure you want to Equip this Weapon?","Equip??","Yes","No") == "Yes") usr.Att+=power view(6) << "[usr] Equips his Roller Sword." usr.wep = src.name usr.equiped = 1 suffix += "Equiped" UnEquip() set category = "Commands" if(usr.wep == null) usr << "You have Nothing equiped!" if(usr.wep == src.name) if(alert("Are you sure you want to UnEquip this weapon?","UnEquip??","Yes","No") == "Yes") usr.wep = null usr.Att-=power suffix = null usr.equiped = 0 - Raekwon |
In response to RaeKwon
|
|
What I'm trying to do is make it so that the verb doesn't show up in the panel, but shows up when you right click on the item in the list.
|
In response to Rubius
|
|
You can't do that, sorry.
|
In response to Nadrew
|
|
Yes he can. Setting category to null should achieve the effect he's looking for. I ran a little test and got it to work. Additionally, I don't see anything wrong with his code.
Taken from the reference: To hide a verb from all panels, set the category to null. The verb may still show up in right-click popup menus... |
In response to tenkuu
|
|
Hmm I never thought about setting it to null. You're right and I just learned something.
|
In response to Nadrew
|
|
Well, the code compiles, but when I run it and right click on the item in the inventory, Dreamseaker crashes. I'm using build 316
|
In response to Rubius
|
|
I'm not seeing this action.
|
In response to Rubius
|
|
DM code shouldn't crash Dramseeker (if used correctly). If you can reproduce this, send the project to [email protected] along with instruction on how to reproduce the crash.
|
obj
weapons
icon = 'weapons.dmi'
verb
EquipWeapon()
set category = null
set src in usr
if (usr.weapon == 1)
if (src.suffix == "Equipped")
usr.strequip -= src.strbonus
usr.defequip -= src.defbonus
usr.aglequip -= src.aglbonus
usr.luckequip -= src.luckbonus
usr.intequip -= src.intbonus
src.suffix = ""
usr.weaponname = ""
usr.weapon = 0
usr << "You have unequipped the [src.name]."
else
usr << "You must unequip the [usr.weaponname]"