playMaker

Author Topic: Hash Table Contains Multiple Keys its possible?[SOLVED]  (Read 1832 times)

mmzbr

  • Playmaker Newbie
  • *
  • Posts: 40
Hash Table Contains Multiple Keys its possible?[SOLVED]
« on: March 31, 2020, 12:15:04 PM »
Hello there,

I'm using a Hash Table to control Monsters Deaths (when a specific mob dies I add a key in a hash table to indicate that mob are dead to keep it in a single object) in my rpg game, but now I have a problem and did'nt realize the solution yet.

In a quest event I have to kill 5 specific mobs to complete it (ie: rat01, rat02, rat03, rat04, rat05) how I check if these mobs are dead in my hash table? I just found the actions Hash Table Contains and Hash Table Key, but I didnt found a Multiple key action to select the 5 mobs.

I'm doing something wrong, using the wrong method to achieve this?

Thank you in advance and take care all!
« Last Edit: April 01, 2020, 07:22:48 AM by mmzbr »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Hash Table Contains Multiple Keys its possible?
« Reply #1 on: April 01, 2020, 06:56:52 AM »
Hi.
With Hash Table Get Many you can get multiple values on a hash table.
but you will stil need to check each one after you got them from the hashtable.
also

if you need multiple killed for same enemy, use 1 key name. and add 1 for each kill on that enemy

so on kill :
1st do 'HashTableContainsKey'
to check if already placed in list, of not add to list and set int value to 1

if it has then get int value and add 1

then do a 'quest check'
with the get many, IF 1 enemy is not there yet you will get a key not found event.
So you will already know quest is not complete.

if at least 1 of each has been killed then go next step.
Then check each enemy's int value.

I hope this helps :)

mmzbr

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Hash Table Contains Multiple Keys its possible?
« Reply #2 on: April 01, 2020, 07:22:10 AM »
Got it, thank you very much for your time!

Take care there!