playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Codybean1

Pages: [1]
1
Okay, so I got it to work. It was a simple matter of the else statement mucking it up because 'mouse0' appears later in the KeyCode list than many keyboard keys. I removed the else statement and moved 'store.Result.Value = false' right before the 'foreach'. I also got rid of the 'khit' variable and cleaned the whole thing up a bit. I wrote this all up as reference in case anyone in the future will try something similar. :)

Here's the final code:

Code: [Select]
void DoGetKey(){
            if (key==KeyCode.None){
                storeResult.Value = false;
                foreach (KeyCode vKey in System.Enum.GetValues(typeof(KeyCode))){
                        if (Input.GetKey(vKey)){
                            keyE = vKey;
                            if (key2.Value.ToString()==keyE.Value.ToString()){
                                storeResult.Value = true;
                            }
                        }
                    }
        }else{
                storeResult.Value = Input.GetKey(key);
            }
}

2
So I'm writing a custom action that is meant to work like Get Key, but it reads from a keyCode variable instead of a predetermined key set by the developer. This action currently mostly works as intended, but strangely doesn't work for a keyboard key when a mouse button is also held down.

To clarify, if the keyCode variable's value IS a mouse button, it works. If the value is a keyboard key, it works IF AND ONLY IF a mouse button isn't also being pressed, and I want the action to work for keyboard keys regardless if a mouse button is pressed or not.


Here's the code so far. StoreResult always returns false if a mouse button is held and a keyboard key is being tested, and I'm not sure why.
Code: [Select]

void DoGetKey()
{
            int kHit = 0;
            if (key==KeyCode.None){ //key is referring to the original 'key' variable in the old GetKey Action
                    foreach (KeyCode vKey in System.Enum.GetValues(typeof(KeyCode))){
                        if (Input.GetKey(vKey)){
                            keyE = vKey;
                            kHit++;
                            if (key2.Value.ToString()==keyE.Value.ToString()){
                                storeResult.Value = true;
                                continue;
                            }else {
                                storeResult.Value = false;
                            }
                        }
                    }
        }
            else{
                storeResult.Value = Input.GetKey(key);
                kHit++;
            } if (kHit == 0){
                storeResult.Value = false;
            }
}



3
When you use Get/Set Property on an FSM component, it will tell you the object the FSM is a component of, but it won't give you the same of the FSM. This can make programming very confusing if an object has multiple FSM components as you can't tell the difference between them when using Get/Set Property. The ability to see the FSMname when accessing an FSM using these methods would greatly improve workflow.  :)

4
Playmaker Help / Re: See FSMname in Get/Set Property actions?
« on: October 17, 2017, 02:50:24 PM »
Hi,

 ok, I see. then use the custom action "IsFsmEnabled" available on the ecosystem.

 As for the suggestion, I think it's a good point nonetheless, could you file a bug report as a suggestion to improve the get/set property interface? then we'll be able to keep track of it.


Bye,

 Jean

Sure thing. :)

5
Playmaker Help / Re: See FSMname in Get/Set Property actions?
« on: October 17, 2017, 12:02:21 AM »
EnableFSM works fine, but checking if an FSM is enabled or not still needs to be done through Get Property, not to mention whatever future uses I'd or someone else would have for a slightly modified Get/Set Property action. I just want to be able to see the FSMname in Get/Set Property if the targeted object has one. ;)

6
Playmaker Help / Re: See FSMname in Get/Set Property actions?
« on: October 16, 2017, 11:49:16 PM »
Hi,

 you are targeting FsmComponent with getProperty? what's your usage? I am curious.

 bye,

 Jean

Mostly to enable/disable FSMs, and sometimes to check if an FSMcomponent is currently enabled, then perform and action based on that. This stuff is usually manageable but being able to distinguish between them in the action would be wonderful.

7
Playmaker Help / See FSMname in Get/Set Property actions?
« on: October 16, 2017, 11:41:22 PM »
I've worked with Playmaker for some time now, but one thing that's always tripped me up is when too many Get/Set Property actions for FSMs get involved and it becomes pretty confusing when an object can have many FSM components yet the Property actions refer to them all as "Playmaker FSM". I'm aware that there's workarounds and special actions specific to manipulating the FSM components, but is there a simple way to see the name of the FSMcomponent I'm working with in the Get/Set Property actions?

Something like a check in the action to see if the targeted object is an FSMcomponent, and displaying the FSMname in the State Editor if the targeted object is a match is what I'm looking for.

8
Share New Actions / Re: Steamworks.NET
« on: January 27, 2016, 02:20:55 AM »
Hey guys. I've got a strange problem and I'm not sure what causes it to act so inconsistently regarding Achievements.

SteamManager.cs has no issues communicating with Steamworks to signal that I'm running the game. However, everything I do related to Achievements has basically been flying blind. "Steam Get Achievement" returns nothing, and "Steam Unlock Achievement" used to work actually, but has now always turned False when attempting to use it. I've closed both Unity and Steam multiple times and have updated the Achievement list on the Partner site, but I still can't quite seem to figure out what's preventing me from accessing Steam achievements from the Unity Editor like I used to.

It's come to the point where it doesn't matter if I initialize the Achievements or type in their IDs character-by-character. It just all results in failing to successfully unlock an Achievement, let alone get one's name as a String. I've even gone as far as to replace the Version 1.0.1 of SteamManager.cs that the Playmaker actions came with with a modified Version 1.0.3 and hope that it changes anything, but no.

I'd by more than happy to figure out what I'm doing wrong, because I've been at this all day. Help would be nice.

Pages: [1]