Sign in to follow this  
Followers 0
dgatewood

TreasureGen.cpp

3 posts in this topic

Found errors within the TreasureGen.cpp Currently, it generates one item for loot, but this is because, they check how many items should be generated, and they assign a random value to one variable as to the type of item returned. It seems to me there needs to be an array that loops through how many items need to be generated, collect that item and place it within your array or list, then loop through it again to return the item at the end of the function. This is not done. Also, treasure is currently black and cannot be picked up and I will be spending some time fixing these issues. I will leave data collection to those people that have a lot of time to play.

Share this post


Link to post
Share on other sites
I created a card in Trello and assigned it to you.

Share this post


Link to post
Share on other sites
Last November for a programming project I made an AC-style loot generator script in JavaScript. I just used a recursive function that would call itself until the randomly generated number of loot pieces were 'created' (and pushed into an array for storage). Note for anyone unfamiliar with recursion: make sure your function has conditional logic with a counter in it (i.e. if the loot_counter is less than generated_loot_pieces, have loot_maker function call itself), otherwise your recursive function will turn into an infinite loop. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0