Hashtables and destructibles

rogers

You can change this now in User CP.
Reaction score
1
I have several (~170) destructible gates that I've placed into a hashtable under a set of parent ids that group them, and I want to be able to open these gates through one of two solutions, depending on which will be easier and use less resources (I'd prefer not to have a bunch of if-statements, unless absolutely necessary). Here are the solutions I came up with, but have no idea how to do it:

1. Each group of gates has its own player group with a number given to it based on an array where the number of the player group matches the parentid of the gates. If the player is in the player group, voila! The gate they targeted with their spell opens!
or
2. A separate, different, hashtable that can be utilized to store the players allowed for that respective parentid of the gate. If the player number is listed under that parentid in the player gate hashtable, voila! The gate they target with their spell opens! I'll add their player number to that parentid as they complete the necessary requirements.

Whichever solution is easier or requires less system resources (or if there is a better way to do this), that is the one I'd prefer to use. I've created a spell that opens the gates right now, but I need to restrict them. I don't want them to open the gate until they get to the point in the quest.
 
Last edited:

jonas

You can change this now in User CP.
Reaction score
64
If you want to store whether gate g can be opened by player p, store it in a hashtable with keys HandleId(g) and PlayerId(p).
 

rogers

You can change this now in User CP.
Reaction score
1
No, that's not what I'm wanting to do. I'm wanting to group gates and, based on a set of conditions, allow players to open those gates individually.

EDIT/UPDATE: I actually do not need a hashtable for this because I can just use an array and loop through the array matching it with that value. No idea why I thought I needed an additional key.
 
Last edited:
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top