Grabbing Variables
Posted: Sun Dec 12, 2021 1:44 am
So I'm trying to practice making an RPG battle system in Ren'Py. So I'm storing enemy names and stats like this
And I want to import these stats into this
then I thought, what if I had something like this
so if I made {bad1 = gakk}, bad1_name would search for {gakk_name} and so on.
I want to know how I could do this. I have no idea what to call this, but I hope I'm making some sense.
Code: Select all
define gakk_name = "Gakk"
define gakk_hp = 50
define gakk_atk = 1Code: Select all
define bad1_name = ""
define bad1_hp = 0
define bad1_atk = 0Code: Select all
define bad1 = ""
$ bad1_name = [bad1]_name
$ bad1_hp = [bad1]_hp
$ bad1_atk = [bad1]_atkI want to know how I could do this. I have no idea what to call this, but I hope I'm making some sense.