playMaker

Author Topic: How to Check if Hashtable element exists  (Read 2243 times)

memetic arts

  • Full Member
  • ***
  • Posts: 141
How to Check if Hashtable element exists
« on: April 28, 2016, 11:27:26 AM »
Greetings -

I'm using Hashtables to store texture objects downloaded via Assetbundles, which works great, when it works.  Occasionally items get skipped, and the slot in the Hashtable says "None".  I've put a null handler in the AB Loader script that I'm using, which is supposed to insert a "dummy" image that is included in the core project.

It doesn't miss all the time, but sometimes it misses one, other times it misses an entire set. My next step is, just before accessing the Hashtable, to check if the texture exists, but I don't see any actions that will do this. Research shows that there is only a GameObject Is Null action, which won't help here.

Any thoughts/input greatly appreciated .  . .

Thanks very much!



« Last Edit: April 28, 2016, 11:34:40 AM by memetic arts »

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: How to Check if Hashtable element exists
« Reply #1 on: April 28, 2016, 09:51:02 PM »
In this forum, u have a texture compare action. U that to comprar ur hashtable results to null

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: How to Check if Hashtable element exists
« Reply #2 on: April 29, 2016, 12:18:55 AM »
Hi, thanks for the idea . . . i'll try that!

I think I may have also found another way . . . I had completely forgotten that in using the Hashtable Get action there is a failure condition.  The question, of course, is what constitutes "failure" . . . if returning null qualifies, then I could just use that as the trigger to properly populate the node.

Cheers!

ransomink

  • Playmaker Newbie
  • *
  • Posts: 44
Re: How to Check if Hashtable element exists
« Reply #3 on: April 30, 2016, 11:55:36 PM »
Couldn't you just use Hash Table Contains Key/Value actions to check if it exist?