Need help with a touch command

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hey,
    I am having an issue doing a good touch command for movement using our own movement engine. Basically have this command.

    Repeat while left mouse is pressed
    + Mouse pointer is over object

    = Move the character.

    Now that works just fine, until i press on the shoot button. Once i press on the shoot button. which is using Fusion built in touch buttons. The character stops moving. So basically the above command stops working, and i have to release the screen and press it again.

    So basically i need to be able to be holding the move button and be able to press the shoot button and the character should still be able to walk. I am not using the Fusion Joystick. I am using my own movement buttons.

    Please login to see this picture.
    here is the 2 lines of code that i have. So i am pretty sure i have to correct the movement line for it to continue to accept that line while the shoot button is pressed. Anyone can give me a better way that i should do this. Thanks

    here is image link if that pic is showing up to small
    Please login to see this link.

  • you need to replace the mouse action with a touch action via the multi-touch object.

    the multi-touch object is basically like the mouse object and can read clicks (touches), but can handle several at once, something which the default mouse can't.

  • Yes, but how does it know which object i am over. I only see commands like:
    A new touch as occurred.
    How do i translate that touch to a button that i have on the screen. Do i still need to use a mouse command stating that the mouse cursor is overlapping an object? If so would it have to look something like this?
    Please login to see this picture.


    (Maybe i just don't understand how the Multi Touch Object works.)

  • I think you might need to compare the x and y of the touch and make sure it's within a boundary of the object you want it over.

    So something like this (if your hotspot is centered in your object). What i'm doing is basically drawing an invisible square boundary and figuring out if the touch co-ordinates are within it while the touch is occurring.

    The values below would be for a 32x32 sized object.

    A new touch has occurred
    + touch x > (active x - 16)
    + touch x < (active x + 16)
    + touch y > (active y - 16)
    + touch y < (active y + 16)

    - Do events

  • You could also have a 1x1 object and set its X and Y to the X and Y touch and see if it overlaps the object. You could loop through and have multiple of these associated with each touch, I think...

    Working as fast as I can on Fusion 3

  • I am sorry , but I am still having trouble getting this to work. I am not seeing a command that will allow me to do :
    touch x > (active x - 16)

    I am only able to check for a touch number. I do not find anything that allows me to check for a touch position.

    Please login to see this picture.

  • Ok, so this is what I got so far
    Please login to see this picture.

    However, this command does not seem to loop. This is an actual Up Arrow, so when user is touching this arrow. The player should walk up.
    So when i press on the arrow now. It basically just runs the command once. So i am getting close. Just need to figure out how to loop this touch command now.

    Thanks ahead for all the help so far.

  • The way I was talking about comparing the two values can be found under the special object and "compare two general values".

    Please login to see this picture.

    Then in the first box you would have x of touch (number whatever)

    then equals

    x active + 16

    etc.

  • I see in your screenshot you tried the x position value as the touch number. The touch number should be a value to represent which specific touch on the screen you want to test for, so a value of 0 for the first touch, 1 for the second touch and so on. This allows you to track events and get data from multiple touches to the screen.

    RhysD sums up the event condition you want to look into, but just to add to what he has said, when you select the Compare two general values condition you will get an expression editor up. On this editor, while the cursor is in the top edit box, you can click the "Retrieve data from an object" button and then you can get to a whole load of new parameters which includes the x positions of the touches.

    I've uploaded a modified version of an example file I made during beta that shows one method of dealing with multiple touches with the use of active objects. Hope that helps.

    Please login to see this link.

    Andy H @ Please login to see this link. - Please login to see this link.
    Retro Gaming @ Please login to see this link.

  • Ok, I am still having issues getting this to work correctly. If anyone would like to get this multiple touch command working for me.

    I will pay them $50 for the work.

    If interested, shoot me a instant message on Aol instant messenger: PowerRevRacing is the user name.

    I will put the game file in dropbox, so that you can setup, and give back to me working. I will remove all other lines of expressions from the file, so that it will be easy for you to do.

  • Post your file, i'm sure someone will do it for free. Screw having to pay half the cost of the exporter to get someone to help you! The community on the boards is more than likely to help out a fellow clicker for free :)

  • Please login to see this link.

    here is a link to my file. Hopefully someone can help me get this figured out.
    Please login to see this link.

    I simplified the file down so that all that is there is movement script. All in the event editor. This is a custom 4 direction movement.

    There is control in there for both joystick and touch screen. You dont have to pay any attention to the Joystick commands. I just need to get the touch commands to work as a multi touch.

    Thanks a lot. I am super behind on this.

  • I haven't tested it via a device (only in MMF2) but it's what I was talking about in my previous posts.

    You might need to change the "Touch LastNewTouch" to Touch LastTouch (edit the event and grab the LastTouch from the Multitouch object). I forgot which one to use. Last time I had to go by trial and error, but there should be some info on the actions in the help files somewhere.

    You probably will need it if you plan on adding the fire buttons you have on the side as well...

    Apologies if it doesn't work (in my head and mmf it is :() but it's late and I should be asleep ;) Hope it works!

    Please login to see this link.

  • So i was able to get it working in our game. Thanks for the help. If you have a apple device and would like a promo code to play our game. Shoot me over a PM and i will provide you with it. So you can download the game. Will be a few days before the update is out for the game though.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!