assigning actor images as variables...
what's cookin,
well it looks like my 'grade invaders' stew is taking too long to get finished in time. but i'm going to keep pushing anyway to get it done.
my current problem is, i want to have a user chosen avatar, with a couple to pick from. that part i can do fine. the problem comes when i show the player lives during game play. i'm using a replicate behavior that requires an image. well, since the player can choose from five different images, i wanted to just be able to 'change attr plyr icon(self.Image) to player(Image)' but i can't seem to crack it. we can't add an image variable in the game attributes panel, or i'd just make a global game.playerImage.
has anyone suceeded in something similar to this? somehow passing the image of one actor as a value/variable to another actor?
good luck to everyone else getting their games done in time.
noodles...
well it looks like my 'grade invaders' stew is taking too long to get finished in time. but i'm going to keep pushing anyway to get it done.
my current problem is, i want to have a user chosen avatar, with a couple to pick from. that part i can do fine. the problem comes when i show the player lives during game play. i'm using a replicate behavior that requires an image. well, since the player can choose from five different images, i wanted to just be able to 'change attr plyr icon(self.Image) to player(Image)' but i can't seem to crack it. we can't add an image variable in the game attributes panel, or i'd just make a global game.playerImage.
has anyone suceeded in something similar to this? somehow passing the image of one actor as a value/variable to another actor?
good luck to everyone else getting their games done in time.
noodles...
Comments
But then I always did take the hack way round a problem!
QS
Edit:
Actually, now I think about it, could you not use a text variable?
Looking into it quickly now
QS
my apologies to you all. i figured it out five minutes after i wrote the question. i feel so newb. well, someone probably long ago figured this out but i'll post the fix here anyway...
for multiple choices for a player character you can assign the text value of the image to an actor. ex; chg attr player.Image to "flower.png"
so you could have a scene with all your choices for an avatar. when the player clicks on one, you assign the text name of that image to your player actor image using 'chg attr' by creating a game/global variable like playerImage of text type. it would look something like this...
player picks avatar flower.png
you assign flower.png to a game player attribute as text;
(game.playerImage) = "flower.png"
now you can reference the variable anywhere. so if you use a replicate behavior to show the player lives, instead of putting an image in the actor inspector window for the actor, you can just use a chg attr behavior like this;
chg attr (self.Image) to (game.playerImage)
this way you can dynamically change image values.
hope this helps. i felt like a bone head when i figured it out because it's so easy. just another plug for how sweet this software is.
way to go headchefs.
noodles...
thanks qs, i guess you went into the future and smacked me in the head with the answer, so i could figure it out now.
you're a great sous chef, and an asset in the forum for sure.
noodles...
Cheers anyway,
QS
For example:
Change Attribute self.Image to "Level-"+game.CurrentLevel+".png"
In this case, the image should change to "Level-1.png" or "Level-2.png" depending on which level is the current level.
I've tried this and don't seem to be having any luck (just get a black screen when previewing with this actor image in the scene). Hoping someone might be able to let me know a better way to accomplish this.