Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: shadowof047 on March 06, 2017, 08:15:15 PM

Title: "Hashtable add many " Action doesnt add items in order.
Post by: shadowof047 on March 06, 2017, 08:15:15 PM
Hello .

As i said in the title , the action "hashtable add many" doesnt add items in the order defined in it , it seemed random to me , but maybe there is a pattern to it.

the order is important because i'm trying to use hashtables for a series of simple conversations between some characters , but now , sentences are getting mixed up. i am aware i can do this some other way . but this is also simple and easy.

In the attached picture you can see that , the items order in the action is different than the hashtable proxy .so  is this a bug or i can fix this ?
Title: Re: "Hashtable add many " doesnt add in items in order.
Post by: joaobsneto on March 06, 2017, 09:42:24 PM
I never used this action before, but I believe that Hashset do not have order. You should use a list data structure.
Title: Re: "Hashtable add many " doesnt add in items in order.
Post by: shadowof047 on March 06, 2017, 10:14:26 PM
I never used this action before, but I believe that Hashset do not have order. You should use a list data structure.

well , there goes my hope for a conversation system with hashtable :-\ .
i already made a similar system with arraylists , but i liked the hastable one better  ;D
Title: Re: "Hashtable add many " Action doesnt add items in order.
Post by: jeanfabre on March 07, 2017, 12:44:59 AM
Hi,

You will be better off building a conversation system using Xml, it will be a lot more manageable and productive.

and yes, Hashtable have this issue that their keys is not ordered, so during compilation the order in which you created them is not respected, by design.

Bye,

 Jean