ID:905703
 
(See the best response by DarkCampainger.)
Code:
//This is how my Characters are being handled
obj/Characters
var
Aura="Blue"
Race="Baby Panda"
list/Transes=list()
CustomCharacter

This is my Character Maker Code
mob/verb/CreateCharacter(var/T as text)
set hidden=1
var
obj/Characters/CustomCharacter/CustomCharacters=new/obj/Characters/CustomCharacter
list/TransesList=list()
icon/BaseIcon=null

switch(T)
if("Main")
var/icon/I=fcopy_rsc(input("Choose your character Form 2","Icon") as icon)
winset(src,"CustomCharacterWindow.Icon","text=\"[BaseIcon]")
CustomCharacters.icon=I

if("Form1")
var/icon/I=src.UploadIconProc()
usr<<I
TransesList+=cTrans(I,1000)
winset(src,"CustomCharacterWindow.Form 1","text=\"[I]")
winset(src,"CustomCharacterWindow.Form 2","is-disabled=false")


if("Form2")
var/I=input("Choose your character Form 2","Icon") as icon
TransesList+=cTrans(I,100000)
winset(src,"CustomCharacterWindow.Form 2","text=\"[I]")
winset(src,"CustomCharacterWindow.Form 3","is-disabled=false")

if("Form3")
var/I=input("Choose your character Form 3","Icon") as icon
TransesList+=cTrans(I,250000)
winset(src,"CustomCharacterWindow.Form 3","text=\"[I]")
winset(src,"CustomCharacterWindow.Form 4","is-disabled=false")

if("Form4")
var/I=input("Choose your character Form 4","Icon") as icon
TransesList+=cTrans(I,500000)
winset(src,"CustomCharacterWindow.Form 4","text=\"[I]")
winset(src,"CustomCharacterWindow.Form 5","is-disabled=false")

if("Form5")
var/I=input("Choose your character Form 5","Icon") as icon
TransesList+=cTrans(I,750000)
winset(src,"CustomCharacterWindow.Form 5","text=\"[I]")
winset(src,"CustomCharacterWindow.Form 6","is-disabled=false")
if("Form6")
var/I=input("Choose your character Form 6","Icon") as icon
TransesList+=cTrans(I,999999)
winset(src,"CustomCharacterWindow.Form 6","text=\"[I]")
if("Finish")
CustomCharacters.icon=BaseIcon
CustomCharacters.name=winget(src,"CustomCharacterWindow.NameInput","text")
CustomCharacters.Transes=TransesList
AllCharacters+=CustomCharacters


Problem description:Here is the problem when i try to set Character icon at runtime it just not set anything the icon stays the default just the name changes, can some one help me improve on this?

I'm assuming that the Form [number]'s are lables? look into winset(control, "image=[image];image-mode=[mode]")
In response to NNAAAAHH
NNAAAAHH wrote:
I'm assuming that the Form [number]'s are lables? look into winset(control, "image=[image];image-mode=[mode]")

They are lables but i am not trying to show the icon user upload instead just their icon. and the problem is not in Form[number] the problem is in Finish its not asinging any transformation/Icons
In response to Hassanjalil
I'm sorry, could you please provide more information on your issue? I do not understand what it is you're trying to say you have a problem with.
In response to NNAAAAHH
Here is what that code should do

1.)Main:Player Clicks on button and it popup the choose icon dialog to choose the main Character, then it updates the label with the icon name.
2.)Form [Number]: this allows player to choose tranformed icon for their character and then updates the label same as Main.

3.) And Finally Finish button which save the character with icon, Name, Transformations and add them to AllCharacter so players can select them.

Here is what happens
1 and 2 works fine but when it comes to finish
        if("Finish")
CustomCharacters.icon=BaseIcon
CustomCharacters.name=winget(src,"CustomCharacterWindow.NameInput","text")
CustomCharacters.Transes=TransesList
AllCharacters+=CustomCharacters
this code dont set character icon rest of it works
i am having the same problem i tried to created before but it appears that there is no one on byond who can help us?
Best response
You're storing everything in a scope local to the verb, meaning that all the data is lost at the end of each step, and recreated at the start of the next step. The only data you're able to recover is the name, because you're storing that within the label.

You need to temporarily store the data somewhere until the all of the steps are completed.
you mean something like datum? or an object?
Edit: ahh now i see what you mean since all the variables are defined under one verb and that is the same verb that resets the variables called each time i would have to either store on skin or on datum then attach that to the user, thankyou
datum/CustomCharacter
var
icon
Base
list/Transes=list()
mob/Owner
New(mob/m)
if(m) Owner=m

mob/var/tmp/datum/CustomCharacter/CustomCharacterD=null
mob/verb/CreateCharacter(var/T as text)
set hidden=1
if(!src.CustomCharacterD) src.CustomCharacterD=new/datum/CustomCharacter(src)
var
obj/Characters/CustomCharacter/CustomCharacters=new/obj/Characters/CustomCharacter
list/TransesList=list()
icon/BaseIcon=null
datum/CustomCharacter/CC=new

switch(T)
if("Main")
var/icon/I=fcopy_rsc(input("Choose your character Form 2","Icon") as icon)
winset(src,"CustomCharacterWindow.Icon","text=\"[I]")
src.CustomCharacterD.Base=I

if("Form1")
var/icon/I=src.UploadIconProc()
usr<<I
src.CustomCharacterD.Transes+=cTrans(I,1000)
winset(src,"CustomCharacterWindow.Form 1","text=\"[I]")
winset(src,"CustomCharacterWindow.Form 2","is-disabled=false")


if("Form2")
var/I=input("Choose your character Form 2","Icon") as icon
src.CustomCharacterD.Transes+=cTrans(I,100000)
winset(src,"CustomCharacterWindow.Form 2","text=\"[I]")
winset(src,"CustomCharacterWindow.Form 3","is-disabled=false")

if("Form3")
var/I=input("Choose your character Form 3","Icon") as icon
src.CustomCharacterD.Transes+=cTrans(I,250000)
winset(src,"CustomCharacterWindow.Form 3","text=\"[I]")
winset(src,"CustomCharacterWindow.Form 4","is-disabled=false")

if("Form4")
var/I=input("Choose your character Form 4","Icon") as icon
src.CustomCharacterD.Transes+=cTrans(I,500000)
winset(src,"CustomCharacterWindow.Form 4","text=\"[I]")
winset(src,"CustomCharacterWindow.Form 5","is-disabled=false")

if("Form5")
var/I=input("Choose your character Form 5","Icon") as icon
src.CustomCharacterD.Transes+=cTrans(I,750000)
winset(src,"CustomCharacterWindow.Form 5","text=\"[I]")
winset(src,"CustomCharacterWindow.Form 6","is-disabled=false")
if("Form6")
var/I=input("Choose your character Form 6","Icon") as icon
src.CustomCharacterD.Transes+=cTrans(I,999999)
winset(src,"CustomCharacterWindow.Form 6","text=\"[I]")
if("Finish")
CustomCharacters.icon=src.CustomCharacterD.Base
CustomCharacters.name=winget(src,"CustomCharacterWindow.NameInput","text")
CustomCharacters.Transes=src.CustomCharacterD.Transes
AllCharacters+=CustomCharacters

its not something what you would have done but still to thank you i have done it the best way i could and again thankyou it works, i totally forgot that whenever the verb i being called all the variables defined under that verb will be reset to its default setting.
In response to Lord Kakarot
Just a tip, you don't need to type out the datum part in "datum/CustomCharacter, simply specifying it as CustomCharacter and calling it like mob/var/tmp/CustomCharacter/etc works the same. Saves having to type the datum part.
you are right but i rather not being lazy and on top i like to keep things under one parent instead of 100 parents
In response to Hassanjalil
datum is the top-level ancestor of all datums and atoms. There's nothing lazy about doing this:
MyDatum
// ...

// and this:
datum/MyDatum
// ...

because there's absolutely no difference between them. The /datum parent is implied for /MyDatum, just like /mobs are actually of the type /datum/atom/movable/mob.