I'm trying to learn javascript in order to make my own plugins.
Souls video tutorial series helped me a lot.
My problem now is, that I can't figure out how to let a variable declare what image should be loaded.
For better understanding what I'm trying to do:
I have several pictures of NPC's, sorted by outfits and mood. Mood and outfits changes ingame and their current state get stored in two variables.
So if NPC 1's mood is "happy" (gamevariable[x]=4) and he is wearing "outfit 3" (gamevariable[x]=3), I want the code to load the picture with the name: "NPC1_4_3.png"
How can this be done? Thank you!
edit:
Ok I just figured it out.
Souls video tutorial series helped me a lot.
My problem now is, that I can't figure out how to let a variable declare what image should be loaded.
For better understanding what I'm trying to do:
I have several pictures of NPC's, sorted by outfits and mood. Mood and outfits changes ingame and their current state get stored in two variables.
So if NPC 1's mood is "happy" (gamevariable[x]=4) and he is wearing "outfit 3" (gamevariable[x]=3), I want the code to load the picture with the name: "NPC1_4_3.png"
How can this be done? Thank you!
edit:
Ok I just figured it out.
Code:
this._picture.bitmap = ImageManager.loadPicture('NPC1_' + $gameVariables.value(142) + '_' + $gameVariables.value(143))