Items that change one of the wearer's vars
- Drynwyn
- Joined: Fri Apr 18, 2014 5:09 pm
- Byond Username: Drynwyn
Items that change one of the wearer's vars
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.
- 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
Very good question. I'd be interested as well.
Is there anything specific you're asking about, Dyrn?
Is there anything specific you're asking about, Dyrn?
Former Dev/Headmin
Who is this guy?
Who is this guy?
- Drynwyn
- Joined: Fri Apr 18, 2014 5:09 pm
- Byond Username: Drynwyn
Re: Items that change one of the wearer's vars
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.
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.
-
- Rarely plays
- Joined: Mon Apr 21, 2014 12:26 pm
Re: Items that change one of the wearer's vars
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.
This, this is an example of what I leave for you.
Also, these days I mostly play Ursit McStation, mostly because I like roleplay.
- 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
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.
eg.
Code: Select all
/obj/item/clothing/under/ventcrawl_suit/equipped(mob/living/user, slot_w_uniform)
私は完璧
- Drynwyn
- Joined: Fri Apr 18, 2014 5:09 pm
- Byond Username: Drynwyn
Re: Items that change one of the wearer's vars
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.
- MisterPerson
- Board Moderator
- Joined: Tue Apr 15, 2014 4:26 pm
- Byond Username: MisterPerson
Re: Items that change one of the wearer's vars
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
Feedback is dumb and it doesn't matter
- Drynwyn
- Joined: Fri Apr 18, 2014 5:09 pm
- Byond Username: Drynwyn
Re: Items that change one of the wearer's vars
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?
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.
Who is online
Users browsing this forum: No registered users