Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: xhidnoda on February 24, 2014, 09:18:59 PM

Title: How to change sprite (2D toolkit + Playmaker) - Score System[SOLVED]
Post by: xhidnoda on February 24, 2014, 09:18:59 PM
Hi everybody!!!
Maybe a noob question, but anyone know hot to chage a sprite of a spritecolletion every (event happen)?
Like a score system, i like to chage image number 1 to number 2 and 3(...).
Can help?
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: jeanfabre on February 25, 2014, 03:02:23 AM
Hi,

Actually, I would suggest you have all your image in your sprite collection and then sawp that image on the sprite itself as opposed as in the collection itself.

bye,

 Jean
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on February 25, 2014, 11:58:09 AM
Hi Jean!
I think not express well...i mean change the image sprite of just one spriteColletion.
I want to change the score when player hit someting.
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: jeanfabre on February 26, 2014, 01:25:31 PM
Hi,

 then you would use a proper text based sprite with a atlased font for this isn't it? what is your score gameobject made of?

bye,

 Jean
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on March 01, 2014, 03:41:23 PM
Hi
I use a 2D Toolkit font. Can you make a example for me...i try try but, i don't not how to make this score system.
 :'(
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on March 03, 2014, 07:57:32 PM
Nothing?  :o
I try with this action: "tk 2d Text Mesh set Text".
Is correct this action to make a score system based in 2D toolkit?
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: jeanfabre on March 04, 2014, 06:23:25 AM
Hi,

 yesm that's the one to use to set the text on 2t2d, is it not working?

bye,

 Jean
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on March 04, 2014, 09:00:43 PM
I don't not if is working...because can't test.
Here is my FSM setup.

Can you help?
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: jeanfabre on March 05, 2014, 02:53:24 AM
Hi,

 I am confused. Why can't you test this?

bye,

 Jean
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on March 05, 2014, 12:16:36 PM
1. Is its the best way to make score?
2. I can't test, because a have a problem when try to drag and drop the 2score game object" into the tk 2d textmesh. (see the image, have error).

thanks!
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on March 05, 2014, 08:27:11 PM
Here is the error (image).
 :-[
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: jeanfabre on March 06, 2014, 07:26:15 AM
Hi,

 Drag Contador on the gameobject field. Don't drag the component itself. else use the action "get Owner" store this is a GamObject variable that you use in this action as opposed to try to drag and drop.

bye,
 
Jean
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on March 06, 2014, 06:29:34 PM
sorry...but I do not understand.
1. Score is the textMesh game object (2d toolkit).
2. Contador is FSM where i try to make that score update number every time.
3. When drag and drop Score into Tk 2d Text Mesh set Text action...show the pop-up window and let me choose  (Get property, set property, etc.)

I want to update the text Mesh (Score). How to do this? Sorry my ignorance on this, and thanks to help me.

how do I do?
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on March 09, 2014, 11:20:16 AM
nothing????
 ;D
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on March 10, 2014, 09:58:53 PM
Is any place with toturial of how to make a score sytem? 2d toolkit or gui text (native of unity) i don't care....i just to make happen this :(
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: jeanfabre on March 11, 2014, 06:37:11 AM
Hi,

 You are not far, once you selected "Set property", you can then pick up the "text" property of that Tk2D Mesh and set it to any string you like.

bye,

 Jean
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: jeanfabre on March 12, 2014, 04:43:36 AM
Hi,

 Are you struggling with keeping track of a score in your game or actually not able to show it on screen?

 if you use unity GUI text, simple use the action "Set Gui Text" and you will be able to change the test shown on that GUI Text.

 now, if you have an int as score, you will need to convert it to a string using the action "Convert Int to String". This is maybe your problem right?

 Have a look at the m2h samples, plenty of examples to keep track of scores and even store the best score in the player prefs.

https://hutonggames.fogbugz.com/default.asp?W890

https://hutonggames.fogbugz.com/default.asp?W895

bye,

 Jean
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on March 12, 2014, 02:25:07 PM
Hi Jean
You've seen my pictures are send?
I use 2D toolkit (2D textMesh), and yes also GUI Text.
I found what is the problem.
When you make a prefab of you "Score game object"...the action "set property" is lose his target and all setup. I'm don't why. IS A BUG?

Now is works...with the GUI Text, but out of prefab.
In this night, i try to test with 2D textMesh of 2D toolkit, and will tell you is work or not.

Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on March 12, 2014, 09:40:59 PM
Yes...is work perfect with text mesh action....
But, why don't work into a prefab?
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: jeanfabre on March 13, 2014, 07:16:55 AM
hi,

 because a prefab sitting in the project folder is just an asset to be used in a scene, it's very important to grasp this concepts, because this is how Unity is working, not something PlayMaker has control over.

bye,

 Jean
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: xhidnoda on March 13, 2014, 08:34:57 AM
Oh....i get that
Many thanks Jean!
So, the solution of this, is make a fsm on Game Object that have a trigger listener and then if hit, send a global event to "Contador" game Object.

If any other user follow this thread, i will put the source here when the project is done.


Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System
Post by: jeanfabre on March 14, 2014, 06:44:09 AM
Hi,

 don't hesitate to share things, it's always welcomed.

bye,

 Jean
Title: Re: How to change sprite (2D toolkit + Playmaker) - Score System[SOLVED]
Post by: xhidnoda on March 29, 2014, 02:46:36 PM
Flappy Planes - All FSM source here. Enjoy
http://hutonggames.com/playmakerforum/index.php?topic=6841.0