Neat Trick: Spawn Actor that Can Use Scene Specific Attributes

dotsonj23dotsonj23 Member Posts: 316
edited November -1 in Working with GS (Mac)
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

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    You cant delete my behaviors :( At least they only stay in the project there put in and dont appear in a new project.
  • MotherHooseMotherHoose Member Posts: 2,456
    right click on your game project file ... Show Package Content

    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!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    MotherHoose said:
    right click on your game project file ... Show Package Content

    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

    Wow, so many people have asked and even sous chefs have said you cant. Thank you!
  • dotsonj23dotsonj23 Member Posts: 316
    MotherHoose said:
    ...
    don't think that those personalized files are included in the builds.

    MH

    Thanks for the info on how to delete. Also, I figured a behavior I created might not make it to a build. But if it can't what the point of having the folder and the option to create the behaviors? Anyone actually tried to see if a My Behavior created behavior makes it to a build?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    You mean if it works correctly if you drag from my behavors into actor then run on device? If so then yes i works fine
  • dotsonj23dotsonj23 Member Posts: 316
    Yeah it works on GS viewer for sure. Just wanted to make sure worked in an actual build before I spent a lot of time creating behaviors. Thanks.
  • MotherHooseMotherHoose Member Posts: 2,456
    oh dear... sorry ... to clarify...

    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
Sign In or Register to comment.