In response to Garthor
When i do:: var/obj/O = new equipped["overalls"]()
I get a compile error saying invalid expression.

When i do:: var/obj/O = new equipped["overalls"]
I get runtime error: Cannot create objects of type /list.

(Thats without moving onto blend etc since no point trying those if without colour is failing)
In response to Midgetbuster
Whooops, sorry, forgot BYOND is a bit inflexible here. It should be:

var/overalls_type = equipped["overalls"]
var/obj/O = new overalls_type()
In response to Garthor
I didnt wanna re bump this. but since my attempts to contact you have failed so far ill just do a delete on my previous post and add a new one to bump this up.

Anyways. ive got it adding the stuff sorta how i want them to but its not exactly going how i really want it to.. mainly because the layers arnt kicking in.

So ill post some code snips here. and hope someone responds as i do not wish to open up a new topic for this.

Info: This is the overlay building as it stands currently i have yet to add in sections for pants etc as i dont have those ingame yet.
mob/proc/Overlay_Build()
var/L[0]
var/hair = hair_types[type_hair || "bald"] + colour_hair
var/eye = 'Eyes_Base.dmi' + colour_eye
L += hair
L += eye



if(equipped["head"]) L += equipped["head"]
if(equipped["heada1"]) L += equipped["heada1"]
if(equipped["heada2"]) L += equipped["heada2"]

if(equipped["pants"]) L += equipped["pants"]
if(equipped["overalls"])// L += equipped["overalls"]
var/ov1 = equipped["overalls"]
var/obj/ov2 = new ov1()
ov2.layer = LAYER_OVERALLS
var/icon/ov3 = ov2.icon + equipped["overallsc"]
L += ov3

if(equipped["shoes"]) L += equipped["shoes"]
if(equipped["special"]) L += equipped["special"]
if(equipped["weapon"]) L += equipped["weapon"]

if(equipped["shirt"]) // L += equipped["shirt"]
var/sh1 = equipped["shirt"]
var/obj/sh2 = new sh1()
sh2.layer = LAYER_SHIRTS //i tried this for both but its a no go.
var/icon/sh3 = sh2.icon + equipped["shirtc"]
L += sh3

src.overlays = L



Info:Other bits that may be deemed necessary
//The layers.
var/const
LAYER_WEAPON = FLOAT_LAYER-1
LAYER_HEAD = FLOAT_LAYER-2
LAYER_HEADA1 = FLOAT_LAYER-3
LAYER_HEADA2 = FLOAT_LAYER-4
LAYER_OVERALLS = FLOAT_LAYER-5
LAYER_PANTS = FLOAT_LAYER-6
LAYER_SHIRTS = FLOAT_LAYER-7
LAYER_GLOVES = FLOAT_LAYER-8
LAYER_SHOES = FLOAT_LAYER-9
//The objects themselfs.
items
proc/Customizep()
src.colour = input("Choose a custom colour for your item.)","Item Customization") as color
Clothing
pants

shirts
testshirt
icon = 'CShirt_Lightning.dmi'
icon_state = "invent"
islot = "shirt"
refe = /obj/iconholders/shirts/testshirt
code = 3
rarity = "Common"
verb/Customize()//This is only a test verb so that i can add colours for testing.
src.Customizep()
overalls
Suit
icon = 'SuitBlack.dmi'
icon_state = "invent"
islot = "overalls"
refe = /obj/iconholders/overalls/suit //this links to the relating icon.
code = 1
rarity = "Common"

//Holders.
obj/iconholders
weapons
layer = LAYER_WEAPON
hidan
icon = 'Icons/Weapons/Hidansscythe.dmi'

shirts
layer = LAYER_SHIRTS
testshirt
icon = 'CShirt_Lightning.dmi'

overalls
layer = LAYER_OVERALLS
suit
icon = 'SuitBlack.dmi'

//and for reference sake. a copy of my save file.
///
///
Slot1 = object(".0")
.0
type = /mob/human/player
savefile_version = 1
Affinity = "Rain"
stamina = 50
type_hair = "testhair"
type_base = "medium"
equipment = list("overalls" = object(".0"))
.0
type = /items/Clothing/overalls/Suit
suffix = "1"
equipped = list("shirt" = 0,"shirtc" = "#000000","overalls" = /obj/iconholders/overalls/suit,"overallsc" = "#000000","weapon" = 0,"weaponc" = "#000000")
slot = 1
created = 1
name = "Tester"
dir = 1
contents = list(object(".0"),object("../equipment/.0"),object(".1"))
.0
type = /items/Clothing/shirts/testshirt
suffix = "1"
.1
type = /items/Weapons/Scythe/Hidan
suffix = "1"
key = "Midgetbuster"
SavedX = 14
SavedY = 13
SavedZ = 2


I think i posted the needed bits of code for both sections. In any case without the layering the list defined as L in the olay builder just jabs them in depending on how there added which is common sense basically but i need it to add them by layers so that the clothing and whatnot get added to the right positions.

As it stands they go over the hair and cut it off and the weapon stays under the clothing to. which is all wrong.

Hope someone responds so i don't have to make a new topic :(
In response to Midgetbuster
That is because icon objects do not have a layer attribute. You need to add some other type of object which does.
In response to Garthor
So how would i go about doing that then?
In response to Midgetbuster
By giving the icon back to the obj you already created.
In response to Garthor
arr touche.

Thanks.

mob/proc/Overlay_Build()
var/L[0]
var/hair = hair_types[type_hair || "bald"] + colour_hair
var/eye = 'Eyes_Base.dmi' + colour_eye
L += hair
L += eye



if(equipped["head"]) L += equipped["head"]
if(equipped["heada1"]) L += equipped["heada1"]
if(equipped["heada2"]) L += equipped["heada2"]

if(equipped["pants"]) L += equipped["pants"]
if(equipped["overalls"])// L += equipped["overalls"]
var/ov1 = equipped["overalls"]
var/obj/ov2 = new ov1()
var/icon/ov3 = ov2.icon + equipped["overallsc"]
ov2.icon = ov3

L += ov2

if(equipped["shoes"]) L += equipped["shoes"]
if(equipped["special"]) L += equipped["special"]
if(equipped["weapon"]) L += equipped["weapon"]

if(equipped["shirt"]) // L += equipped["shirt"]
var/sh1 = equipped["shirt"]
var/obj/sh2 = new sh1()
var/icon/sh3 = sh2.icon + equipped["shirtc"]
sh2.icon = sh3
L += sh2

src.overlays = L


i presume thats right since its doing what i want it to
In response to Midgetbuster
In response to Darkjohn66
Arr. enlightening thread indeed.

But also note i also posted saying i presume with the code as is. incurring a semi sort of if its wrong inform me kind of thing.

but indeed.
Page: 1 2