PlayMaker Help & Tips > PlayMaker Help

Pmt Despawn in custom poolmanager 2 actions [SOLVED]

(1/2) > >>

alternativee30:
My problem is as follows
I am setting up a state machine to spawn / despawn two different characters on alternating intervals for a custom character generator. Right now the state machine i am trying to implement will switch between male and female prefabs.

After i use the Pmt Despawn action and drag my prefrab to the applicable state i am told that my prefab does not belong to my Spawnpool. I am guessing this is because the prefab i dragged to the action does not have the -(clone)001 tag on it. however i cannot figure out how to preload this prefab (with the clone tag) except at runtime but those settings do not get saved to after play is stopped.

Using the exact same method for the pmt spawn action i have no problems while spawning.
I was able to glitch it out and despawn my character using the pmt spawn action but that accidental functionality went away sometime yesterday.

I am very new to "scripting" and playmaker has been a lifesaver for me who knows little to nothing about code.  
all help is much appreciated.

jeanfabre:
Hi,

 It looks like you haven't set up the pools properly based on your requirements. Could you send ma a private message, I think I would need to have access to the project to try and solve this.

 Bye.

Jean

alternativee30:
After reading around the forum this seems to be one of my problems. i am not exactly understanding yet how to plug an object via script at runtime but i will continue searching.

http://hutonggames.com/playmakerforum/index.php?topic=1647.0

jeanfabre:
Hi,

 you can access a prefab from a pool via its name if I recall, which means you can overcome this problem of referencing other objects of the scene within the prefab. Note tat this restriction only apply DURING editing, at runtime, you can maintain references of objects in a prefab, so you can create a routine when a prefab starts to find another prefab or something like that, or store that reference in a global var and access it in your prefabs.

 Bye,

 Jean

alternativee30:

--- Quote ---Hi,

 What I do to overcome this limitation is to plug things are run time like Alex mentionned, this works very well, but you need to be very organized ( cause you would reference the Fsm by typing its name instead of selecting it from a list, since you won't get all the playmaker actions ui helpers during author time ( since you can't reference it, playmaker can't give you any drop down list of Fsm).

 Bye,

 Jean
--- End quote ---

I am having a hard time figuring out how to accomplish this. how would i go about typing it in by name instead of selecting it from a list? I have tried the following javascript as well with no success.


--- Code: ---
function HumanMaleDespawn () {

PoolManager.Pools["CharacterSpawner"].Despawn("humanmale(Clone)001");


--- End code ---

It results in the following error

Assets/scripts/CharGen/HumanMaleDespawn.js(4,46): BCE0023: No appropriate version of 'SpawnPool.Despawn' for the argument list '(String)' was found.

Navigation

[0] Message Index

[#] Next page

Go to full version