playMaker

Author Topic: array help[Solved]  (Read 455 times)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
array help[Solved]
« on: October 23, 2022, 04:18:25 PM »
I have a string array that contains each individual letter from a - z

I want to be able to use an input get key down of the right arrow key to select from the array one letter at a time and display the new choice within the text field.

Naturally, I wish to reverse the choice if you use the left arrow key, but arrays are not my friends could you help me, please?
« Last Edit: October 27, 2022, 12:42:35 PM by colpolstudios »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: array help
« Reply #1 on: October 24, 2022, 03:17:43 AM »
Hi.
If i understand correctly, you have a horizontal selection for your letters.
when pressing right / left you could increase/decrease a int value (index)
with that index you can get the corresponding letter. (0 = a / 1 = b / etc)

If you want also to be able to use mouse as well they you might want to make the letter as buttons and on the buttons use a fsm and use "UiGetSelectedGameObject" or "UiSelectedGameObjectCompare"
Then on selection use Set Fsm int to the main fsm (index)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: array help
« Reply #2 on: October 24, 2022, 07:36:34 PM »
I could not figure out how to use a horizontal selection for my letters.

I would need to find a playmaker tutorial on that subject.

I really liked your idea to use the letters as buttons, I hadn't thought of that.

Each letter is disabled and only activated with the use of the arrow keys.

I used an int switch to allow the player to use the arrow keys to go forward from A-Z or reverse the order with a second int switch that has the letters in reverse. with a clamped value of -28 to 28 and, an int compare to switch between going forward or reverse

Works well and I can click on the active letter (button).

Each letter has an FSM that adds the specific letter to a global string array only when clicked.

My issue now is how to get each individual letter and build a string out of these letters and then save that string so that it would represent the full name.

Max letters of each name are only three + the score

The final name plus the score would be displayed once you load.

My progress is from a reworking of and helped a lot.

Stuck at this point without help, id appreciate anyone's help.

The end goal would be to add this high score to the donkey kong wip project.

Trying to replicate that old style of entering your name with your score.











colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: array help
« Reply #3 on: October 25, 2022, 05:08:58 PM »
Now, each chosen letter is got from the global array and built into a string together with your score.

You can save and load, but only one entry and the score are displayed.

I have the main elements the entered name and the score and it may be possible to follow the tutorial and have a high score list with name and score, however, the tutorial is quite advanced.

I have been looking at both of these and the second part







colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: array help
« Reply #4 on: October 26, 2022, 03:58:18 PM »
My reworked version after following the tutorial:

Each time you click on a letter it is added with a max number of letters of five.

Sorry, I had my mouse hidden, but I click the timer button when I want a higher score entered.


I would like to add Json saving and loading, but not sure of the correct approach, could you help?

« Last Edit: October 26, 2022, 04:20:05 PM by colpolstudios »