Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Satrio on August 23, 2011, 05:40:23 PM

Title: HELP!! Infinite loop stuff..
Post by: Satrio on August 23, 2011, 05:40:23 PM
Hi!

Im doing a memory game, you can see a prototype in the members showcase..

My problem is when setting up the different bricks... First time I do it it works fine,
but second time it doesnt really work.. It skips a few bricks..
Also there is an error message about infinite loops.

I use a "Random Int" picking a number from 0-6
      |   
     \|/
      V
This is piped into a "INT Switch" which has 5 events that pipe to the respective brick type.
      |   
     \|/
      V
This is piped into a "Float Compare" where i check how many times each brick has passed through a specific "Type" ie. "Wizard" or "Rat" etc. This is checked against another variable that tells how many Bricks the randomizer may pick from a specific type. ie "2 Wizards, 12 Rats, 2 Keys. 2 chests, 2 doors, 28 Floor" as it is a memory game and it needs pairs of bricks. Variables are "count_Wizard_Used" and it compares to "bricks_Wizard".

Here comes the problem (I think): When the two are equal ie. the total numbers of bricks are the same for both variables, I send the Event back to the randomizer to iterate again. If the same bricktype is picked after it has reached its limit, I just send it back to the randomizer again (perhaps this is the infinite loop error).
      |   
     \|/
      V
Question: Is there a better way in doing this "sorting" with PlayMaker? It would be nice to exclude the already taken brick variants from the Randomizer to speed stuff up a bit.

Hope you understand what I mean.. I have been up to long hacking at this problem.

Another problem is I use a GUISKin and playmaker loses the connection to it and slows everything down with a burst of

Unable to find style '' in skin 'GameSkin' Repaint
UnityEngine.GUIStyle:op_Implicit(String)
HutongGames.PlayMaker.Actions.GUILayoutBeginHorizontal:OnGUI() (at Assets/PlayMaker/Actions/GUILayoutBeginHorizontal.cs:27)
DrawGUIHandler:invoke_void__this__()
DrawGUIHandler:invoke_void__this__()
DrawGUIHandler:invoke_void__this__()
DrawGUIHandler:invoke_void__this__()
DrawGUIHandler:invoke_void__this__()

Any solution to that?

Otherwise it is great fun to use PlayMaker! I think it is great and look forward to the 1.2!!

/s