Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: cabbageman on March 11, 2015, 12:29:44 PM
-
I'm making a point and click adventure game (using Adventure Creator) and I'm trying to implement a custom hybrid of straight point and click and click and hold to move; that being I want the player to be able to click on a spot on the navmesh to move there as well as be able to hold the mouse down to continue moving. Adventure Creator doesn't allow for this combination, but I *may* have a work around:
I put an FSM on the navmesh that detects a mouse down, going into a loop that continues until a "mouse up" event is sent, each interval of the loop waiting a short time. What I want to do is have a mouse down be sent to the system as if the player clicked again each time the FSM passes through this loop so that the navigation system will interpret this as continual clicking to move the character while the player is simply holding the mouse down. I'm basically trying to build a fully automatic clicking system for the navmesh. Is there any way to do what I'm asking? I was hoping there would be an easy way to send a "fake" mouse down to the system, but I can't figure it out.
Any ideas?
-
Hi,
simply use the action "Send Event" and select "MOUSE DOWN" it will fire.
however I strongly advise agsint doing so, instead create your own event "MY MOUSE DOWN" or "FAKE MOUSE DOWN", that you will fire using send event, and every states in fsm that use MOUSE DOWN and should also react on FAKE MOUSE DOWN simply implement both of these events.
Bye,
Jean
-
That was actually the first thing I tried, but it's not working for me... Does sending the "MOUSE DOWN" event simulate a click in the entire engine, or does it just send that event within it's own FSM?
I've attached images to show what my FSM looks like. It's very simple, but it also doesn't seem to do anything... The structure of the FSM works fine, as in when I click once on the nav mesh it returns to "waiting for click", and when I hold the mouse it cycles between "mouse is down" and "fake click" until I let the mouse up. The only problem is my "fake click" state doesn't act as a fake click.
-
Any ideas on how to make this work? Anyone? :(
-
I think you should try to simplify your issue here.
If all you want is Click-To-Move and additionally ClickDrag-To-Move then you can easily use MOUSE DOWN system event or the Get Mouse Down action to trigger when the mouse is down and transition to the next state.
Now just update the destination with a mouse pick and use MOUSE UP or Get Mouse Up action to go back to the waiting for click state.
The result will be a destination update when they click - guaranteed -, and it wont leave the state without them letting the mouse button go so you'll get constant updates if you want.
-
The reason for wanting to do it my weird way is that I'm using Adventure Creator for navigation, and I don't have any good way to control that beyond the stock settings it gives me. I'm trying to make a playmaker FSM to bridge the gap between what AC does stock and what I want it to do, for better or worse...
I suppose eventually it would be best to build a more custom system, but for now I was just trying to find an easy solution to add that functionality to our (already released) demo. We've got a kickstarter campaign starting up in 2 weeks, so I probably won't have time to build a completely new nav system for our demo, unfortunately...
Thanks for the suggestion though. Still open to other ideas that allow me to keep Adventure Creator's navigation!
-
Have you tried talking to the author of Adventure Creator? This may be a gap in their featureset for controls.
It's not possible to fake system control inputs unless you use a broker for your inputs. Like making a bunch of input variables that respond to real system inputs, but then you control them but manipulating them directly so your controls aren't slaves to the system inputs, but rather something you have direct control over.