playMaker

Author Topic: Utterly basic problem with no solution?  (Read 2842 times)

TVISARL

  • Junior Playmaker
  • **
  • Posts: 50
Utterly basic problem with no solution?
« on: December 24, 2023, 10:46:31 AM »
Ok, OK, I'm hopelessly dumb and my wife would agree with you. Let's try to follow on my previous post, if you don't mind.
So I've got this car controller FSM and I want to re-use it in other cars in other games. I thought that templates might provide a solution. So, having saved my FSM as a template, I tried to re-use it in another car in another game.  It was a different asset, of course, but it had the same number of wheels with exactly the same name in the same place for the wheels and their colliders.
But I was stopped instantly with  the message "A prefab can't reference a scene object" or something like that. Which means, for me, that  a template is a piece of code attached to an asset, possibly a prefab, and that the two can't be considered separately.

I've looked at the tutorials in YouTube but that didn't help. Yet in principle what I want to do is very, very simple: take a bit of code and attach it to another asset (possibly in another game) that has another name but the very same structure. In earlier days a simple copy/paste would have done the trick. And even today there's no problem if I use a script and not Playmaker.

Would anyone be charitable enough to help the poor dumb guy?

Thierry
« Last Edit: December 24, 2023, 01:07:29 PM by TVISARL »

TVISARL

  • Junior Playmaker
  • **
  • Posts: 50
Re: Utterly basic problem with no solution?
« Reply #1 on: December 26, 2023, 06:27:13 AM »
Well, I think that I am beginning to see the solution, at least for my problem that seems to lie in the true nature of Playmaker (which, I say emphatically, is in itself a most excellent product). Simply, in my opinion it's not made for that sort of things.

You see, my frustration comes from the fact that the difficulty (re-using the same FSM with other cars in other projects) would be simply non-existent with C# scripts: changing a few character strings with the most basic of text editors would do the trick in two minutes.

I'm coding a small "proof of concept" project that should be ready in a few days.

Thierry

PS: thank you for your interest.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Utterly basic problem with no solution?
« Reply #2 on: December 26, 2023, 06:47:02 AM »
Hi.
If your template has references to Global variables you can ignore the message.

If you created a template from a fsm inside a scene that has references to other objects in the scene, you need to set those variable to be exposed and make them empty, then create the template.

TVISARL

  • Junior Playmaker
  • **
  • Posts: 50
Re: Utterly basic problem with no solution?
« Reply #3 on: December 26, 2023, 08:19:35 AM »
Hi, Djaydino.
I tried to use Global variables (that was an obvious solution) but it didn't seem possible.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Utterly basic problem with no solution?
« Reply #4 on: December 26, 2023, 10:06:40 AM »
you need to add the global variables in your new project before you import the template.

but its also recommended to minimize using global variables

TVISARL

  • Junior Playmaker
  • **
  • Posts: 50
Re: Utterly basic problem with no solution?
« Reply #5 on: December 28, 2023, 11:26:41 AM »
I have created my "proof of concept" project, making an ass of myself as usual.

Here is the link: https://www.mediafire.com/file/v8vzwij1szeptwm/Assets.zip/file

The car controller uses some actions that come from the Ecosystem.
There are two free cars from the asset store. As far as I can see they are perfectly identical from a logical point of view. Yet the orange one works and the blue one doesn't. The orange car has been used to create the car controller FSM, and the blue one uses the same FSM converted to a template (stored in the usual "Playmaker" subfolder).

And now, will someone be kind enough to tell me what's wrong? Thanks in advance,

Thierry

PS: Please spare me any expressions of supreme disgust and contempt, I'll be unimpressed. You see, for seven years I've been a Customer Support Manager at Hewlett-Packard and as such I've been told time and again that for Support professionals there are NO stupid questions.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Utterly basic problem with no solution?
« Reply #6 on: December 29, 2023, 09:14:56 AM »
Hi.
Can you maybe show some screenshots or video of the fsms/states/actions.

If you have references to game objects, make sure to use a variable.
and expose that variable.
Then after create a template, place the template on another object, (create fsm/ add template)
Then you should see the exposed variables on the fms component, place the corresponding object there (for example wheels)

oh btw, the playmaker community is very friendly and helpful (not like the unity forums)

If you have discord, you definitely should join the Playmaker channel.
there are lots of beginners/intermediate/expert playmaker users.
And friendly people :)
« Last Edit: December 29, 2023, 09:21:28 AM by djaydino »

TVISARL

  • Junior Playmaker
  • **
  • Posts: 50
Re: Utterly basic problem with no solution?
« Reply #7 on: December 30, 2023, 11:15:07 AM »
Many thanks, djaydino! The whole thing works like a charm and this problem of variables had completely escaped me.
And you have also perfectly understood my problem with Unity forums: my last contact with them was so unpleasant, so deliberately ... insulting that I decided to avoid them at any cost in the future.

I'll follow your advice right now and join the Playmaker Discord channeL
« Last Edit: December 30, 2023, 11:17:14 AM by TVISARL »