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.


Topics - Codybean1

Pages: [1]
1
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;
            }
}



2
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.  :)

3
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.

Pages: [1]