Forum rules - please read before posting.

Hint System Again

Hi awhile ago i was getting help with a hint system for a hidden object game, i also lost my file for that project and left unity for awhile. I had images of how i did the hint system only it wasnt working. http://imgur.com/a/0uEB7 This image of the hint system works in finding the objects but will also find objects that are not there. In the old hint system i did if condition is met then spawn partlcle at the marker and then put the if condition is not met back to check random number but for some reason i get a stack overload error then when i do like that image it spawns the particle randomly but if object already has been found the hint still spawns particle on that 1. i actually have 12 items to find.

Comments

  • edited March 2017
    If you are getting a StackOverflow error, however, that could be because your Actions 0 and 1 appear to be repeating themselves indefinitely (the image is cropped so it's not possible to be certain).  You're checking if a given Inventory item is carried by the player after the random number check, and looping it back if it is.

    Therefore, the player is carrying the item, that isn't going to change when the cycle is re-run.
  • I only showed that part cos all was the same except with different objects. This is for a hidden object game. On my hint system post in 2015 it says to loop it back to check random number. I needed when the hint button is pressed it will run a countdown timer and also spawns a particle at a marker randomly with items that are there and it is meant to loop back so it won't spawn a particle in a place where there is no object. The varible check random number has 12 items then i check the inventory to see if that item is there and if the condition is met it spawns a particle in the location of a object that is not there and if the condition is not met it loops back to the check random number until it does find a object that hasn't been found yet. I did this with my first try at a hidden object game which worked but i think i accidently deleted my file cos that hint totally worked but when i did it now it has stack overflow but it only works like that image i posted only it will still find objects that are not there any more. This was my old post http://www.adventurecreator.org/forum/discussion/3479/hint-system-going-great-until#latest so this may explain better on what i mean
  • The ActionList in your other thread's image is wired differently - see how the Inventory: Check Actions don't re-route back to the Variable: Check random number Action if the condition is met.  The StackOverflow error is likely causing this.

    I don't see your need for the random check, though.  You shouldn't rely on randomisation unless it's necessary.  Variable: Run sequence may be more appropriate in this case, as it allows you to cycle through a different chain of Actions each time it's run.
  • edited March 2017
    run sequence won't work considering i need it to go up to 12 but run sequence only go up to 10 and i did at first wire it like that old post but that is when i get stack overflow. And on that old post in the end i did re oute it back to the check random number and then it worked
  • Regardless of what was before, the chain of Actions you've posted above will create a StackOverflow error - particluarly if you're checking a low number of random numbers.

    I shall bump up the Variable: Run sequence's maximum output to 20 in the next release.  You can make this edit yourself in the meantime by opening ActionVarSequence.cs and changing the "10" on line 167 to "20".
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.