playMaker

Author Topic: Can an Int value = a particular string value?  (Read 1917 times)

derkoi

  • Full Member
  • ***
  • Posts: 187
Can an Int value = a particular string value?
« on: November 10, 2012, 12:50:08 PM »
Hi all,

I'm wondering if I can have an int value of "0" = a string value of "R", an int value of "1" = a string value of "N".

It's for a car game i'm working on and the gears are int values with 0 being reverse, 1 neutral and 2 upwards 1st gear upwards. I need to convert the int values to displayed strings.

Can anyone help please?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Can an Int value = a particular string value?
« Reply #1 on: November 12, 2012, 07:58:13 AM »
Hi,

 Several possibilities:


1: you make some simply switch states that trigger specific events for each gear

or

2: you use ArrayMaker, and create a hashtable referencing each gear string with the actual integer and poll within that hashtable to know what gear's string equals as int.

bye,

 Jean