playMaker

Author Topic: Material name?[SOLVED]  (Read 2099 times)

cursed1

  • Playmaker Newbie
  • *
  • Posts: 8
    • View Profile
Material name?[SOLVED]
« on: December 03, 2013, 02:04:26 AM »
i have four numbers textures/material and four cube
 set random material cube fsm
but i don't know  how to get  number when click the any cube 
pls help
« Last Edit: December 09, 2013, 11:32:18 AM by jeanfabre »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2487
  • Yup.
    • View Profile
    • Cleverous
Re: Material name?
« Reply #1 on: December 03, 2013, 05:36:45 AM »
After you use Mouse Pick and store the game object, use the Get Material action to get the material on that object.

cursed1

  • Playmaker Newbie
  • *
  • Posts: 8
    • View Profile
Re: Material name?
« Reply #2 on: December 03, 2013, 06:20:27 AM »
ok i use  get material but variable is material
i need  convert material to int  :D
because random number on random cube
i want
result = clicked cube texture number + clicked cube texture number
 
how to make it
sorry my english
thanks for help

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2487
  • Yup.
    • View Profile
    • Cleverous
Re: Material name?
« Reply #3 on: December 03, 2013, 06:40:58 AM »
Hmm... Maybe someone else knows how but as far as I know you can't do that - at least not that way.

Perhaps you could store the materials as variables before you use them in the random set, name the variable the number you want and then getting the material would return their name as the numerical position.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14832
  • Official Playmaker Support
    • View Profile
Re: Material name?
« Reply #4 on: December 04, 2013, 03:11:16 AM »
Hi,

 use a hahstable or an arraylist to maintain a list of your materials, then you can reference a particular material by its index in the the list or by its key ( string)

Use ArrayMaker for this.

https://hutonggames.fogbugz.com/default.asp?W715

bye,

 Jean

cursed1

  • Playmaker Newbie
  • *
  • Posts: 8
    • View Profile
Re: Material name?
« Reply #5 on: December 05, 2013, 01:29:06 PM »
thank you
« Last Edit: December 06, 2013, 07:56:54 AM by cursed1 »