playMaker

Author Topic: another issue while learning playmaker  (Read 6383 times)

Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
another issue while learning playmaker
« on: February 19, 2013, 01:51:20 AM »
HOHA friends,

As a new playMaker user I am currently trying Chris tutorial series. In tutorial 10 - Platform Puzzle Chest Opening Game, I did everything right and almost at last stage duration 39:06, after making 4 copies of platform, when I run on any platform and enter in trigger it changes color on all 4 platform though I have entered in just one trigger.
I have some issue in tutorial 9 which I did 4 times and after that I come to know it was a bug in playmaker which got solved after updating playmaker to 1.5, now again I have done the tutorial 10 already for 4 times and yet have issue. but not sure is it bug or am I doing anything wrong.

If there is some one who has done this tut and have got same issue or know how to solve please help me out to go ahead.

hush

Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
Re: another issue while learning playmaker
« Reply #1 on: February 20, 2013, 08:06:35 AM »
Updated to 1.5.2, but still have issue.
can some one help?
It is quiet frustrating for me.
hush

gamedivision

  • Full Member
  • ***
  • Posts: 227
Re: another issue while learning playmaker
« Reply #2 on: February 20, 2013, 08:28:30 AM »
Sounds to me like your using the same variable for all the triggers,if you have 4 triggers then you need 4 variables,otherwise they will all react the same.
I hope I read your question correct

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: another issue while learning playmaker
« Reply #3 on: February 20, 2013, 08:50:45 AM »
Sounds to me like your using the same variable for all the triggers,if you have 4 triggers then you need 4 variables,otherwise they will all react the same.
I hope I read your question correct

Or globals. Make sure it's all local.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
Re: another issue while learning playmaker
« Reply #4 on: February 20, 2013, 09:22:27 AM »
Hi Buddy,

First thanks for the response. Finally I found some one who is ready to help.
OK I have followed the video tut by Chris step by step and I am confident that I have not missed anything.
In the tutorial I makes 4 variables for color which are global and in the beginning randomly sets the color for platforms, and then on trigger event changing the color of platform. Now I made a prefab and created copy of it 4 time. Normally trigger works as we enter in it so on my each platform every trigger should work when my first person system triggers it but issue is even if I enter in any one trigger it changes color on all platforms.
Please check the video tutorial here-  Hope I am able to explain the issue.

Hush

gamedivision

  • Full Member
  • ***
  • Posts: 227
Re: another issue while learning playmaker
« Reply #5 on: February 20, 2013, 09:37:30 AM »
Without even watching the video if you have made 1 prefab and copied it 4 times you need to go into each prefab and change each variable for the ones you have created,otherwise it's just using the same variable

Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
Re: another issue while learning playmaker
« Reply #6 on: February 20, 2013, 10:46:17 AM »
Will check it.
But just to let you know that I am not making 4 prefabs from one prefab but just loading the prefab back in my scene and then making copy of that object.
Because I am new to unity not sure if that mean same as you said.

hush

gamedivision

  • Full Member
  • ***
  • Posts: 227
Re: another issue while learning playmaker
« Reply #7 on: February 20, 2013, 11:29:44 AM »
No when you copy a prefab or duplicate it,you duplicate everything within that prefab,so it's all good and fine duplicating things but if you want them to react separate to each other then you need to change the variables each one uses,imagine 10 boxes with the same Boolean attached to each when I walk into that box and the Boolean becomes true,it becomes true for every box using that Boolean unless I create 10 booleans,then each will behave individual to each other

Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
Re: another issue while learning playmaker
« Reply #8 on: February 21, 2013, 12:20:22 AM »
Sorry to say, there is nothing like that in the video tutorial.
Can you please help me on that? How to do that?

Hush

greg

  • Junior Playmaker
  • **
  • Posts: 68
Re: another issue while learning playmaker
« Reply #9 on: February 22, 2013, 10:18:44 AM »
I remember doing this, the tutorial is programmed incorrectly but it's never addressed. My solution was:

- give each tile an int variable "color number"
- set "color number" to match the right color the tile starts on (i ditched the random start color, and just set it to a color myself for each tile)
- increment "color number" when you step on tile and increment the actual color
- if "color number" is bigger than 5 (if we have 5 colors), then set it to 1 (basically "clamping" it between 1 and 5)
- make a global bool variable for each tile (tile X correct?) *X = 1/2/3/4 depending on tile
- if green is the 3rd color in your sequence, and you want all tiles to be green to win. then check "color number" = 3 after you increment the color and "color number". If so, then set "tile X correct" (X = the tile we're programming)
- listener uses "bool all true" and says you win if all tiles are correct

So if your color sequence is: red, blue, green, yellow.
And a tile starts yellow, you set its "color number" to 4.
If "color number" = 5, then set "color number" to 1. (so it cycles between 1-4 each time its stepped on)

Once you have the basic tile prefab programmed with the functionality, you'll need to drop that prefab down a few times, then edit it in "scene view" to break prefab connection, so you can set starting "color", "color number" (which matches up to color), and also the global bool "tile X correct?" (where if this is tile 1 you're placing, then set it to "tile 1 correct?"

** It's really hacky but i didn't want to spend long on this, after having learnt what it intended (random values and bool checks)

Keep on pushing through problems, you run into a lot when programming.. but the frustration is worth the tools you'll build, giving you the ability to bring life to your own ideas :)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: another issue while learning playmaker
« Reply #10 on: February 22, 2013, 11:04:37 AM »
No when you copy a prefab or duplicate it,you duplicate everything within that prefab,so it's all good and fine duplicating things but if you want them to react separate to each other then you need to change the variables each one uses,imagine 10 boxes with the same Boolean attached to each when I walk into that box and the Boolean becomes true,it becomes true for every box using that Boolean unless I create 10 booleans,then each will behave individual to each other

Uhhhh sorry I don't want to contradict you because I am a total noob on Playmaker (but I have some knowledge of programming) but isn't a LOCAL variable just, LOCAL?
Means, it's for that single object and if you have 10 different objects using variable HELLOVARIABLE inside each of them, each of these variable can have its own value without affecting the other variables at all?

Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
Re: another issue while learning playmaker
« Reply #11 on: February 22, 2013, 12:47:27 PM »
Tried many time but did not find a solution, so I dropped that tutorial.
Now working on another tut.
Personally I like to get result, not just understand the concept.
Hush :)

Hushonik

  • Playmaker Newbie
  • *
  • Posts: 32
Re: another issue while learning playmaker
« Reply #12 on: February 27, 2013, 12:52:04 AM »
OK,
So Finally I found what the issue was and find a solution too. Hope it is done right.
And with a thought that may be it will help to others here I explains the issue and solution.
The issue was that I have same material in all prefabs that i copied again in my game and when I trigger any one platform it updates material and that affects to all platforms I have in game, as they have same material being used.
In Chris tutorial it was not happening as He was using older version of playMaker where the set material color action has no material option but may be in the current new version of playmaker it is there and sol need different material to be assigned to all platforms.
Hope it helps.
Hush