Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: colpolstudios on October 23, 2020, 05:35:48 PM

Title: Re: finding the application used at runtime
Post by: colpolstudios on October 23, 2020, 05:35:48 PM
I have been obsessed for a while with the idea that with using playmaker I could possibly create a playmaker control using the standard unity input.

Research:

https://ritchielozada.com/2016/11/21/playstation-4-dual-shock-controller-input-mapping-with-unity-on-windows-10/ (https://ritchielozada.com/2016/11/21/playstation-4-dual-shock-controller-input-mapping-with-unity-on-windows-10/)

https://answers.unity.com/questions/1541001/getaxis-problem-going-from-mac-to-pc.html (https://answers.unity.com/questions/1541001/getaxis-problem-going-from-mac-to-pc.html)

http://makegamessa.com/discussion/3347/controller-input-in-unity-for-different-os-s (http://makegamessa.com/discussion/3347/controller-input-in-unity-for-different-os-s)

I am using a windows 10, but need to allow for the other possible like a Mac for example.

I have a demo its a Web GL one using the "third person cover shooter" I have added the ability to select either a playstation controller or a Xbox controller.

You also have the ability to change the mappings.

It is very much a work in progress but you may try it out here:

Very minor script changes where made!

https://colpolstudios.itch.io/playmaker-control-and-tps-cover (https://colpolstudios.itch.io/playmaker-control-and-tps-cover)

It will not work as intended if using a Mac!

In an effort to improve my project. I had looked at this, please see below.

https://hutonggames.com/playmakerforum/index.php?topic=6105.0 (https://hutonggames.com/playmakerforum/index.php?topic=6105.0)

A friend suggested using only C# and the "application.runtime == .OSXPlayer"

I was just thinking of using the get system info:

https://hutonggames.com/playmakerforum/index.php?topic=2972.0 (https://hutonggames.com/playmakerforum/index.php?topic=2972.0)

How would you recommend I resolve this issue?















 
Title: Re: finding the application used at runtime
Post by: djaydino on October 24, 2020, 02:55:47 AM
Hi.
I would suggest using Rewired (https://assetstore.unity.com/packages/tools/utilities/rewired-21676).

It supports many controllers, and for many platforms : pc / mac / linux / webgl / Android / Ios / consoles (ps4 / switch / ...)

It not free, but worth every penny.

I use it in all our projects.
Title: Re: finding the application used at runtime
Post by: colpolstudios on October 24, 2020, 08:10:29 AM
But I want to use "Playmaker".

So with some more investigation, I found this https://hutonggames.com/playmakerforum/index.php?topic=6105.0 (https://hutonggames.com/playmakerforum/index.php?topic=6105.0)

I added

#if  UNITY_WEBGL
                if(_flag == platformDependentFlags.UNITY_WEBGL) Fsm.Event(_event);   
#endif

As I am currently in Web GL build settings when I run unity the event will fire.

But this will be true for any operating system.

How do I check for a specific operating system?

maybe I should check: UNITY_EDITOR_OSX and UNITY_EDITOR_WIN after the initial test for Web GL within the next state?

Title: Re: finding the application used at runtime
Post by: colpolstudios on October 24, 2020, 08:48:49 AM
Hmmm, It didn't work in Web GL.

The only query that worked in Web GL was the platform dependant events.

The Get system information does not work in Web GL.

But it works within the editor.

 
Title: Re: finding the application used at runtime
Post by: colpolstudios on October 25, 2020, 07:36:45 PM
I officially ask for help from JeanFabre to help!

How do I query within a Web GL application what system is being used to play?

I need to distinguish between either a windows operating system or a Mac operating system when the game is beng played on Web GL.

The goal is to be able to target if the user is using windows or a mac pc when actuallly palying.

To date I cannot find a way to do this and require your help.






   
Title: Re: finding the application used at runtime
Post by: djaydino on October 26, 2020, 12:09:16 PM
Hi.
There are 2 actions on the ecosystem called 'Get System Informations' and 'Get System Info'

I think they are both similar.

But you can get all kinds of info like 'operating system' and 'device model' for example.

Maybe that can help
Title: Re: finding the application used at runtime
Post by: colpolstudios on October 26, 2020, 02:09:48 PM
I tried using the get system information store the string and then use string compare if = Windows 10  (10.0.0) 64bit then show a UI box with the word "windows"

Although it works in the editor this doesn't work in Web GL.

Here is a quote from a Mac user in regard to my Web GL when playing it.

"Good news, it seems I found a problem…

Most likely you’re using Windows, but I’m using macOS… And as I know there is a difference between axises on Macs and PCs. For example, the right stick on DualShock has 4th and 6th axises on Windows and 4th and 3rd on macOS.

Also, I have the same issue with your project"


I am using windows so for me when I play everything works.

So this is proof that when playing a Web GL your operating system is taken into account.

If we could find out how this happens then possibly I can work around it.

There is also another strange quirk with a PlayStation controller, but here again only in Web GL mode.

The D-pad is mapped in both directions to Axis 10.

If you are using this controller go to the mapping scene and press the d-pad you will note your input being correct :)

Took a long time to figure out, but I got there in the end!
Title: Re: finding the application used at runtime
Post by: djaydino on October 26, 2020, 02:44:36 PM
hi.

this might help for the user

https://www.howtogeek.com/275614/how-to-use-the-playstation-4s-dualshock-4-controller-on-a-mac/

i did search a bit on unity forums but so far i could not find anything there as well for webgl
Title: Re: finding the application used at runtime
Post by: colpolstudios on October 26, 2020, 04:58:40 PM
That is not truly feasible. Just think of all of the games posted on https://itch.io/ (https://itch.io/)

These games are played by different operating systems.

The whole point of using Unity is that you dont have to change anything just build in the desired platform.

Title: Re: finding the application used at runtime
Post by: colpolstudios on October 29, 2020, 08:13:37 PM
I have to say, I am devestated.

I have worked, long and hard developing my system using only playmaker. But playmaker is not the issue, unity is the issue!

I appreciate all of your input and help along the journey, I could not have done most of it without you.

So it seems we as developers are constrained to only using keyboard or UI input when using the Web GL platform.

I am still quite new to unity, but my builds show the discrepancies.

Dont believe me, play this: https://colpolstudios.itch.io/playmaker-control-and-tps-cover (https://colpolstudios.itch.io/playmaker-control-and-tps-cover)on windows and Mac.

All of the controls work for windows, but not for a Mac.

In some way when actually playing in web gl mode the system being used is taken into account, hence the changes.

The best person I can think of is Jean Fabre to bring this information to unity, they wont take me seriously im a newbee.

Oh just in case, I dont have or want rewired, I want to use playmaker.














 
Title: Re: finding the application used at runtime
Post by: djaydino on October 31, 2020, 02:48:26 PM
Hi.
Jean wont be able to help there neither.

And he probably also would suggest to use rewired.

He actually recommended it to me as well as unity controls sucks, even the new ones.
Title: Re: finding the application used at runtime
Post by: colpolstudios on November 04, 2020, 01:09:16 PM
Yes, I agree that even the new unity input system has issues.

But before I would purchase id need some proof that their system works in a web GL build.

ill take a look, maybe they have a demo.

Thank you for all of your help.

My project is dead :(

 
Title: Re: finding the application used at runtime[ Solved ]
Post by: djaydino on November 04, 2020, 03:51:52 PM
Hi.
you can ask on the rewired unity forum thread to be sure :

https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/
Title: Re: finding the application used at runtime[ Solved ]
Post by: colpolstudios on November 06, 2020, 09:28:37 AM
Hey, they have a free trial version.

I shall download and see what happens.

Thank you so much
Title: Re: finding the application used at runtime[ Solved ]
Post by: colpolstudios on November 06, 2020, 03:49:22 PM
Hello, me again.

Hey, my friend,

Would you do me a small favour, I have download the trial version of "Rewired" and created a very small Web GL test.

I have built a very small Web GL build of a ship that can move and shoot.


To move you can use W, A, S or D and spacebar to shoot.

OR

Hopefully will be able to use a joystick, left stick to move and either the "X" button on a PlayStation controller or the "A" button on an Xbox controller.

I need to know if this works with an.OSX system.

It does work on my windows system 🙂.

Kind regards

Colpolstudios

https://www.dropbox.com/s/uy672w2avrrxe18/testing.zip?dl=0 (https://www.dropbox.com/s/uy672w2avrrxe18/testing.zip?dl=0)
Title: Re: finding the application used at runtime[ Solved ]
Post by: djaydino on November 06, 2020, 04:35:40 PM
Hi.
I don't have a mac, but maybe someone else could have a try.

if no one replies you cold try a 'emulator'

https://www.makeuseof.com/tag/macos-windows-10-virtual-machine/
Title: Re: finding the application used at runtime[ Solved ] Require Mac tester!
Post by: colpolstudios on November 07, 2020, 09:28:08 AM
I don't fancy having to go through that process of the 'emulator'.

To the playmaker community. I need your help.

I need a Mac user to run a very small Web GL build and test does a joystick controller work for you!

You can use this free web service to test it out:

https://www.google.com/search?client=firefox-b-d&q=itch.io (https://www.google.com/search?client=firefox-b-d&q=itch.io)

Just do not publish it, you can still playtest.

Thank you so much for your time and support with this matter.
Title: Re: finding the application used at runtime[ Solved ] Require Mac tester!
Post by: colpolstudios on November 22, 2020, 04:19:16 PM
Hi there, a mac user-tested this and it works.

Personally, I don't have anything against the use of "Rewired" everything has its place.

For me, hey it's just me. I continue to work on my "Playmaker Control"

The main issues.

The users operating system is checked.

So far the only joystick giving any issue is the "Playstation Controller", then you have the additional issue of the controls changing if you are developing within the unity editor.

I have been able to overcome these issues, but I use windows as my operating system.

The chances of finding a Mac user who also uses a "Playstation controller" are rather slim.

But you're in luck as I have an Xbox controller as well, lol.

I'm unsure if anyone is following with my progress, but here goes.

The next step is to create a user-defined joystick, its possible but will require a lot of work.

"Playmaker" is an extremely powerful tool, full of possibilities!

Update: https://colpolstudios.itch.io/playmaker-control-and-tps-cover (https://colpolstudios.itch.io/playmaker-control-and-tps-cover)
 


Title: Re: finding the application used at runtime
Post by: colpolstudios on November 29, 2020, 07:27:18 PM
Despite my best efforts, within my "playmaker Control," I have conceded that my project will not be available for Mac / Apple users.

Using only playmaker and the standard unity input.

This is the current status of my project.

https://colpolstudios.itch.io/playmaker-control-and-tps-cover
 (https://colpolstudios.itch.io/playmaker-control-and-tps-cover)

Use your mouse wheel to scroll through weapons.

If you have time I'd appreciate feedback on this web GL demo.