Basic Structure:
A character class to handle "body specific" information like skin color, haircut, hair color etc, and an "inventory" that contains every clothing item the char is wearing.
Code: Select all
class PCstats(renpy.store.object):
def __init__(self, name):
self.name=name
self.haircut="short"
self.haircolor="white"
self.skin="pale"
self.lipstick="nude"
self.wearing=[]
def remove(self,clothes):
if clothes in self.wearing:
self.wearing.remove(clothes)
return
def wear(self,clothes):
self.wearing.append(clothes)
return
def remove_all(self):
list = [item for item in self.wearing if item.can_strip]
if list!=[]:
for item in list:
self.wearing.remove(item)
return
A "clothing" class, that contains the name of the object, the path to the .png file, and it's drawing priority in compositing, so that you can add clothing in any order, and the vest will still draw over the t-shirt, etc...
Code: Select all
class clothing(renpy.store.object):
def __init__(self, name,pic,priority=10,can_strip=True):
self.name=name
self.pic=pic
self.priority=priority
self.can_strip=can_strip
For facial expression, eyes and mouth are stored separetly in transparent layers :
e.g. " eyes_angry_look right" or "mouth_smile" etc...
We can now define char image with associated tags:
Code: Select all
$ seraphim = PCstats("Seraphim")
image seraphim normal = DynamicDisplayable(draw_clothing,character=seraphim,art_path="seraphim/seraphim",mouth="normal",eyes="normal_straight")
image seraphim angry = DynamicDisplayable(draw_clothing,character=seraphim,art_path="seraphim/seraphim",mouth="grit",eyes="angry_straight")
image seraphim angry blushing = DynamicDisplayable(draw_clothing,character=seraphim,art_path="seraphim/seraphim",mouth="grit",eyes="angry_straight",blushing="light")
image side seraphim normal = LiveCrop((102,41,150,150),"seraphim normal")
image side seraphim angry = LiveCrop((102,41,150,150),"seraphim angry")
image side seraphim angry blushing = LiveCrop((102,41,150,150),"seraphim angry blushing")
define ser = Character(seraphim.name, color="#c8ffc8",image="seraphim",window_left_padding=150)
- During your story, player and NPCs can "get a tan" , dye their hair, by simply changing a property
- Defining clothes as independent items allows for layering and transparency effects
- You can make some clothing items unlockable/buyable by mixing this system with a classic shop/inventory
- Face expressions are not tied to clothing.
Here's a full code with some art assets and exemple of use: Hope it can be useful to someone
PS: The art assets are on the "skimpy" side, sorry...
edit: some people had trouble with the RAR archive, here's a zip.