If I try to do this with an init statement:
Code: Select all
init -1 python:
class BaseCharacter():
def __init__(self, name, race, auraR, auraG, auraB, auratype, aurastrength)
self.name = name
self.race = race
self.auraR= auraR
self.auraG= auraG
self.auraB= auraB
self.auratype = auratype
self.aurastrength = aurastrength
Code: Select all
python:
player = BaseCharacter(
name = Player,
race = PlayerRace,
auraR = PlayerAuraR,
auraG = PlayerAuraG,
auraB = PlayerAuraB,
auratype = PlayerAuraType,
aurastrength = PlayerAuraStrength,
)
Code: Select all
image playeraura = LiveComposite((151,200),
(0, 0), ConditionSwitch(
"player.race == 'Human'", ConditionSwitch(
"player.auratype == 'mole'", im.Recolor("auramole.png", player.auraR , player.auraG , player.auraB, player.aurastrength),
"player.auratype == 'bunny'", im.Recolor("aurabunny.png", player.auraR , player.auraG , player.auraB, player.aurastrength),
Code: Select all
define player = ("Player", "PlayerRace", PlayerAuraR, PlayerAuraG, PlayerAuraB, "PlayerAuraType", PlayerAuraStrength)
I've tried putting them into an init block, but then they can't seem to take any changes.
I'm a little stumped here. I've found costly workarounds but they tend to bog down the runtime.
In the end the only solution I could find to make the function do what it needed to do was to scrap the transparency system and make them a set alpha and use a different color string like so:
Code: Select all
image playeraura = LiveComposite((151,200),
(0, 0), ConditionSwitch(
"player.race == 'Human'", ConditionSwitch(
"player.auracolor == 'GoldenDream'", ConditionSwitch(
"player.auratype == 'mole'", im.Recolor("auramole.png", 240 ,206 , 44, 120),
"player.auratype == 'bunny'", im.Recolor("aurabunny.png", 240 , 206 , 44, 120),