playMaker

Author Topic: Get texture name  (Read 4713 times)

mhovland

  • Playmaker Newbie
  • *
  • Posts: 3
Get texture name
« on: May 15, 2013, 04:04:45 PM »
Is there a way I'm not seeing for getting the name of the texture from a material, as a string?

Thanks for any pointers in the right direction.

mhovland

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Get texture name
« Reply #1 on: May 15, 2013, 05:21:57 PM »
For more clarity, I have the texture name as a string, and I need to convert it to a Texture, so I can set the texture component of an object.

Ex. I have "texture_00" stored in a string variable, I strip off the _00 and replace it with _05. Now I have "texture_05" stored in a string variable. How can I convert the string variable into a Texture variable, so I can use Set Property to change the texture? If there is a more direct way someone knows about, I am all ears.

Thanks again.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get texture name
« Reply #2 on: May 17, 2013, 02:30:56 AM »
Hi,

 ok, basically you can, ONLY if your textures are in a "Resources" folder and then you can load them at runtime by simply defining the path to it.

http://hutonggames.com/playmakerforum/index.php?topic=3916.msg18214;topicseen#msg18214

else, your texture need to be stored in a FsmVar. You can also use arrayMaker to store more texture conveniently, but that's less flexible then Resources.Load.

bye,

 Jean

mhovland

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Get texture name
« Reply #3 on: May 17, 2013, 11:45:17 AM »
Thanks for the custom action Jean.

For even more clarity, I am using ArrayMaker to store all my textures, but I have two separate arrays, each with their own reference name.

Here is what I need to happen, when in certain states, I need to use the textures stored in the "main" ArrayList, and when in other states, I need to use the textures stored in the "alternate" ArrayList.

Is it possible to have two ArrayLists on the same GO, with the same reference name, and just enable or disable the appropriate list in the appropriate states? That would surely be easy to do, but it really is good for organizational purposes.

Thanks for your help.

m

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get texture name
« Reply #4 on: February 26, 2014, 01:14:24 PM »
Hi,

 I would not recommand that, but this would work I guess. It's better to properly account for two different references in your logic.

bye,

 Jean

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Get texture name
« Reply #5 on: February 26, 2014, 01:58:33 PM »
This isn't directly applicable here it seems, but for reference:

GetFsmTextureName
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D