createHUD() for(var/BodyPart/A in src)

HudGroups += list("HudGroup_row1" = new/HudObject(client=src.client)) //This should be based on each limb, and not a single .dmi

var/HudObject/hudrow_1 = HudGroups["HudGroup_row1"]

hudrow_1.addObject(new/HudObject(hudrow_1, client=A,icon_state="Left Arm Healthy", screen_loc="1,1"))

//Using a test .dmi with all body parts in it, these should all reference the icons for each players bodyparts objs
hudrow_1.addObject(new/HudObject(hudrow_1, client=A,icon_state="Left Leg Healthy", screen_loc="1,1"))
hudrow_1.addObject(new/HudObject(hudrow_1, client=A,icon_state="Torso Healthy", screen_loc="1,1"))
hudrow_1.addObject(new/HudObject(hudrow_1, client=A,icon_state="Right Arm Healthy", screen_loc="1,1"))
hudrow_1.addObject(new/HudObject(hudrow_1, client=A,icon_state="Right Leg Healthy", screen_loc="1,1"))
hudrow_1.addObject(new/HudObject(hudrow_1, client=A,icon_state="Head Healthy", screen_loc="1,1"))
hudrow_1.addObject(new/HudObject(hudrow_1, client=A,icon_state="Throat Healthy", screen_loc="1,1"))
hudrow_1.addObject(new/HudObject(hudrow_1, client=A,icon_state="Eyes Healthy", screen_loc="1,1"))
hudrow_1.addObject(new/HudObject(hudrow_1, client=A,icon_state="Reproduction Healthy", screen_loc="1,1"))
hudrow_1.addObject(new/HudObject(hudrow_1, client=A,icon_state="Ears Healthy", screen_loc="1,1"))
hudrow_1.addObject(new/HudObject(hudrow_1, client=A,icon_state="Mouth Healthy", screen_loc="1,1"))

// hudrow_2.renderObjects()

Problem description:

So, I have the top, calling in the var/BodyPart/A in src in order to get all of the src's body parts to be able to be called.

I currently have the HUDObjects with temp icon states that was to prove design concept, but now I need to change it over to call the icon & icon state of each body type.

The bodyparts are named as such:


Any help would be greatly appreciated
So what exactly is the problem? Are you saying you do not know how to reference the objects individually to access their properties?

I don't think I'm following and your code is a bit confusing (it seems extra; over-complicated).
I'm trying to change my current code over from referencing a set icon and icon state, to directly referencing the icons that belong to the objects listed in the comments below the icon.

This is essentially a body status HUD system, that will show the body HUD on the player screen and the body parts will change color based on status of limb
I think I get you...

Why not create object types for your body parts and define their information there, as opposed to using a generic HudObject type?

icon = 'part1.dmi'
icon_state = "healthy"

Or, alternatively, could you not modify HudObject to be able to accept a different icon in the same way you are specifying an icon_state for them to use?
So, essentially the issue is this:

The icon and icon state are defined in a separate code file. I need to reference that code and have my HUD reflect what that code is doing.

I have something similar happening in a pop up window, but want it to work as a HUD and place all the icons on the same portion of the screen (And build the body essentially)

set category=null//"Other"
winclone(src, "InjurySheet", "Injuries")
//winset(src,"Activities","title=\"Languages Insight\"")
for(var/BodyPart/S in src)
src << output(S, "Injuries.GridIC:1,[Row]")
src << output("\[[round((S.Health/S.MaxHealth)*100,0.1)]%\] ([S.Status])", "Injuries.GridIC:2,[Row]")

That is what I am using to display the already defined icons and icon states. I'd like to reference this for the HUD
I'm pretty much trying to call the object as the icon
Or, alternatively, could you not modify HudObject to be able to accept a different icon in the same way you are specifying an icon_state for them to use?

What I said above should be a step in the right direction. If you want to avoid refactoring what you already have, then just reference the body part objects you are already using. It already looks like you are trying to do something like that already with the client=A line in the for() loop, but it looks incorrect (or the client argument is misleading in its name), albeit essentially what I'm suggesting.

obj/HUD for(var/BodyPart/Left_Arm/A in src)
icon = A
icon_state = Status

Is this what you're suggesting?
Status is the var that exist where the original object is defined
In response to FKI
The icon states defined are just placeholders, I want the icon states to come from what is pulled in the original objects
In response to FKI
I honestly just need to know how to properly call on the icon/icon state of another obj. That is my main bottleneck
Is this what you're suggesting?

No, not even close. That for() loop is very out of place too.

I honestly just need to know how to properly call on the icon/icon state of another obj.

Reference the object and use it the way you need to. For example, I usually have some sort of universal "update" proc for my HUD objects. If I were to do what you want using your requirements, I would have a unique HUD type where I override my "update" proc to grab the proper information using the body part object it references.
#define HEAD    1
#define TORSO 2
#define LEGS 3

// Defines are used for PART in edit.


parent_type = /obj; screen_loc = "1,1"
part{icon = 'paperdoll.dmi';New(L){layer=L}}
vis_contents = list(
vis_contents[PART]:icon_state = "[STATE]"

doll = new/paperdoll
edit(HEAD,"human head")
edit(TORSO,"panda torso")
edit(LEGS,"human legs")
// Creates a character from [paperdoll.dmi] with the icon states in order [Human head, Panda torso, Human legs]