playMaker

Author Topic: Best practice for list removal of options  (Read 652 times)

Captaincrud

  • Junior Playmaker
  • **
  • Posts: 72
Best practice for list removal of options
« on: November 02, 2021, 05:52:30 PM »
what would be best practice for the following

1. generate random number from multiple arrays
2. check if number options is on list if yes generate option then remove from list so as to never get same options again

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Best practice for list removal of options
« Reply #1 on: November 02, 2021, 10:10:27 PM »
Hi.
Quote
1. generate random number from multiple arrays
Are you getting numbers from multiple arrays and placing them in a different array.

Can you give more detail on the use case it is for.

Captaincrud

  • Junior Playmaker
  • **
  • Posts: 72
Re: Best practice for list removal of options
« Reply #2 on: November 03, 2021, 10:39:29 AM »
         I am making random characters from multiple arrays client wants it to make 1000 characters random with no repeats. Save to a pool so i need to make sure when it makes a character that it doesn't save a repeat.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Best practice for list removal of options
« Reply #3 on: November 04, 2021, 04:17:03 PM »
Hi.
Removing from the list will probably be the best way.
Should the list persists after player quit the game and start again?

If so, you probably want to use Easy save as it has Array List Save Actions (you can find the Array List Save Actions on the Ecosystem)

Captaincrud

  • Junior Playmaker
  • **
  • Posts: 72
Re: Best practice for list removal of options
« Reply #4 on: November 04, 2021, 05:48:06 PM »
when you say remove from the list do you mean remove from the array?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Best practice for list removal of options
« Reply #5 on: November 05, 2021, 08:31:06 AM »
Hi.

Quote
when you say remove from the list do you mean remove from the array?
Yes


Array Maker Actually uses lists instead of arrays.

I would recommend using array list instead of the build-in PM array's.