Neat Trick: Spawn Actor that Can Use Scene Specific Attributes
dotsonj23
Member Posts: 316
I disclaim all credit for this as I dug it up in the forums from a past post (can't remember who posted it, sorry). But here is the deal. If you want to be able to spawn an actor in a scene but still have that actor use scene specific attributes you can do so. Here is how. 1. Create the actor. 2. Place the actor in the scene. 3. Add to that instance the rules and scene specific attributes you want. 4. Put them all in a group. 5. Drag the group over and into My Behaviors. 6. Delete the instance of the actor in the scene. 7. Open the protype actor and drag the Group behavior you just created in My Behaviors into the prototype actor (it will look like nothing was dragged in but it is there). 8. Now for your spawing actor in the scene have it set to spawn the prototype actor when touched (or whatever trigger you want). 9. Test. I did the above and this still worked in 0.9.0. My spawned actor used the scene specific attributes I had set up. Now I have a question, how the heck do I delete items from the My Behaviors folder. I did tested the above a number of different ways but I don't really want to keep those created behaviors. I looked under Resources in the content folder for GS but could only find the Pro Behaviors and the regular Behaviors folders and not the My Behaviors folders. If you know the answer to this question please post. Thanks,
Comments
behaviors folder will have your stuff... I delete the content....but, NOT the folder
also in the assets.xml ... you will see added behaviors with # ... I delete them.
don't think that those personalized files are included in the builds.
MH
Thanx for the tip/trick!
my action behaviors work in the builds ... they have been copied to the actors...
I meant that the actual folder content is not in build...
think of myBehaviors as a storage place for snippets of code with all the parameters you have added to the Behaviors in the GS Engine ... I like this functionality... especially if you have lots of actors that do the same thing... or to store Notes ... saves lots of programming time!
MH