ID:270028
 
how do i make a shopkeeper that sells custom clothes...and when u buy it you put the input colours in...and when u wear it..its the colour what u put in...
Look up input() and rgb().
In response to DeathAwaitsU
One hint, I dunno if its the proper way, but ill give you an example i see done often.

obj
Shirt
icon = 'Thisisnotarealiconfile.dmi'
icon_state = "Thisisnotarealiconstateeitheryouimbecile"
verb/Add_Color()
var/R = input("How much red in the shirt ?") as num
if(R>255)
R = 255
var/G = input("How much Green in the shirt ?") as num
if(G>255)
G = 255
var/B = input("How much blue in the shirt ?") as num //input for blue
if(B>255)
B = 255
src.icon += rgb(R,G,B)//Add on to src.icon, src being the obj.

What this does is asks an input for a variable R, which will be your red. Same for G for Green, and B for blue. Makes sure there up to 255. Then, it adds on a value for rgb to the icon. rgb() makes the color value based on the three numbers given, first being Red, Green, and blue. This is why its red value is the R you defined earlier, ect.

Like I said Earlier, this is one way it has been done, though Im sure there may be other ways, and even better ways. Thats just an example.
In response to TKo38
..its not what im looking for...i want them to only change the color of the clothing once...when they buy it..think u can help ?
In response to Galahad the brave
dude, use input() to see what color they want, then rbg() to change it to that. and unless you give them the power to change it after that, they wont have it.
In response to Albire
...i know..but...when i code it in..it doesnt work...so im hoping for someone to give me an example
In response to Galahad the brave
We don't give out codes like that. People need to try first, otherwhise they just copy/paste and learn nothing.
They all said it. Look up input() and rgb(). And the example given above is quite useful, too.
In response to Mysame
....i have tried...thats why im asking for help..<_<
In response to Galahad the brave
You could also show us your 'tryed' code so we can tell you what you did wrong.
In response to Mysame

obj/clothes2
New()
. = ..()
screen_loc = "[midx],[midy]"

var/Value
var/Custom





BlackUnderclothing
icon = 'clothes-blackunder.dmi'
worn = 0
Value = 500
Custom = 1
Use(mob/M)
if(src.worn == 1)
src.worn = 0
usr.overlays -= 'clothes-blueunder.dmi'
suffix = ""
usr << "You remove the [src.name]."

else
src.worn = 1
usr.overlays += 'clothes-blueunder.dmi'
suffix += "{-Equiped-}"
usr << "You wear the [src.name]."











mob/Shopkeepers1
verb/Shop(mob/Shopkeepers1/M as mob in oview(2))
set src in oview(2)
set category = "Shop"
var/Display = {"<body bgcolor=Black>
<table border = "3" cellspacing = "1" cellpadding = "1">
<Caption><font color = White>Items for sale</Caption>"}
for(var/obj/clothes2/I in M.Sellingclothes2)

Display += {"
<tr><td align = "center"><font color = red>[I.name]</td>
<td align = "center"><font color = white>Cost: $[I.Value]</td>
<td align = "center">Buy</td>
</tr>"}
usr<< browse({"
[M.Welcome]



[Display]"})

mob/Shopkeepers1
icon = 'mobs.dmi'
icon_state = "store"

var
list/Sellingclothes2=new()
Welcome
ShopKeeper
Welcome = "Welcome to my shop!"
New()
for(var/NewItem in typesof(/obj/clothes2)-/obj/clothes2)
src.Sellingclothes2 += new NewItem
..()
mob/Topic(href,href_list[])
if(href_list["Item"])
var/ItemPath = "/obj/clothes2/[href_list["Item"]]"
var/obj/clothes2/NewItem = new ItemPath

if(src.zenni <= NewItem.Value)
usr << "You need more zenni!"

if(NewItem.Custom == 1)
NewItem.icon = NewItem
var/red = input("How much red (out of the RGB) ?| (0,0,0) = Black | (255,255,255) = White. |") as num|null
NewItem.icon += rgb((red),0,0)
var/blue = input("How much green (out of the RGB) ?| (0,0,0) = Black | (255,255,255) = White. |") as num|null
NewItem.icon += rgb(0,(blue),0)
var/green = input("How much blue (out of the RGB) ?| (0,0,0) = Black | (255,255,255) = White. |") as num|null
NewItem.icon += rgb(0,0,(green))


if(src.zenni >= NewItem.Value)
src.contents2 += NewItem
src << "You bought \an [href_list["Item"]]"
src.zenni -= NewItem.Value
In response to Galahad the brave
can anyone one help me with this code ?
In response to Galahad the brave
(About the "We dont put out codes like that", I learned that way by trial and error. When I was new, I studied an old Zeta code, and learned several ways of how coding worked. For instance, I saw how the RGBcolor value can be added on to icons, and also at that point I understood input, and seeing stufff like the example, I learned systems of how things could work, and could implement them differently.)

Wow that was a long sentence.

Anyways, we have your examples, and your procedures, if you do still need help, check them out and experiment. Thats all i can do for ya.