Playmaker Forum

PlayMaker News => General Discussion => Topic started by: LuminRabbit on January 11, 2012, 08:11:56 PM

Title: Playmaker & PoolManager2
Post by: LuminRabbit on January 11, 2012, 08:11:56 PM
Hello All,

Im new hear and have just been watching some of the videos and think playmaker really looks cool!

Im thinking of purchasing it but have one question and Im really not that familiar with playmaker but here goes anyway.

Can playmaker work with PoolManager 2?

Im not sure how to instantiate with playmaker because I haven't used it yet. (maybe theres a demo?)

But would it be possible to use poolmanager to spawn instead of instantiate without code using playmaker like you would instantiate currently with playamaker?

Not sure if that question made sense? but hopefully someone understands it :) Im just trying to get a general idea of what I can do with playmaker. If playmaker cant do what I asked above (use poolmanager2) then Im guessing I could just activate and deactivate gameobjects with playmaker and have it work the same? Just a thought???

Anyone have any insights?
Title: Re: Playmaker & PoolManager2
Post by: jeanfabre on January 12, 2012, 02:43:50 AM
Hello and welcome!

 Never played with poolManager 2 but I'll explain more in details how playmaker works.

 basically, it's a component like any other that you drop on a gameObject, So I would tend to think that it should not be in the way of how pool manager is working.

 The standard workflow is to add playmaker component during editing, not at runtime.

Now, if you want to use playmaker to control pool manager: that is totally feasible. you'll simply need to write custom actions to control pool manager.

for example:
Code: [Select]
// Use Spawn() instead of Unity's Instantiate()
Transform enemy = PoolManager.Pools["Enemies"].Spawn(myEnemyPrefab)

// Use Despawn() instead of Unity's Destroy() to de-spawn an enemy for reuse
PoolManager.Pools["Enemies"].Despawn(enemy);

then two functions can be implemented as custom actions and use directly within playmaker environment. I'll do them custom actions probably before the end of the day ( they are simple enough).


 Maybe someOne else has already played with this and will be able to confirm all of this.

 Bye,

 Jean
Title: Re: Playmaker & PoolManager2
Post by: jeanfabre on January 12, 2012, 03:22:47 AM
Here we go,

http://hutonggames.com/playmakerforum/index.php?topic=1007.0 (http://hutonggames.com/playmakerforum/index.php?topic=1007.0)

http://hutonggames.com/playmakerforum/index.php?topic=1006.0 (http://hutonggames.com/playmakerforum/index.php?topic=1006.0)

it's untested but should work. If I get a chance to get Pool Manager 2, I'll port the whole api, it's quit complete and well done it seems.

Bye,

 Jean
Title: Re: Playmaker & PoolManager2
Post by: LuminRabbit on January 26, 2012, 10:17:00 PM
WOW Thats Awesome Jean!!! and soooo fast :)

I think every one will benefit from this, pooling is a must when developing for mobile platforms and I seriously appreciate it!!!!

Sincerely,
Michael
Title: Re: Playmaker & PoolManager2
Post by: jeanfabre on January 27, 2012, 05:24:31 AM
Hi,

 Thanks,

 I have some more actions that will be released sometime next week, to create pools at runtime. So stay tune.

Bye,

 Jean
Title: Re: Playmaker & PoolManager2
Post by: Mark_T on February 05, 2012, 06:57:11 AM
Many thanks Jean!!
Did I said I love you? :)

Title: Re: Playmaker & PoolManager2
Post by: justifun on February 13, 2012, 03:35:58 PM
Any progress on the poolmanager 2 api porting jeanfabre? or are there still bugs to sort out with the beta/poolmanager?
Title: Re: Playmaker & PoolManager2
Post by: jeanfabre on February 14, 2012, 02:23:07 AM
Hi,

 Yes, One action is still causing problems.

 Can you wait a bit until Unity and playmaker are out of beta ( very soon apparently). then I'll be able to allocate some time on this.

 thanks for your patience.

 Bye

Jean
Title: Re: Playmaker & PoolManager2
Post by: sicga123 on March 11, 2012, 03:48:12 AM
Hi Jean

I was wondering whether you managed to do the API actions for poolmanager 2?
Title: Re: Playmaker & PoolManager2
Post by: jeanfabre on March 12, 2012, 01:45:54 AM
Hi,

 Yes, worked on it some more last week, I am uploading hopefully towards the end of today, creating the wiki page and all this.

Bye,

 Jean
Title: Re: Playmaker & PoolManager2
Post by: Mark_T on March 12, 2012, 02:46:00 AM
That`s great.
Thank you, sir.
Title: Re: Playmaker & PoolManager2
Post by: justifun on March 12, 2012, 10:26:31 AM
You're the best Jean!

(and alex :) )
Title: Re: Playmaker & PoolManager2
Post by: jeanfabre on March 13, 2012, 04:13:26 AM
Hi,

 Here we go:

https://hutonggames.fogbugz.com/default.asp?W839 (https://hutonggames.fogbugz.com/default.asp?W839)

 I only have 2.5 so if you can test against the latest pool manager (2.6), and get back to me if you run into some troubles ( should be fine tho).

 Ill be working on some scenes to ship to help understand how to work with playmaker and pool manager. Sometimes next week I hope. Meanwhile, if you have any questions, don't hesitate :)

Bye,

 Jean
Title: Re: Playmaker & PoolManager2
Post by: Mark_T on March 17, 2012, 05:44:14 AM
Hi Jean,

I`ll be very gratefull if you can help me with some sample scenes with the new PM2 actions in action. :)
I can`t make it to spawn under any circumstances. :(
Thanks a lot.

Title: Re: Playmaker & PoolManager2
Post by: justifun on March 17, 2012, 09:13:53 AM
I've been having issues as well, I can't even import pm2 by itself without getting errors.  I let the guys over there know, but haven't heard back yet.
Title: Re: Playmaker & PoolManager2
Post by: Mark_T on March 17, 2012, 06:46:07 PM
Hi Jean,

It`s working. Sorry for the false alarm. It seems it`s really not a good idea to work when your mind is not clear enought.

It might help someone, so I`ll post the steps I`ve done:
1. Create a new scene and an empty object and create a new FSM
2. In the first state(CREATE POOL) add the Pmt Create Pool action and type the name of the pool. Set "FINISHED" as the pool created event.
3. Add a second state(SPAWN) and drag the Pmt Spawn action. Type the pool name (the same you created in the first state and drag a prefab in the game Object field. I had an animated object prefab, just to make things easier to see the spawned objects. Set "FINISHED" as the Success Event
4. Create a third state(WAIT) and add the Wait action and set the time to 3s.
5. Link all the transitions:CREATE POOL-->SPAWN-->WAIT-->SPAWN
6. Hit play.

I also created a string variable with the intention to use the variable as the pool name but it didn`t worked. I`m too tired now to see why, maybe it`s a bug, maybe not.

Again, Thank You Jean. :)


Edit: I used Unity 3.5 and Playmaker 1.3.2

Title: Re: Playmaker & PoolManager2
Post by: justifun on March 17, 2012, 09:21:43 PM
Which version of unity 3.5 are you using ?  3.5b6?

I can't import pool manager without it giving me errors :(
Title: Re: Playmaker & PoolManager2
Post by: Mark_T on March 18, 2012, 04:22:29 AM
Unity 3.5.0f5, Playmaker 1.3.2 and Pool Manager 2.6
Title: Re: Playmaker & PoolManager2
Post by: jeanfabre on March 19, 2012, 01:07:50 AM
Hi,

 I am currently cleaning up the samples I used to etst all them actions, so I'll release them sometimes this week. Then you'll get something to start with instead of learn it the hard way :)

playmaker and pool manager together gave me some weird things when importing packages, that might be linked to the issue you are having, so make sure you get the latest from unity, playmaker and pool manager 2 and restart Unity after you have imported everything.


Bye,

 Jean
Title: Re: Playmaker & PoolManager2
Post by: Mark_T on March 19, 2012, 05:14:46 AM
Cool. :)

While I was working to the tower defence game, where, of course I run into many and so different problems :(, ???, :-[, >:(, :o, :(, I was thinking how can I use Pool Manager with ArrayMaker, to instantly place/spawn the instances in certain locations. I didn`t tried yet to find a sollution to this, but while we`re here, I thought it doesn`t hurt to ask. :)
Many thanks Jean, looking forward to play with your test/example scenes.

Cheers,

m_t

Edit: I`m also curious about your progress you mentioned regarding ArrayMaker.
Title: Re: Playmaker & PoolManager2
Post by: TKnebel on March 19, 2012, 07:48:16 PM
I'm also looking forward to the update Jean
Title: Re: Playmaker & PoolManager2
Post by: jeanfabre on March 20, 2012, 01:23:51 AM
Hi,

 I have hard deadlines for end of march and mid april, so really I am not expecting having some descent free time until after that. Meanwhile do not hesitate if you have questions on this forum or you have some very important deadlines involving pending work of mine.

bye,

 Jean
Title: Re: Playmaker & PoolManager2
Post by: amaranth on April 23, 2012, 01:59:46 PM
@justifun
That happened to me as well. To fix, re-import the file from wherever it is stored on your computer. On my PC, it's %appdata%\Unity\Asset Store\Path-o-logical Games LLC\Scripting\PoolManager.unitypackage

@jeanfabre
Loving these wonderful tools!

@Mark_T
Thank you for listing those steps. Saved me loads of time! Still figuring out how to get my creatures to appear, but it's probably something simple. (it was. note to self = don't use pool as variable :) )
Title: Re: Playmaker & PoolManager2
Post by: justifun on April 23, 2012, 02:44:04 PM
Got mine working when i updated to unity 3.5.1
Title: Re: Playmaker & PoolManager2
Post by: amaranth on April 24, 2012, 08:26:22 PM
Yeah, that fixed a few things for me.

Jean, I think these new actions are great, but I've run into one problem: how do you set the position of the objects you've created from the pool? With my game, all objects are spawned at 0,0,0 and I'm not sure how to change this.
Title: Re: Playmaker & PoolManager2
Post by: jeanfabre on April 26, 2012, 02:41:34 PM
Hi,

 The Pmt Spawn action accepts a gameObject to define the spawning position and rotation.

so, create a dummy gameObject, used only for that purpose ( it can be the gameObject hosting the pool actually), and move that where you want to spawn.

 Does that make sense?


Bye,

 Jean
Title: Re: Playmaker & PoolManager2
Post by: amaranth on April 30, 2012, 01:23:44 PM
Got it! Spawn Transform = spawn location.
Title: Re: Playmaker & PoolManager2
Post by: gamedivision on January 15, 2013, 04:11:54 PM
Here is what I'm trying to achieve
20 different objects
have them spawn from 2 locations at random times,almost like a firework display 1sec spawn 3 objects when they despawn after hitting the trigger then another sec later spawn 1 and on and on and on 5,7,2,4 so on and so forth.
so as a test scene i created an empty game object which is the spawner,added the spawn pool script created a prefab of a box with force attached so when its spawned it flies straight into the air,when it falls it hit a collider object which is the trigger and despawns the flying box,that sends an event back to the spawner telling it to spawn the original object.creating a loop as such.
heres the problem every time that object  gets spawned it appears smaller and squashed,i'll create a video to show you