append with object name
Posted: Sat Apr 29, 2017 4:18 pm
Hi.
I have a problem with syntax ... i guess
I want to add an object using the name of the variable and not the variable itself.
i need to do like in the exemple
objet_choisi.spellname equal "fireball"
And dosnt work because its just a string, not the "Competence" object.
How can i add the "Competence" Object with just its name ?
I have a problem with syntax ... i guess
I want to add an object using the name of the variable and not the variable itself.
i need to do like in the exemple
objet_choisi.spellname equal "fireball"
And dosnt work because its just a string, not the "Competence" object.
How can i add the "Competence" Object with just its name ?
Code: Select all
$ fireball = Competence("sort","feu", "normal","boule de feu", "fire ball", "base", "base", 0, 0, 0, 30, 1.5, 10, 30, 0, 0)
$ fireball_book = Objet("For learn fireball ", "", "blabla", "eng", 500, "livre", "boule de feu", 0, "fireball", 0)
$ objet_choisi = fireball_book
$ joueur.competences.append(objet_choisi.spellname)