Ce Jayce
Member
I've become a tad stuck with the latest idea i'm working on so am hoping some of you out there can help me!
The end goal I want to achieve is to have a quest giver randomly select a number 1-6 and then select that number of items (different types not amounts) so long as that item is part of "BaseClassSpecialItem" - Selecting the items randomly is where i've come stuck.
For example I have 26 items ItemA to ItemZ that are all part of BaseClassSpecialItem I then want to randomly select an item or several items from that list.
I've tried a variety of methods but nothing has seemed to work, I eventually gave in and decided to create a List and add each item a-z into that list and then use that list to randomly select from.
I declared my list and added the Items
However it doesn't take ItemA or ItemB as "Class name is not valid at this point" my guess is because although the list is BaseClassSpecialItem and ItemA & ItemB are both BaseClassSpecialItem they are a subclass of it rather than the parent class itself.
Surely though, there is a way?!
All help is greatly appreciated,
Thanks in advance!
The end goal I want to achieve is to have a quest giver randomly select a number 1-6 and then select that number of items (different types not amounts) so long as that item is part of "BaseClassSpecialItem" - Selecting the items randomly is where i've come stuck.
For example I have 26 items ItemA to ItemZ that are all part of BaseClassSpecialItem I then want to randomly select an item or several items from that list.
I've tried a variety of methods but nothing has seemed to work, I eventually gave in and decided to create a List and add each item a-z into that list and then use that list to randomly select from.
I declared my list and added the Items
Code:
List<BaseClassSpecialItem> itemlist = new List<BaseClassSpecialItem>();
itemlist.Add(ItemA);
itemlist.Add(ItemB);
However it doesn't take ItemA or ItemB as "Class name is not valid at this point" my guess is because although the list is BaseClassSpecialItem and ItemA & ItemB are both BaseClassSpecialItem they are a subclass of it rather than the parent class itself.
Surely though, there is a way?!
All help is greatly appreciated,
Thanks in advance!