playMaker

Author Topic: Re: finding the application used at runtime  (Read 2774 times)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: finding the application used at runtime
« 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://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

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

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

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

How would you recommend I resolve this issue?















 
« Last Edit: November 22, 2020, 04:19:34 PM by colpolstudios »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: finding the application used at runtime
« Reply #1 on: October 24, 2020, 02:55:47 AM »
Hi.
I would suggest using Rewired.

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.

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: finding the application used at runtime
« Reply #2 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

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?


colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: finding the application used at runtime
« Reply #3 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.

 
« Last Edit: October 24, 2020, 10:06:09 AM by colpolstudios »

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: finding the application used at runtime
« Reply #4 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.






   

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: finding the application used at runtime
« Reply #5 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

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: finding the application used at runtime
« Reply #6 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!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: finding the application used at runtime
« Reply #7 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

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: finding the application used at runtime
« Reply #8 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/

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.


colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: finding the application used at runtime
« Reply #9 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-coveron 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.














 

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: finding the application used at runtime
« Reply #10 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.

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: finding the application used at runtime
« Reply #11 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 :(

 

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: finding the application used at runtime[ Solved ]
« Reply #12 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/

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: finding the application used at runtime[ Solved ]
« Reply #13 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

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: finding the application used at runtime[ Solved ]
« Reply #14 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