Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: blackant on March 11, 2013, 03:29:27 PM
-
next step of my training series,
i would like to use a variable stored to make choice of texture
traditionnaly:
if variable == 1, apply texture 1
if variable == 2, apply texture 2
else apply texture 0
etc...
-
try jeanfabre's ArrayMaker plugin. It supports arrays of textures. Then you can just use your variable as an index.
Other than that there's only the manual way, with one state that checks the int with some "int compare" actions and then fires a lot of different events accordingly.
A third solution (EDIT : contradicting to what I said before, I know :D) would be to write a dedicated action for this. Something like "Select random string" with textures instead of strings and a public int for the index would probably do nicest.
If you wanna do the third but somehow don't get along with PlayMaker(mind you, it's really not well documented), then just ask and I'll fix you up a version.
I just thought you might want to try such stuff on your own since writing your own actions is a very important step towards using PlayMaker to its full extend :)
-
thanks for your answer,
yeah i try to find many things by myself but after many hours locked this little things i must ask, i know ...:p
other thing i successed don't need to be asked and with time i can do things that i'm not able to script !
playmaker is very very nice with some trains !
anyway i didn't understand anything about your third solution...lol
maybe my english or maybe more skills in programming...
i'll try to do this with arraymaker at first.
see you soon!
-
All done.
There are several ways to do it. This is only one.
-
thanks Lane, i didn't sse that you shared a package, i'll look it to see if it's different from what i fund.
-
finally i didn't use any Int var and i made a tutorial using arraymaker
see this post:
http://hutonggames.com/playmakerforum/index.php?topic=3364.0 (http://hutonggames.com/playmakerforum/index.php?topic=3364.0)
-
Awesome! I'm glad you got what you needed done, and thanks for posting up a tutorial to share your findings.