playMaker

Author Topic: Template problem  (Read 1584 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Template problem
« on: June 02, 2016, 05:43:01 PM »
I would like to use templates, but I need to get the self name of an object.
How do you do that? At the moment, I have a variable with an object strapped onto it, but of course this can't work with templates: it keeps using data from THAT object for all the objects, and not from the owners.

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Template problem
« Reply #1 on: June 02, 2016, 05:54:36 PM »
I think that it might be the "Get Host Info" action thats on Ecosystem that you want- when you use it in a template it gives you the game object thats running the template and the name of the fsm the template is in-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Template problem
« Reply #2 on: June 02, 2016, 07:29:56 PM »
You can also use the Get Owner action that ships with Playmaker.
And then Get Name to get the name.

Not familiar with Get Host Info myself but that sounds like it could also work...

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Template problem
« Reply #3 on: June 03, 2016, 08:40:10 AM »
Lol I almost said that too, Alex. But then I saw Mdot's answer and thought it was better, so I deleted mine. Haha glad to know I was not all wrong :)