Items that change one of the wearer's vars

How, what and why to code in BYOND.
Post Reply
User avatar
Drynwyn
Joined: Fri Apr 18, 2014 5:09 pm
Byond Username: Drynwyn

Items that change one of the wearer's vars

Post by Drynwyn » #2444

What's the proper way to do this? Change in equip/unequip (if that's even possible?) Do I need to create an item flag, like I see in mesons?
In game, I play the A.I Firmware, the French cyborg C.U.R.I.E, Aubrie Allen, and the lizard scum Skulks-Through-Maintenance.
User avatar
Ikarrus
Joined: Fri Apr 18, 2014 2:17 am
Byond Username: Ikarrus
Github Username: Ikarrus
Location: Canada
Contact:

Re: Items that change one of the wearer's vars

Post by Ikarrus » #2453

Very good question. I'd be interested as well.

Is there anything specific you're asking about, Dyrn?
Former Dev/Headmin
Who is this guy?
User avatar
Drynwyn
Joined: Fri Apr 18, 2014 5:09 pm
Byond Username: Drynwyn

Re: Items that change one of the wearer's vars

Post by Drynwyn » #2471

The immediate context is that I want to create an exosuit that will let the wearer ventcrawl, and ventcrawler is a var now.

There are a lot of broader applications though.
In game, I play the A.I Firmware, the French cyborg C.U.R.I.E, Aubrie Allen, and the lizard scum Skulks-Through-Maintenance.
AseaHeru
Rarely plays
Joined: Mon Apr 21, 2014 12:26 pm

Re: Items that change one of the wearer's vars

Post by AseaHeru » #2501

Ninja exosuit?
I am located here, lurking in your posts, leaving piles of transparent wordings and being confused. Oh, I also try to map...

This, this is an example of what I leave for you.
Also, these days I mostly play Ursit McStation, mostly because I like roleplay.
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Items that change one of the wearer's vars

Post by Remie Richards » #2518

use the equipped() proc, it has 2 arguments, 1 the mob that the item is equipped to, and 2 the slot it was equipped to.

eg.

Code: Select all

/obj/item/clothing/under/ventcrawl_suit/equipped(mob/living/user, slot_w_uniform)
私は完璧
User avatar
Drynwyn
Joined: Fri Apr 18, 2014 5:09 pm
Byond Username: Drynwyn

Re: Items that change one of the wearer's vars

Post by Drynwyn » #3282

Will that automatically change it back when it's unequipped, or will I need to create an unequipped() or whatever proc?
In game, I play the A.I Firmware, the French cyborg C.U.R.I.E, Aubrie Allen, and the lizard scum Skulks-Through-Maintenance.
User avatar
MisterPerson
Board Moderator
Joined: Tue Apr 15, 2014 4:26 pm
Byond Username: MisterPerson

Re: Items that change one of the wearer's vars

Post by MisterPerson » #3286

That could be handled by dropped(), but dropped() gets called when you put something in a bag, unequip, and of course actually drop the item. It's all very meh.
I code for the code project and moderate the code sections of the forums.

Feedback is dumb and it doesn't matter
User avatar
Drynwyn
Joined: Fri Apr 18, 2014 5:09 pm
Byond Username: Drynwyn

Re: Items that change one of the wearer's vars

Post by Drynwyn » #3342

And would also mean that if one equipped the item, picked up another instance of the item, then dropped that item, you might have issues.

That could be avoided with some checks tho.


EDIT: Is dropped() called before or after the item is removed from it's slot? Mote specifically, if I check for the item being present in the slot that it's attempted removal from resulted in a call to dropped(), will this return true or false?
In game, I play the A.I Firmware, the French cyborg C.U.R.I.E, Aubrie Allen, and the lizard scum Skulks-Through-Maintenance.
Post Reply

Who is online

Users browsing this forum: No registered users