diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 908102b8a06..ab31fabe9f2 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -299,11 +299,11 @@ var/list/ai_verbs_default = list( for(var/i = 1 to Entry.len) Entry[i] = trim(Entry[i]) - if(Entry.len < 2) - continue + if(Entry.len < 3 || Entry[1] != "ai") //ignore incorrectly formatted entries or entries that aren't marked for AI + continue; - if(Entry.len < 3 && Entry[1] == ckey && Entry[2] == real_name) - custom_sprite = 1 //They're in the list? Custom sprite time + if(Entry[2] == ckey && Entry[3] == real_name) //They're in the list? Custom sprite time, var and icon change required + custom_sprite = 1 icon = 'icons/mob/custom-synthetic.dmi' @@ -859,10 +859,10 @@ var/list/ai_verbs_default = list( for(var/i = 1 to Entry.len) Entry[i] = trim(Entry[i]) - if(Entry.len < 3) + if(Entry.len < 3 || Entry[1] != "hologram") continue - if (Entry[1] == ckey && Entry[2] == real_name && Entry[3] == "Hologram") //Custom holograms + if (Entry[2] == ckey && Entry[3] == real_name) //Custom holograms custom_hologram = 1 // option is given in hologram menu var/input diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 125eb110c66..959f7bbbd22 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -81,6 +81,7 @@ var/translator_on = 0 // keeps track of the translator module var/current_pda_messaging = null + var/custom_sprite = 0 /mob/living/silicon/pai/New(var/obj/item/device/paicard) loc = paicard @@ -396,15 +397,38 @@ var/choice var/finalized = "No" - while(finalized == "No" && client) - choice = input(usr,"What would you like to use for your mobile chassis icon? This decision can only be made once.") as null|anything in possible_chassis - if(!choice) return + //check for custom_sprite + if(!custom_sprite) + var/file = file2text("config/custom_sprites.txt") + var/lines = splittext(file, "\n") - icon_state = possible_chassis[choice] - finalized = alert("Look at your sprite. Is this what you wish to use?",,"No","Yes") + for(var/line in lines) + // split & clean up + var/list/Entry = splittext(line, ":") + for(var/i = 1 to Entry.len) + Entry[i] = trim(Entry[i]) - chassis = possible_chassis[choice] + if(Entry.len < 3 || Entry[1] != "pai") //ignore incorrectly formatted entries or entries that aren't marked for pAI + continue; + + if(Entry[2] == ckey && Entry[3] == real_name) //They're in the list? Custom sprite time, var and icon change required + custom_sprite = 1 + icon = 'icons/mob/custom-synthetic.dmi' + + if(custom_sprite) + chassis = "[ckey]-pai" + icon_state = "[ckey]-pai" + else + while(finalized == "No" && client) + + choice = input(usr,"What would you like to use for your mobile chassis icon? This decision can only be made once.") as null|anything in possible_chassis + if(!choice) return + + icon_state = possible_chassis[choice] + finalized = alert("Look at your sprite. Is this what you wish to use?",,"No","Yes") + + chassis = possible_chassis[choice] verbs -= /mob/living/silicon/pai/proc/choose_chassis /mob/living/silicon/pai/proc/choose_verbs() @@ -569,8 +593,15 @@ if(resting) icon_state = "[chassis]" resting = 0 - H.icon_state = "pai-[icon_state]" - H.item_state = "pai-[icon_state]" + if(custom_sprite) + H.icon_override = 'icons/mob/custom-synthetic.dmi' + H.lefthand_file = 'icons/mob/custom-synthetic.dmi' //unless we want to make a new file for the left and right in-hands for custom pAIs... + H.righthand_file = 'icons/mob/custom-synthetic.dmi' //you'll want to just use one in-hand sprite that looks the same in both hands. --FalseIncarnate + H.icon_state = "[icon_state]_head" + H.item_state = "[icon_state]_hand" + else + H.icon_state = "pai-[icon_state]" + H.item_state = "pai-[icon_state]" grabber.put_in_active_hand(H)//for some reason unless i call this it dosen't work grabber.update_inv_l_hand() grabber.update_inv_r_hand() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 8ca615ae9b0..33b6719e82d 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -180,14 +180,14 @@ var/list/robot_verbs_default = list( for(var/line in lines) // split & clean up - var/list/Entry = splittext(line, ";") + var/list/Entry = splittext(line, ":") for(var/i = 1 to Entry.len) Entry[i] = trim(Entry[i]) - if(Entry.len < 2) + if(Entry.len < 3 || Entry[1] != "cyborg") //ignore incorrectly formatted entries or entries that aren't marked for cyborg continue; - if(Entry[1] == src.ckey && Entry[2] == src.real_name) //They're in the list? Custom sprite time, var and icon change required + if(Entry[2] == ckey && Entry[3] == real_name) //They're in the list? Custom sprite time, var and icon change required custom_sprite = 1 icon = 'icons/mob/custom-synthetic.dmi' diff --git a/config/example/custom_sprites.txt b/config/example/custom_sprites.txt index db3930a4ae2..57969ba1a59 100644 --- a/config/example/custom_sprites.txt +++ b/config/example/custom_sprites.txt @@ -1 +1,6 @@ -ckey-state \ No newline at end of file +Each entry should be composed of 3 parts, each divided by a colon (:) with no spaces, in order to work. Failure to do so will result in that entry being disregarded by the code. +- The first part should be either "cyborg", "ai", "hologram", or "pai". This tells the code what type of custom sprite this entry is for. The "ai" option is for AI core displays, while "hologram" is for AI hologram projections. +- The second part should be the ckey of the player this entry is for. This tells the code who it works for and also is used to retrieve the proper sprite for them to use. +- The third part should be the "real name" of the character this entry is for. This is the name of the borg, AI, or pAI personality (not the player's real name!), because they can only use the sprite on that specific character name. + +example:example:example \ No newline at end of file diff --git a/icons/mob/custom-synthetic.dmi b/icons/mob/custom-synthetic.dmi index 0434efd900f..ec9a2b424d8 100644 Binary files a/icons/mob/custom-synthetic.dmi and b/icons/mob/custom-synthetic.dmi differ