ID:150586
 
Yes, this is another question from myself. You've probably posted the answer to this question atleast 5 times already, but here goes anyway. I have a weapon obj that you can wield/equip and unequip. I also have my clicking attack in. Now, I don't even have a weapon yet and I can kill the enemy from afar. I do not want this to happen, ie. You need a weapon to kill someone with first, and you have to equip it. If I remember correctly, you have to set a flag that tells the language what state the object is in (equipped/unequipped.) Here's the problem, how do I do this in BYOND (DM)? I looked through the combat tutorials/demos/libraries and couldn't grasp it. Any ideas or help will be greatly appreciated.

Thanks

-Mertek
Mertek wrote:
Yes, this is another question from myself. You've probably posted the answer to this question atleast 5 times already, but here goes anyway. I have a weapon obj that you can wield/equip and unequip. I also have my clicking attack in. Now, I don't even have a weapon yet and I can kill the enemy from afar. I do not want this to happen, ie. You need a weapon to kill someone with first, and you have to equip it. If I remember correctly, you have to set a flag that tells the language what state the object is in (equipped/unequipped.) Here's the problem, how do I do this in BYOND (DM)? I looked through the combat tutorials/demos/libraries and couldn't grasp it. Any ideas or help will be greatly appreciated.

Thanks

-Mertek

theres no preset flag for when somethings equipped. You have to make the flag(var)

IE (obj/Weapons/var/Equipped = 0 // Default is 0) and whenever you do what you want for it to be equipped, just set the flag to one by calling the object, and settings what you want on it. Take a look at firekings weapon system for some examples of how to set the vars and how to do stuff like wield (Although I have to say his way of doing it is a LITTLE long). Or Spuzzums, hope this made just a LITTLE sense.


Alathon
In response to Alathon
Alathon wrote:
theres no preset flag for when somethings equipped. You have to make the flag(var)

It's fairly common to use the suffix variable to mark when something is equiped. The suffix variable does one special thing. It shows up in the statpanels in the far right column in blue. Other than that, it is a regular variable you can use however you like.

If you don't want to use the special blue display of suffix, just define your own variable as Alathon suggested ;)