Color Coded Autoinjectors

Locked
User avatar
HalfdeadKiller
Registered user
Posts: 468
Joined: 15 Oct 2014, 13:17

Color Coded Autoinjectors

Post by HalfdeadKiller » 05 Dec 2015, 06:11

Summary (a quick, 2-3 sentence summary): Please add a colored line denoting what kind of auto-injector an auto-injector is.

Benefits (How this will benefit the server and game as a whole): This would help combat medics, that way they can visually see a colored line, instead of having to mouse over every injector, or remember in which location injectors

Details (Description of how you think this would work, the benefits, etc): Just some sprite and code editing, I'll see if I can get a working example on some Baycode.

Implementation (Optional, if you have an idea how to implement it): Spriting and Code

Edit: Attaching a .zip that has the .png's of autoinjectors I colored. Seemed pretty simple to change the icon for autoinjectors in the code.
You do not have the required permissions to view the files attached to this post.
Last edited by HalfdeadKiller on 07 Dec 2015, 11:52, edited 1 time in total.

User avatar
coolsurf6
Registered user
Posts: 321
Joined: 25 Oct 2015, 04:06
Location: Trapped in a black hole that is Garry's Mod
Byond: coolsurf6

Re: Color Coded Autoinjectors

Post by coolsurf6 » 05 Dec 2015, 06:13

I really like the idea since its hard to distinguish whats what and if your patient is injured and you spend half your time finding what injecter you should use when you could be helping them so that they could get back in the fight easier. Its very simple to do and it might just take 15 minutes to do both spriting and coding since its just finding the injecter sprite in the first place.

+1
Last edited by coolsurf6 on 06 Dec 2015, 00:05, edited 1 time in total.
The FitnessGram™ Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal. [beep] A single lap should be completed each time you hear this sound. [ding] Remember to run in a straight line, and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark, get ready, start.

User avatar
Arachnidnexus
Donor
Donor
Posts: 449
Joined: 04 Sep 2015, 20:50

Re: Color Coded Autoinjectors

Post by Arachnidnexus » 05 Dec 2015, 09:15

+1 For color-coded autoinjectors. Would be nice to have as a medic or doctor for when you really want to shave seconds off of your treatment time.

User avatar
WyattH
Registered user
Posts: 305
Joined: 10 Sep 2015, 22:36

Re: Color Coded Autoinjectors

Post by WyattH » 05 Dec 2015, 09:27

coolsurf6 wrote:I really like the idea since its hard to distinguish whats what and if your patient is injured and you spend half your time finding what injecter you should use when you could be helping them so that they could get back in the fight easier. Its very simple to do and it might just take 15 minutes to do both spriting and coding since its just finding the injecter sprite in the first place.

-1
uh...did you mean +1 ?


Also I think this is a good idea if it can be implemented, +1 from me

User avatar
zskninoh
Registered user
Posts: 161
Joined: 22 Oct 2015, 20:26
Location: Florida

Re: Color Coded Autoinjectors

Post by zskninoh » 05 Dec 2015, 10:19

+1 for sure, would really be convenient.
Tᴏ ᴘʀᴏᴛᴇᴄᴛ ᴛʜᴇ ᴄʜᴀᴛ ғʀᴏᴍ ᴅᴇᴠᴀsᴛᴀᴛɪᴏɴ. ᴛᴏ ᴜɴɪᴛᴇ ᴀʟʟ sᴘᴀᴍᴍᴇʀs ᴡɪᴛʜɪɴ ᴏᴜʀ ɴᴀᴛɪᴏɴ. ᴛᴏ ᴅᴇɴᴏᴜɴᴄᴇ ᴛʜᴇ ᴇᴠɪʟ ᴏғ Tʀᴜᴍᴘ Hillary Clinton ᴀɴᴅ ᴍᴏᴅs. ᴛᴏ ᴇxᴛᴇɴᴅ ᴏᴜʀ sᴘᴀᴍ ᴛᴏ ᴛʜᴇ sᴛᴀʀs ᴀʙᴏᴠᴇ. ᴄᴏᴘʏ! ᴘᴀsᴛᴇ! ᴄʜᴀᴛ sᴘᴀᴍ ʙʟᴀsᴛ ᴏғғ ᴀᴛ ᴛʜᴇ sᴘᴇᴇᴅ ᴏғ ʟɪɢʜᴛ! sᴜʀʀᴇɴᴅᴇʀ ᴍᴏᴅs ᴏʀ ᴘʀᴇᴘᴀʀᴇ ᴛᴏ ғɪɢʜᴛ.
Image
Image
Image

User avatar
Edgelord
Donor
Donor
Posts: 830
Joined: 21 Jul 2015, 12:52
Byond: Edgelord

Re: Color Coded Autoinjectors

Post by Edgelord » 05 Dec 2015, 13:20

+1 would make for faster and more efficient medical work
Dayton 'Day' Mann
"That wiggling sensation you feel in your ass is Weyland-Yutani's fingers working you like a puppet."
Image

User avatar
Releasing
Registered user
Posts: 124
Joined: 16 Aug 2015, 04:44
Byond: Releasing

Re: Color Coded Autoinjectors

Post by Releasing » 05 Dec 2015, 14:07

+1, for reasons above. I've memorized where most of the autoinjectors already are in the Combat Lifesaver Bag, but it'd be definitely be easier to have them color-coded.
Melissa Wright. Mel, for short.

Jessie 'Jester' Streeter says, "Throw our hands in the air go, EYYY-YOOO, I THINK I'M GOING LES-BOOOO"
OOC: Freemysoul: DEAD: Terry 'Oddball' Shrapnel says, "Melissa wright hasn't even discovered fire yet and the brass gives her a rifle"

Image
pls no
Image

Wickedtemp
Registered user
Posts: 603
Joined: 10 Aug 2015, 22:14

Re: Color Coded Autoinjectors

Post by Wickedtemp » 05 Dec 2015, 14:15

Dexalin Plus = Blue
Kelotane/Deramline = Orange
Bicaridine = Red
Tricordrazine = Purple
Oxy = Black

Also I'd appreciate giving different colors to the substances when they're made in liquid form, instead of everything being the same light pink.

User avatar
Azmodan412
Registered user
Posts: 1318
Joined: 01 Oct 2015, 23:17
Location: The Void

Re: Color Coded Autoinjectors

Post by Azmodan412 » 05 Dec 2015, 15:22

Wickedtemp wrote:Dexalin Plus = Blue
Kelotane/Deramline = Orange
Bicaridine = Red
Tricordrazine = Purple
Oxy = Black

Also I'd appreciate giving different colors to the substances when they're made in liquid form, instead of everything being the same light pink.
Forgetting Quick-Clot
Image

Tyler 'Thrift' Borealis: Slaughterer of stupid xenos, insane motherfucker, and who played tower defense with Predators with an axe.
Predator Duels Won: 1
Predator Duels Lost: 2

BRING IT ON CASANY! I DO NOT CAST DOWN A CHALLENGE!
43 Xenos and counting.

Hunter Games: I am Moon Moon! Destroyer of worlds! Ahuhuhuhuhuhuhuhu!
Moon Moon Victories: x1

Wickedtemp
Registered user
Posts: 603
Joined: 10 Aug 2015, 22:14

Re: Color Coded Autoinjectors

Post by Wickedtemp » 05 Dec 2015, 16:30

Azmodan412 wrote: Forgetting Quick-Clot = White and Dylovene = Green

User avatar
HalfdeadKiller
Registered user
Posts: 468
Joined: 15 Oct 2014, 13:17

Re: Color Coded Autoinjectors

Post by HalfdeadKiller » 07 Dec 2015, 11:53

Update: Attatched a .zip to the original post containing some sprites for colored auto-injectors. Should be simply to edit the existing code to use those, instead of the default ones.

Tricord is the default autoinjector, since that is what autoinjectors have by default.
Oxycodone is a black-ish grey
QuickClot is pink
Bicardine is Red
Kelotane is Orange/yellow
Dylovene is Green
Dexaline is Blue

User avatar
apophis775
Host
Host
Posts: 6985
Joined: 22 Aug 2014, 18:05
Location: Ice Colony
Byond: Apophis775
Contact:

Re: Color Coded Autoinjectors

Post by apophis775 » 07 Dec 2015, 17:17

Won't work.
Reason being, they have 2 icon states, and all the code over-laps. I'd have to change how to altered the icon states, and the names of every single icon state for autoinjectors.

User avatar
HalfdeadKiller
Registered user
Posts: 468
Joined: 15 Oct 2014, 13:17

Re: Color Coded Autoinjectors

Post by HalfdeadKiller » 07 Dec 2015, 17:57

I made the adjustments on my local server. I have working colored auto-injectors. Could you elaborate more on why it won't work? Because editing the code in hypospray.dm seemed like the most you'd have to do. I could be wrong, my coding skills are pretty horrid.

The commented bits inside the /obj/ code, are what they originally had. I don't quite understand why they made it append 1 or 0 to the end of autoinjector. Simply telling it to point to the specific icon state (autoinjector5). I basically got rid of the code that added a 1 or a 0 for the new autoinjectors, since that seemed to be the most reliable way of adding colored autoinjectors.

Code: Select all

///////////////////////
//Color Autoinjectors//
///////////////////////

//Dylovene

/obj/item/weapon/reagent_containers/hypospray/autoinjectordylovene
	name = "Dylovene Autoinjector"
	desc = "A rapid and safe way to administer small amounts of drugs by untrained or trained personnel."
	//icon_state = "autoinjector"
	icon_state = "autoinjector5"
	//item_state = "autoinjector"
	item_state = "autoinjector5"
	amount_per_transfer_from_this = 5
	volume = 5

/obj/item/weapon/reagent_containers/hypospray/autoinjectordylovene/New()
	..()
	reagents.add_reagent("dylovene", 5)
	update_icon()
	return

/obj/item/weapon/reagent_containers/hypospray/autoinjectordylovene/attack(mob/M as mob, mob/user as mob)
	..()
	if(reagents.total_volume <= 0) //Prevents autoinjectors to be refilled.
		flags &= ~OPENCONTAINER
	update_icon()
	return

/obj/item/weapon/reagent_containers/hypospray/autoinjectordylovene/update_icon()
	if(reagents.total_volume > 0)
		//icon_state = "[initial(icon_state)]1"
		icon_state = "autoinjector5"
	else
		//icon_state = "[initial(icon_state)]0"
		icon_state = "autoinjector0"

/obj/item/weapon/reagent_containers/hypospray/autoinjectordylovene/examine(mob/user)
	..(user)
	if(reagents && reagents.reagent_list.len)
		user << "<span class='notice'>It is currently loaded.</span>"
	else
		user << "<span class='notice'>It is spent.</span>"
Edit: Searched for autoinjector over all files in my Baystation source, didn't seem like you'd have to edit any of those. That was just for medkits and such. The only codenames you might have to edit would be the medical vending machines and such that hold it.

User avatar
apophis775
Host
Host
Posts: 6985
Joined: 22 Aug 2014, 18:05
Location: Ice Colony
Byond: Apophis775
Contact:

Re: Color Coded Autoinjectors

Post by apophis775 » 07 Dec 2015, 18:56

First, part of the problem your having, is that your making the injectors wrong.

It should be:

obj/item/weapon/reagent_containers/hypospray/autoinjector/dylovene because the auto injectors should inherit everything from /autoinjector/.

What you have here, is it using the "custom" colored auto injector at first, then after it's used, reverting the color back to the original (the 0 state, is the base state of the auto injector with the needle sticking out).

IF you use the auto injector, it probably won't revert properly.

Again though, this code would be fairly inefficient, since you can just inherit the update_icon, Attackby, Examine, etc proc from auto injector.

User avatar
UnknownMurder
Registered user
Posts: 2243
Joined: 15 Dec 2014, 08:03
Location: Ascension

Re: Color Coded Autoinjectors

Post by UnknownMurder » 07 Dec 2015, 19:55

apophis775 wrote: Again though, this code would be fairly inefficient, since you can just inherit the update_icon, Attackby, Examine, etc proc from auto injector.
Or, are you able to 'overwrite'?
Image

User avatar
HalfdeadKiller
Registered user
Posts: 468
Joined: 15 Oct 2014, 13:17

Re: Color Coded Autoinjectors

Post by HalfdeadKiller » 07 Dec 2015, 20:26

This code has functional sprites, but... seems to have some issues with getting the dylovene in. Still playing with it.

Edit: Yeah, I got no idea why the dylovene isn't inside the autoinjector.

Edit2: I have absolutely no idea what I'm doing.

Code: Select all

//Dylovene

/obj/item/weapon/reagent_containers/hypospray/autoinjector/dylovene
	name = "Dylovene Autoinjector"

/obj/item/weapon/reagent_containers/hypospray/autoinjector/dylovene/New()
	..()
	reagents.add_reagent("anti_toxin", 5)
	update_icon()
	return
	
/obj/item/weapon/reagent_containers/hypospray/autoinjector/dylovene/update_icon()
	if(reagents.total_volume > 0)
		icon_state = "[initial(icon_state)]5"
	else
		icon_state = "[initial(icon_state)]0"

Anewbe
Registered user
Posts: 24
Joined: 03 Dec 2015, 23:01

Re: Color Coded Autoinjectors

Post by Anewbe » 07 Dec 2015, 21:09

If this can be done, it would earn all of my +1, just played Field Medic and spent more time figuring out which injector was which drug than I did actually treating people. Could be an instance of "git gud", but I sorta doubt it.

User avatar
HalfdeadKiller
Registered user
Posts: 468
Joined: 15 Oct 2014, 13:17

Re: Color Coded Autoinjectors

Post by HalfdeadKiller » 07 Dec 2015, 21:18

Its possible, its just a matter of do you want the code to be efficient, or do you want it to work? My post with the code earlier works flawlessly, however it isn't efficient. The code in the post above, is efficient, but I can't make it hold any other chemical besides inaprovaline for some reason.

User avatar
Arachnidnexus
Donor
Donor
Posts: 449
Joined: 04 Sep 2015, 20:50

Re: Color Coded Autoinjectors

Post by Arachnidnexus » 07 Dec 2015, 21:40

Is it possibly because in the base autoinjector it adds inaprovaline when a new injector is created?

User avatar
apophis775
Host
Host
Posts: 6985
Joined: 22 Aug 2014, 18:05
Location: Ice Colony
Byond: Apophis775
Contact:

Re: Color Coded Autoinjectors

Post by apophis775 » 08 Dec 2015, 21:04

Arachnidnexus wrote:Is it possibly because in the base autoinjector it adds inaprovaline when a new injector is created?

This. Remember, your trying to use bay code, and "hope" it works with ours. I rewrote most of the auto-injector system when I added more.

Here's a quick sample of how they work right now:

Code: Select all

/obj/item/weapon/reagent_containers/hypospray/autoinjector/quickclot
	name = "Quick Clot"
	desc = "An Auto-injector loaded with Quick-clot, a chemical designed to stop internal bleeding instantly."
	amount_per_transfer_from_this = 5
	volume = 5

	New()
		..()
		spawn(1)
			reagents.add_reagent("quickclot", 5)
			update_icon()
		return
Additionally the base /obj/item/weapon/reagent_containers/hypospray/New() and /obj/item/weapon/reagent_containers/hypospray/autoinjector/New() is actually commented out so that it doesn't inherit the code that fills them to begin with. If you were to spawn /obj/item/weapon/reagent_containers/hypospray/autoinjector/ by itself, you'd get an empty autoinjector.

At the same time, whereas you have update_icon() as a unique updated proc each time, we use a single update_icon() proc that is inherited from /obj/item/weapon/reagent_containers/hypospray/autoinjector/

I "could" color-code the autoinjectors, but I'd need color-coded state0 and state1 for each, then I'd have to add code to the update_icon() proc. It's not impossible, but like I said, I'd have to come up with new icon states for each autoinjector. Things like Dyloinjector1 dyloinjector0 , QuickClot1 QuickClock0 etc. The method you proposed would be WAY TOO inefficient. There's no reason for new update_icon() procs for each individual everything.

User avatar
HalfdeadKiller
Registered user
Posts: 468
Joined: 15 Oct 2014, 13:17

Re: Color Coded Autoinjectors

Post by HalfdeadKiller » 08 Dec 2015, 23:10

Why not make them default to the default state0 when spent, and tell the autoinjectors to use the color coded state1's when not spent? And I have a zip up there with some color coded autoinjector samples if you need those. You'd just have to import and rename to fit with your code.

User avatar
apophis775
Host
Host
Posts: 6985
Joined: 22 Aug 2014, 18:05
Location: Ice Colony
Byond: Apophis775
Contact:

Re: Color Coded Autoinjectors

Post by apophis775 » 08 Dec 2015, 23:30

So it loses the color-coding after it's used?

User avatar
HalfdeadKiller
Registered user
Posts: 468
Joined: 15 Oct 2014, 13:17

Re: Color Coded Autoinjectors

Post by HalfdeadKiller » 08 Dec 2015, 23:40

Yes. No point in keeping the color coding once it's spent. You can't refill autoinjectors after using them.

User avatar
apophis775
Host
Host
Posts: 6985
Joined: 22 Aug 2014, 18:05
Location: Ice Colony
Byond: Apophis775
Contact:

Re: Color Coded Autoinjectors

Post by apophis775 » 09 Dec 2015, 03:47

i'll look into it then. Accepted.

User avatar
dylanstrategie
Registered user
Posts: 201
Joined: 20 Jul 2016, 16:20

Re: Color Coded Autoinjectors

Post by dylanstrategie » 19 Nov 2016, 12:19

Internal tracking shows this as completed, autoinjecters have new sprites now

Locked