Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: TVISARL on May 05, 2020, 01:13:11 AM

Title: Problem with Run FSM[SOLVED]
Post by: TVISARL on May 05, 2020, 01:13:11 AM
Hi, all!

I am wworking on a game with vehicles, and every one of them has a set of standard properties which are defined as variables in an FSM named "Properties" (that's original) that is attached to the vehicle.
In itself, this FSM does nothing, it just exists with its variables.

Whenever the player picks a new vehicle, I run a template that uses "Get FSM XXX" actions to read its variables and make them accessible.

Problem: I get "Can't find FSM: Properties" errors.

Yet I have checked and rechecked:

- The new "Active vehicle" object does exist.
- It does have a "Properties" FSM that is active.
- There is no spelling error.

Can you help? Thanks in advance.
Title: Re: Problem with Run FSM
Post by: djaydino on May 05, 2020, 07:38:51 AM
Hi.
Can you show some images or video of your setup.

make sure to turn on debug so you can see the values (see bottom left on image)

(https://i.imgur.com/MfZgWWa.png)

also try setting some breakpoint to test if its working correct.
Breakpoints will pause the game reaching that state.
that state is NOT yet used, you can add a breakpoint after as well.

to eanble/disable a breakpoint right click on a state
Title: Re: Problem with Run FSM
Post by: TVISARL on May 05, 2020, 08:30:31 AM
Thanks, Djaydino; I'll prepare something ASAP.
Title: Re: Problem with Run FSM
Post by: TVISARL on May 05, 2020, 10:44:35 AM
Done, djaydino.

I thought that the simplest and most effective would be to show the thing itself, having deleted anything non essential to the problem.

Here it is : Link Removed (not allowed to share Playmaker in public)
The problem can be seen in the very first state of the single FSM attached to the Scene Manager object. I couldn't make it any simpler. Probably made an ass of myself, though.

Thanks for your help.
Title: Re: Problem with Run FSM
Post by: djaydino on May 05, 2020, 12:14:16 PM
Hi.
Its not allowed to share Playmaker.dll and install files in public.

Also its a lot faster for us to answer by looking to images or video, than creating and opening projects :)

We can't open a project if we don't have the correct version, which means we need look first what version it is, then install that exact version, or upgrade the project, which all takes a lot of time :)

if issue still can't be found then we can look to the project :)
Title: Re: Problem with Run FSM
Post by: TVISARL on May 06, 2020, 02:50:50 AM
"Its not allowed to share Playmaker.dll and install files in public.".

My mistake. Sorry about that, I should have thought of it and I've destroyed the zip file.
I'm preparing a few screen shots

Title: Re: Problem with Run FSM
Post by: TVISARL on May 06, 2020, 05:24:18 AM
Hi, djaydino!

I hope I'm forgiven my stupid mistake.
However, now you'll find four screenshots here:

www.tvi-sarl.com/FTP/Junk.zip

- Pic01 shows the FSM attached to the Scene Manager. The problem occurs right in the first state: Initialize.
- Pic02 shows that the Active Vehicle does have a "Properties" FSM that does nothing.It just sits there as a variables holder.
- Pic03 shows the template.
- Pic04 shows the console log.

Hope this is useful for you.
Title: Re: Problem with Run FSM
Post by: djaydino on May 06, 2020, 02:30:19 PM
Hi,
Quote
My mistake. Sorry about that, I should have thought of it and I've destroyed the zip file.
Np

On the run fsm its never getting the 'ActiveVehicle'.

on the run fsm template you need to 'Expose' the ActiveVehicle variable.
Select the variable, then at the bottom you will see a 'Inspector' check box.

Now it will show on the 'Run fsm' action. place the variable 'ActiveVehicle' from that fsm there.

run fsm can not automatically find variables on a fsm :)

On a side note, you can use (for example) imgur to place images and then place the images on your post :)
Title: Re: Problem with Run FSM
Post by: TVISARL on May 07, 2020, 04:53:18 AM
Thanks, djaydino. I'm sorry, but there's still something that I don't understand.

Please look at these four screenshots (I've changed a few names to make them mre readable).

www.tvi-sarl.com/FTP/Junk.zip       ( They're too large to be atached ).

I can create a variable of type "Playmaker FSM", but I don't see how to specify which one.

So, at the moment :
- The template needs to read an FSM Int.
- It knows the FSM's owner.
- But it doesn't know the FSM itself.



Title: Re: Problem with Run FSM
Post by: djaydino on May 07, 2020, 03:14:29 PM
Hi.
You can use https://imgur.com to place images.
Drag in you image on imgur, then get the link and place like the image below

(https://i.imgur.com/sqXBIi3.png)

(https://i.imgur.com/GwJY78x.png)

Double check if fsm name is correct as this warnings says it could not find the fsm named 'Data'

(https://i.imgur.com/It5RHVP.png)

Also turn on debug so you can see the variables

(https://i.imgur.com/Tm5eRqX.png)

Try setting the run fsm in a next state.

Then put a breakpoint on that state with the run fsm (right click state header and select breakpoint, select again to disable)

this will pause the game and you can see if the variable has the vehicle in it

During play, on the run fsm the edit button will change to 'Show'
press it so you can see what variable it has

(https://i.imgur.com/noDAa2K.png)
Title: Re: Problem with Run FSM
Post by: TVISARL on May 08, 2020, 12:08:08 PM
Got it at last!

In the template's Get Fsm Int action, the "Game Object" must be exposed as a Game Object variable, and the "Fsm Name" must be exposed as a string variable.

Many thanks for your help and patience, Djaydino.