make character creation ask what color I want something by allowing RGB? I have a single object I want to be able to be colored with RGB, but when I use the kind of thing which allows for multiple choices, the RGB thing never pops up... I'm trying to test my game quickly with only 1 hair style and I'll have problems later if I don't figure this out for a different thing... here is my code
help_text = "What sex is your character?"
var/list/races = list("Male","Female")
var/char_race = input(src, help_text, prompt_title, default_value) in races
var/mob/new_mob
switch(char_race)
if("Male")
new_mob = new /mob/player/student/boy
new_mob.loc = locate(17,2,1)
switch(input("What hair style do you want?", "Customization", text) in list ("Short1"))
if("Short1")
new_mob.hair = "Short1"
var/hairred = input("How much red do you want to put into your hair? (255 is the brightest and 0 is the darkest.)") as num
var/hairblue = input("How much blue do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)")as num
var/hairgreen = input("How much green do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)") as num
var/hairover = 'male hair.dmi'
hairover += rgb(hairred,hairgreen,hairblue)
new_mob.rhair = hairred
new_mob.ghair = hairgreen
new_mob.bhair = hairblue
new_mob.overlays += hairover
world << "[char_name] has just entered '[world.name]'!"
src.client.mob = new_mob
if("Female")
new_mob = new /mob/player/student/girl
new_mob.loc = locate(17,2,1)
switch(input("What hair style do you want?", "Customization", text) in list ("Female Long"))
if("Female Long")
new_mob.hair = "Female Long"
var/hairred = input("How much red do you want to put into your hair? (255 is the brightest and 0 is the darkest.)") as num
var/hairblue = input("How much blue do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)")as num
var/hairgreen = input("How much green do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)") as num
var/hairover = 'female hair.dmi'
hairover += rgb(hairred,hairgreen,hairblue)
new_mob.rhair = hairred
new_mob.ghair = hairgreen
new_mob.bhair = hairblue
new_mob.overlays += hairover
world << "[char_name] has just entered '[world.name]'!"
src.client.mob = new_mob
new_mob.oicon = new_mob.icon
new_mob.name = char_name
src.client.mob = new_mob
var/turf/first_location = locate(21,9,1)
new_mob.loc = first_location
del(src)
tabs might be off on here, but I get no errors, so I assume they are fine... not sure though
1
2
ID:175293
May 12 2003, 11:59 am (Edited on May 12 2003, 2:42 pm)
|
|
In response to Lummox JR
|
|
ok... I have no idea what you said, and whatever you did, that did not answer my question... I asked why it never asked for the rgb nor added the hair icon... can you answer that please? what did I do wrong?
|
In response to Blueseed15
|
|
I figured out this much for sure from what you said, it definatly does not answer anything that I asked
|
someone please answer me with a answer to my question and not stuff that has nothing to do with what I'm asking like Lummox... I'm doing things the way I want them to be, so I don't need an alternative way, espically when the alternative wouldn't fix the problem i'm having.
|
First thing: You're using Zeta coding. Thats against the law, and it doesn't help you with coding at all. Second thing: use this to replace the usr.hairover part:
usr.hair += rgb(hairred,hairgreen,hairblue) I think i might have some of those variables wrong, but yuo should be able to figure out how to change them. |
In response to Draks
|
|
OK, it asks for the colors now... but the hair isn't added... and the login and saving code is the main part of Zeta coding I'm using since it seems to be the best login and saving system... which variables do you think are wrong?
|
In response to Blueseed15
|
|
Im not sure why that wouldnt work.. heres some code from my game:
new_mob.hair = "long" And NO that's not Zeta. My variables were just changed (by me) for your code. |
In response to Draks
|
|
I don't see much of a difference... but here is my variable code... see if you can see a problem with this:
atom/movable var oicon npc = 0 hair rhair = 0 ghair = 0 bhair = 0 |
In response to Blueseed15
|
|
After much staring and pulling hair out of my head i realized that (I told this to some one else 5 minutes ago,so there goes another clump of hair) DM hates icon names with spaces in them so much, that it refuses to use them. So change the icon names so they have no spaces.
|
In response to Draks
|
|
ahh... ok... just one question... is there a way to make it where you have many overlays on one file? if there isn't, it doesn't matter, but I want to know if there is.
|
In response to Blueseed15
|
|
Yep, you just do the samething you did before:
usr.overlays += //bl bla bla |
In response to Draks
|
|
I just retested... still no luck with hair appearing
|
In response to Blueseed15
|
|
... geeze...
are you using my version of the code? Close out, and when it asks you if you want to save stuff, click yes for all of them. Then go back in. |
In response to Draks
|
|
didn't work... here is the full login code...
mob/Login() src.oicon = src.icon src.npc = 0 src << "" mob/Logout() world << "[usr] has left this world." client/var/tmp world name = "Warriors of the Elements" mob = /mob/other/creating_character view = 6 tick_lag = 2 loop_checks = 0 client/proc/SaveMob() var/firstletter=copytext(src.ckey, 1, 2) var/savefile/F = new("players/[firstletter]/[src.ckey].sav") var/char_ckey = cKey(src.mob.name) F["/[ckey]/[char_ckey]"]<<src.mob client/proc/LoadMob(char_ckey) var/firstletter=copytext(src.ckey, 1, 2) var/savefile/F = new("players/[firstletter]/[src.ckey].sav") F["/[ckey]/[char_ckey]"]>>src.mob client/Del() if (istype(src.mob, /mob/other/creating_character)) return ..() src.SaveMob() return ..() mob/other/creating_character Login() spawn() src.CreateCharacter() proc CreateCharacter() var/list/characters = src.CharacterList() var/newCharacterChoice = "New Character" var/DeleteCharacterChoice = "Delete Character" var/list/menu = new() menu += characters menu += newCharacterChoice menu += DeleteCharacterChoice var/result = input("Character Creation", "WoE") in menu if (result == newCharacterChoice) src.CreateNewCharacter() if (result == DeleteCharacterChoice) src.DeleteCharacter() src.CreateCharacter() else var/success = src.client.LoadMob(result) if (success) del(src) else alert("Try again") src.CreateCharacter() CharacterList() var/firstletter=copytext(src.ckey, 1, 2) var/savefile/F = new("players/[firstletter]/[src.ckey].sav") F.cd = "/[ckey]" var/list/characters = F.dir return characters DeleteCharacter() var/firstletter=copytext(src.ckey, 1, 2) var/savefile/F = new("players/[firstletter]/[src.ckey].sav") F.cd = "/[ckey]" var/list/characters = F.dir var/CancelCharacterDeletion = "Decline" var/list/menu = new() menu += characters menu += CancelCharacterDeletion var/result = input("Delete character", "Character Selection") in menu if (result) F.cd = "/[ckey]" F.dir.Remove(result) if (result == CancelCharacterDeletion) src.CreateCharacter() else src.CreateCharacter() mob/other/creating_character/proc CreateNewCharacter() var/prompt_title = "Character Creation" var/help_text = "What is your character's name?" var/default_value = "" var/char_name = input(src, help_text, prompt_title, default_value) as null|text if (!char_name) src.CreateCharacter() return var/ckey_name = ckey(char_name) var/list/characters = CharacterList() if (characters.Find(ckey_name)) alert("There is a player that has chosen that name already. Please choose another well thought of name.") src.CreateNewCharacter() return help_text = "What sex is your character?" var/list/races = list("Male","Female") var/char_race = input(src, help_text, prompt_title, default_value) in races var/mob/new_mob switch(char_race) if("Male") new_mob = new /mob/player/student/boy new_mob.loc = locate(17,2,1) switch(input("What hair style do you want?", "Customization", text) in list ("Short1")) if("Short1") new_mob.hair = "Short1" var/hairred = input("How much red do you want to put into your hair? (255 is the brightest and 0 is the darkest.)") as num var/hairblue = input("How much blue do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)")as num var/hairgreen = input("How much green do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)") as num var/hairover = 'mshorthair1.dmi' usr.hair += rgb(hairred,hairgreen,hairblue) new_mob.rhair = hairred new_mob.ghair = hairgreen new_mob.bhair = hairblue new_mob.overlays += hairover world << "[char_name] has just entered '[world.name]'!" src.client.mob = new_mob if("Female") new_mob = new /mob/player/student/girl new_mob.loc = locate(17,2,1) switch(input("What hair style do you want?", "Customization", text) in list ("Female Long")) if("Female Long") new_mob.hair = "Female Long" var/hairred = input("How much red do you want to put into your hair? (255 is the brightest and 0 is the darkest.)") as num var/hairblue = input("How much blue do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)")as num var/hairgreen = input("How much green do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)") as num var/hairover = 'flonghair1.dmi' hairover += rgb(hairred,hairgreen,hairblue) new_mob.rhair = hairred new_mob.ghair = hairgreen new_mob.bhair = hairblue new_mob.overlays += hairover world << "[char_name] has just entered '[world.name]'!" src.client.mob = new_mob new_mob.oicon = new_mob.icon new_mob.name = char_name src.client.mob = new_mob var/turf/first_location = locate(21,9,1) new_mob.loc = first_location del(src) mob/player student boy icon = 'baseicons.dmi' icon_state= "malebase" mob/player student girl icon = 'baseicons.dmi' icon_state= "femalebase" mob/Logout() del(src) mob Login() ..() if (!istype(src, /mob/other/creating_character)) sample_report() Write(savefile/F) ..() F["last_x"] << x F["last_y"] << y F["last_z"] << z Read(savefile/F) ..() var/last_x var/last_y var/last_z F["last_x"] >> last_x F["last_y"] >> last_y F["last_z"] >> last_z loc = locate(last_x, last_y, last_z) proc sample_report() |
In response to Blueseed15
|
|
Change the usr.hair to new_mob.hairover. I think that should work. I THINK.
|
In response to Draks
|
|
nope, not even when I added it to the variable list which I had to do to remove errors
|
In response to Blueseed15
|
|
.. you shouldnhave to add hairover to the variable list...
|
In response to Draks
|
|
I did... I don't know what could be wrong...
|
In response to Blueseed15
|
|
OK, I need someone else to try to fix this, or an alternative code, PLEASE help
|
1
2
Lummox JR