playMaker

Author Topic: Material Color not updating on startup.  (Read 1668 times)

Shinugami

  • Playmaker Newbie
  • *
  • Posts: 2
Material Color not updating on startup.
« on: December 30, 2012, 08:37:29 AM »
This is in reference to:
Game Design Tutorial Videos - Platform Puzzle Chest Opening Game

So I did the tutorial as per the video but I came up with a few problems. First the game logic was rubbish so I changed the -1 and +1 logic for solving the puzzle as if I got the random number of 1, the (-1) code meant that even if I chose the correct color (yellow) I would get +1 which would equal zero and so I could never get a total of 4 because I would get 4 minus 1 for each platform that got the number 1.

Anywayz, my real issue is:
The colors in the video update no problem when he starts the game. The platforms all receive their random color. My platforms however remain black until the player enters the collision block.

Setup State:
Create Random Int (color index)

Set Color State:
Use Random int in a switch.
The switch sends the code to the appropriate state.
Let's say we rolled 3.

We get sent to 'Set Color 3' State:
Set Material Color.
FINISH

goto Listener State:
Trigger Event.
On Trigger, add 1 to the color index (the original random number we created in the setup state)

My issue is, why doesn't the color update the first time through this code?
I bought Playmaker Hoping it would help me visually debug my code however unless I'm a fool and I'm missing something, this kind of thing is not what I expected. Surely I'm doing something wrong however the code is so simple I don't get why it's not working. If I turn on 'do every frame' for the color update, that works however then the code just sits on that state and doesn't continue to the listener state.

Any help would be greatly appreciated.

-------------------------------------------------
Update:
Imported the PlayMaker sample files from:
https://hutonggames.fogbugz.com/default.asp?W880
Ignoring the warning like a pro, the import process deleted all my global variables.
When I redid the global variables, the code worked and the colors updated as they should have.

I have no idea what the error was and I have no idea how it was fixed but deleting the global variables and recreating them fixed my problem.

« Last Edit: December 30, 2012, 09:52:00 AM by Shinugami »