playMaker

Author Topic: Loop count exceeded  (Read 5353 times)

AutoLiMax

  • Playmaker Newbie
  • *
  • Posts: 14
Loop count exceeded
« on: September 09, 2015, 10:22:39 AM »
Hi, I'm attempting to create an inventory system using playmaker and it's going well so far.
*decided to upload the images to multiple places just in case*

I am getting a loop count exceeded error here:
http://postimg.org/image/lliubeo89/
http://pasteboard.co/wUYp531.jpg

Ill Explain how I've got it working so far.

So when the inventory is opened, playmaker checks a string array and sets string variables named "Item X _var" based on the index.
http://postimg.org/image/y4415qall/
http://pasteboard.co/wV4tKAu.jpg

Playmaker then takes the string from the first index variable and sets it to a temp variable named "CurrentItem _var".
Then its sets a temp object variable for the button image named "CurrentItemImage _var".
Then it compares the string of the temp variable "CurrentItem _var" with a blank string.
So if the the "CurrentItem _var" string has text in it then it checks what the string is. If it's empty then it will move on to the next slot and repeat the process.
http://postimg.org/image/udzsz39d5/
http://pasteboard.co/wV6dqTW.jpg

Playmaker then compares the "currentItem _var" string with a list of manually written strings until it finds a match.
*The list currently only has an apple in it*
http://postimg.org/image/a7wb07dpl/
http://pasteboard.co/wV96xRL.jpg

Once it has matched the string it will then set the image of the temp variable "CurrentItemImage _var" to the correct one.
http://postimg.org/image/xdbazy889/
http://pasteboard.co/wVaaj7c.jpg

Then it compares the "CurrentItem _var" with the "Item X _var" so it goes to the next slot.
http://postimg.org/image/6qyuaz415/
http://pasteboard.co/wVbkUmB.jpg

Then it should repeat the process until it has run through all the checks.
As you can see it sets the temp variables up to the correct values when its about to run through that line.
http://postimg.org/image/dy0j6uey1/
http://pasteboard.co/wVcB8za.jpg

So when I pick up one apple its fine and nothing bad happens. But when I pick up more than one I get a loop count exceeded error.
I've looked at other threads which show the "Next Frame Event" action being used so I tried putting them between the "Slot X" node and the "Check Item" node but play maker fsm script doesn't progress past that point. The game no longer freezes but the images aren't displayed and play maker fsm script doesn't progress.

Anyone have any ideas?

If any more info is needed then let me know. I've been working on this for a while now and reallly realllly want to get it working! :)

Thanks
« Last Edit: September 10, 2015, 03:27:58 AM by AutoLiMax »

AutoLiMax

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Loop count exceeded
« Reply #1 on: September 10, 2015, 03:29:11 AM »
Here is a video of the problem as it happens. It also allows you to see they flow of the fsm.
https://www.youtube.com/watch?v=fQJjpWCOlDc&feature=youtu.be

Really need to get this fixed! ):

Thanks
« Last Edit: September 10, 2015, 04:16:48 AM by AutoLiMax »

AutoLiMax

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Loop count exceeded
« Reply #2 on: September 10, 2015, 07:01:29 AM »
Ok, I've added some sticks and logs that the player can pick up as well now, and the problem only seems to happen when the player picks up 2 of the same objects.

Any ideas?

Thanks.

AutoLiMax

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Loop count exceeded
« Reply #3 on: September 11, 2015, 08:11:36 AM »
Sorry to pester but has as anyone got any ideas? I'm at the stage where I'm unable to progress and really need to get this sorted out before I go back to workage.

This is a video showing it only happens when 2 of the same items are picked up.
https://youtu.be/21nqcUrdfcU

Thanks muchly!

x
« Last Edit: September 11, 2015, 08:20:53 AM by AutoLiMax »

johannastephen

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Loop count exceeded
« Reply #4 on: September 11, 2015, 08:21:39 AM »
Try putting Wait state. This will solve problem.

AutoLiMax

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Loop count exceeded
« Reply #5 on: September 11, 2015, 08:40:17 AM »
Hi! Thanks for the response! I Just tried adding a wait state  just as you said and
I no longer get the error but the inventory still freezes when I pick up 2 of the same object.
Video:
https://youtu.be/-ncoFj4FKmk

Any other ideas?

Thanks!
« Last Edit: September 11, 2015, 08:51:15 AM by AutoLiMax »

AutoLiMax

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Loop count exceeded
« Reply #6 on: September 13, 2015, 05:57:56 AM »
Here is another video of the issue after adding more items.
https://youtu.be/GGZgkakTVdk

I've tried the next frame event and the wait state but it just seams to get stuck.

Some ones gotta have something? :(


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Loop count exceeded
« Reply #7 on: September 14, 2015, 04:09:05 AM »
Ouch.

Man, you need to find a way to do some generic logi so that you don't hardcode the whole process for each slot, that's going to give you so much trouble on a regular bases for the rest of the duration of the project...

 Not that I can spot the logical issue in there, but it's definitly something that calls for refactoring.

 You should be using ArrayMaker ( also available on the Ecosystem), and maintain your data in lists, then you go through this list in a loop and you'll save yourself from a lot fo trouble.

 Have you worked with ArrayMaker already?

Bye,

 Jean

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Loop count exceeded
« Reply #8 on: September 14, 2015, 07:42:08 AM »
I can't really tell what the issue is either but I agree with Jean you should be using a proper loop over the slots as a group instead of having a state for each slot. That doesn't scale well and is much more difficult to maintain in the future.

Take a look at this video that gives you a look at how to do loops. You can make small loops that work over an iterator and don't need a pile of different states.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

AutoLiMax

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Loop count exceeded
« Reply #9 on: September 14, 2015, 01:13:59 PM »
Yeah I used array maker. Every time an object gets picked up it adds the name of the item to a string array and then play maker compares that string to an empty string, if its empty put the item there, if not then check the next slot.

I think all of the videos I've posted show the array maker in the inspector and shows items being added to it. the fsm then does checks based on the array.

I might have to rethink the whole thing but i'd really rather not have to do that.

I'm just nipping out but ill be back soon and ill post all the info on how i get playmaker to populate the bag slots from the array.

Thanks

AutoLiMax

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Loop count exceeded
« Reply #10 on: September 14, 2015, 02:41:54 PM »
oh i didnt see that reply. ill take a look at the video and update. if i get it working i may write a tutorial on how I managed to get it working.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Loop count exceeded
« Reply #11 on: September 14, 2015, 02:46:03 PM »
oh i didnt see that reply. ill take a look at the video and update. if i get it working i may write a tutorial on how I managed to get it working.

That would be cool! There are lots of questions about doing inventory systems =)
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

AutoLiMax

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Loop count exceeded
« Reply #12 on: September 18, 2015, 06:15:31 AM »
Right I have only just had a chance to go through it and you were correct. I need to set it to loop through a specific number times.
It's a bit of a mess atm though so when it's at more of a completed stage and less of a mess I'll get writing a guide on it. maybe a video.... who knows atm.

Thanks!