Forum rules - please read before posting.

Toggle Cursor.. DOES IT WORK?

edited March 2015 in Technical Q&A
Look, Ive been faffing with this for 2 weeks now, and although Ive managed to do some other stuff, this MAJOR thing is still bugging me.

A UFPS Player.. (re-built this 3 times to see if this was the prob)
InputManager I have added an Axes called Toggle Cursor (I was told to somewhere)
I noticed that it appeared in the UFPS input manager too, bound differently, so I changed that.
I have bound it to RIGHT mouse.
The Idea being that if they want to get something from the Inventory window, they can right click, their character will FREEZE and the mouse cursor, which is usually fixed in the center of the screen, is released and can float up to the Inventory, OR generally manipulate menus.

But whats is ACTUALLY happening, is that when you click Right Mouse, the screen freezes, a second, smaller cursor appears  little way above the original cursor.
IF you right click while hovering over a hotspot that is showing a pop-up text, that text will move up a little too... I guess it uses the cursor coordinates..
But no free moving mouse... or whatever its called...

ALSO (maybe this is a hint) It DOES WORK in the Escape (pause menu) . So if I hit escape, up comes the menu, the view IS locked, I CAN move around with the mouse, it causes the green rollovers to happen on the menu, BUT.. if I click... say the options element, I then enter THAT menu with audio levels etc, and as I say, the mouse is just frozen now... so i cant select anyrthing, but I CAN hit escape and the whole menu shuts and Im back in game...


Im particularly frustrated now cos I was trying to get lift doors to open and close AND make sounds, I tried to use the sound object, set it to SFX, and cant hear anything, but then I remembered all the levels are right down on the pause/options menu, BUT I CANT CHANGE THEM CO MY F***ING MOUSE IS NOT MOVING!!!

PLEASE for the love of god.. can someone tell me what to do...
What do you need a screenshot of to find out?
What info will help you troubleshoot me?
How much money do you want?

HOW do I get the right mouse to release the cursor so I can interact with menus??? 

Yours In anguish..

MArk

PS: Heres a great Idea for a game... Save an lonely Game Developers life, by quickly removing knives and ropes and pills from his path (or alternatively responding to his frantic forum posts)... 
Its called "Stop the Suicide! 
Its yours for free, if you send flowers...
«1

Comments

  • Oh and I still cant jump!
  • Oh dear.  I'm sorry you're having such a problem with things.  But like I've said, the next update will refine how UFPS and AC work together.  I've been through every part of it, including menus, jumping, cursor toggling and weapons, and all seems good now.

    The mouse cursor should unlock automatically when you enter a pausing menu (one that has "Pause game when enabled?" check in the menu's properties.  If you want to unlock the cursor during a non-pausing menu then you can use the Player: Constrain Action to disable free-aiming.

    That's the idea, anyway.  If there's some issues in that department with your current version of AC, that's something I'm looking to have fixed with v1.43.  I'm planning for it to be out this week.  Now while I do intend for it to solve these issues, I will endeavour to clear up any remaining ones that might linger.  Don't worry - this'll be sorted.
  • edited March 2015
    Yeh I find UFPS and AC dont mix as good as they could (and lost my shit over it a few times too hehe), right now I have a solution where I simply flip between a prefab of a working UFPS guy to a working AC guy by pressing F5. This has its draw backs but allows you to get them to play perfectly together, so long as you can cope with one or the other. For me this is ok, but I would love to see if Chris can really get them juicing even more nicely together. It would be cool if you could pick up guns, wield them, shoot them, AND also click on hotspots etc, that is why I asked earlier how to swap AC interactions to the right mouse button Chris :-) In short, I think people want it to be exactly UFPS, but with all the benefits of AC (hotspots/interactions etc) - I know this might be a tall order, and not what AC was designed for, but if it works it will spawn a whole new genre of amazing AC games, so I pray it is possible to mesh them even more beautifully.

    Anyway here is my script that I use for now, if it helps anyone:

    Oops, wouldnt let post all the code, link is here http://pastebin.com/f0F1gt2Y

  • Thanks for posting, @radiantboy.  Certainly, having UFPS with AC's added benefits is exactly the intention of the integration.  Up until it's most recent release, UFPS made such an integration actually quite difficult - but the latest update has made this significantly easier.  I'm doing my best to take full advantage of it, so please check it out once 1.43 is released!
  • Will do man thanks very much, yes UFPS is coming on in leaps and bounds ! Cant wait for 1.43, keep up the good work.
  • Chris I see its out, and makes life easier. But its still not designed for non passive games right? Like being able to be an all guns blazing FPS which is also a FPS point n click? So my script to swap between them is still relevant, I guess I will start working my game mechanics around this, unless you have plans to further integrate UFPS and AC in the future? If not no worries, we have to write code sometime :) Us asset users are getting beyond spoiled hehe.
  • radiantboy
    ChrisIceBox
    I havent had a chance to try yet. Also thanks for posting your code Radiant, but I dont think its quite the functionality I need.

    Exactly WHAT functionality has been a head scratcher for me, Im sure its the same for you.

    The thing is, we both WANT a 1st person FPS (lets not get confused by the new UFPS ability to have 3rd person/visual body for now...) but we also want the interaction with invenotry stuff that AC brings.

    The main AC bonus for me tho is just the ABSOLUTELY AMAZINGLY SUPERERLATIVE game creation tools.
    Re-making a strange teleport thing in my game last night that I had previously made via a clunky system of UFPS sending a message to PlayMaker to move the player seamlessly somewhere else on the same map, via a super quick fade to black, was pure simplicity and joy in Adventure Creator

    But to my point:
    Heres my headache: If you disable the mouse (for FPS play) you need to first make a keyboard input freeze the player, and release the mouse pointer, BEFORE you can interact with either an onscreen menu, OR the inventory. (your functionality I thing Radient)

    So I got to thinking..(As a result of a bug I had where mouselook only works on press down of right mouse)
     BUT.. what about all those games with loads of menu clicking AND running about.. for example World of Warcraft? What their set-up?
    Now I cant confirm this, I dont have it installed anymore, but questions posed to friends to still play WoW gave me a revelation! 
    (cue choir music and sparkly particle effects)

    The problem is NOT in AC, but in the UFPS movement method! And thinking abit backwards!

    So what if you can move you mouse the whole time? (so you can interact with menus) Then the player will wobble all over the place right? NOPE.. NOT if the mouse DOESNT turn the charater.
    NO! but then HOW do you turn? I hear you mutter...
    Simple (ok I dont know how to do this in UFPS, but it cant be rocket science)
    WASD
    W forward
    S back
    A and D are STRAFE right??? NOT TURN:.. change them to TURN and bingo, you dont NEED to mouse swivel, you can run anywhere!
    Of course you can now map A PRESS DOWN OF RIGHT MOUSE to still do the mouse look, so its there, for looking up and down and around (and this can still be mapped to mouselook in the Oculas Rift camera)

    So now, you are running around corridors and selecting in the inventory at the same time!

    Now all we need to do, is hook up a USE click in the inventory with the weilding of weapons code in UFPS.

    So all game functionality is now simply to click in the inventory for everything, if its weild-able, (torch, gun, axe) then it pops into you hand, selecting something else (letter) appears fullscreen to read, or useable (key) sticks to mouse so you can drag and drop it... YOu decide... what item does what... the user just knows.. (I just have to click the inventory!)

    Now..

    Can I have this please?

    :)

    MArk






  • As you said yourself, that's on the UFPS side of things - not an AC one.

    But as it happens, v1.43 is now out, and with it the stability improvements to the UFPS integration, meaning whatever code changes you might need to make for your own game requirements will be much easier to make.  Perhaps none will need be made, but again - looking left and right with the cursor keys is a UFPS request.

    As for freezing the cursor, it's not necessary to require the player to toggle the cursor manually through input (the ToggleCursor button).  There are two other ways you can do it:

    1) If a pausing menu is turned on (like the default Pause, Options, Save and Load menus), then the cursor will unlock automatically.

    2) You can use the Player: Constrain Action to disable free-aiming.  If you tie this into a menu's "ActionList on start" field (and vice-versa), you should be able to allow menu-clicking in a non-pausing-menu without the need for player input.

    The updated UFPS tutorial will guide you through the new process.
  • Man I can sympathise, when something acts weird like that without any clear indication you're ready to tear your hair out. Are you on Unity 5? I had a similar experience last week after upgrading (not an AC project btw) because Unity deprecated the commands used to lock the cursor and put in new ones that work a bit differently. I don't know if that might be causing your problems, I saw a post describing the same issue with UFPS somewhere on the Unity forums I think, with tips on how to upgrade UFPS' cursor lock code, so it might be. I managed to get it working on my end too, so if you think that's the problem and need help just holler and I can share my code.
  • So I tried with the new prefabs, theyre much closer to what I want! I was able to shoot and select AC hotspots ! But, once I did shoot he constantly continued shooting without me pressing. And the guns did not show up, is that to be expected Chris? I think if you did a video tutorial it might be easier :) 

    Much better so far though!
  • @radiantboy: Try out the SimplePlayer prefab.  Does that have the continuous shooting effect?  I managed to get that bug fixed specifically with that prefab.

    I'm assuming you mean when you left-click to shoot and interact at the same time.  For that reason, there's a new option in the Settings Manager to only let interactions respond to right-clicks - if your interaction method is "Context Sensitive", just move your Interactions to Examine types and you can shoot and interact separately.
  • edited March 2015
    Ok so I ran it again (with AdvancedPlayer) and guns did appear (they seem to always be appearing now so forget that) and continuous shooting only happens sometimes, not always. And no I did not mean when you shoot on an interaction point, that seems to make him constantly shoot as often as normal shooting, but when it works, he shoots once then the interaction happens, id expect that. Awesome on the new separate interaction mode too!  Will try that.

    OK So with simpleplayer he behaves the same for me, constantly shooting, the muzzle flash seems to take up the entire screen too. And once he starts shooting he keeps going, no mouse look even - this is the same as the advanced player but you can swap guns to stop this happening, but it seems the simple guy has only one gun (I never used him).

    In short Id say its almost perfect, just that repeat shooting bug, if it is UFPS related (and want any suggestions) maybe you can paste some code  I am semi skilled in ripping UFPS apart. 

    Forgot that the Mace doesnt (always) swing either :) 

    EDIT: He only repeat shoots when you hold fire down too long, if you tap very fast, he will not keep shooting, that is a decent hint I think.

    Also, once that is fixed, I am gonna try set up a prefab that contains the HD hero, all the HD weapons and all the none HD weapons, If that works, and you can swing mace, toss hand grenades (!) and not get the repeat shooting bug, we are really cooking with some serious FPS making gas!.. Im so excited now that this could finally be a perfectly working system for FPS developers too. Im going to try out the shooting and interacting separately tomorrow too.. Great work!..
  • If the shooting is continuous and not involving interactions, I'm not sure whether this is an AC or UFPS problem, since AC shouldn't be doing anything at that point.

    Does this problem occur if you just use the standard SimplePlayer prefab, non-AC?
  • Ive had this before with UFPS.. that time it was PlayMaker related..
    http://visionpunk.vanillaforums.com/discussion/700/wont-stop-shooting-till-clip-is-empty#latest

    Dont know if this is a simerlar issue
  • OK I have now installed 1.43.

    No changes here perceptible at all.

    Please tell me, Are EITHER of you ACTUALLY getting ToggleCursor to work? Can you press that key and THEN, your mouse us free to move up to the inventory, where it will then pop down?
    Its that happening with you?
    Cos its not here.
    When I press Left Alt (for Toggle Cursor) the inventory opens and the cursor jumps up to the centre middle of the inventory drop-down. BUT frozen, cant move a thing.

    Im SURE its my inputs, or something in the UFPS input window (dont understand why UFPS has its own input panel, doesnt it cause clashes..?)
    If one of you would be so kind as to post your inputs for mouse...


    (no continuous shooting tho :)


  • No the problem does not occur on standard simpleplayer prefab non AC. It seems to be triggered by holding down fire too long.. oddly enough, im going to try debug it when im sober. Cheers, Gaz.
  • OK.. but just tell me.. Are you getting your Toggle Cursor to work, can you when presses, move the mouse to the inventory?
    Cos mines suck at the top...
  • If I hit "I" for example, the mouselook freezes, and I can then move my mouse around the screen freely without the camera moving, so I can select things from inventory etc, in the way I expect. So it looks like its working for me, I have had your problem though, seems ok now. I suggest starting completely from fresh with your character and using the prefabs supplied. If not working start with the demo managers for everything and build on them. If still messed up beg Chris :) I assume he is coming back to this thread, I managed to isolate where guns fire (vp_WeaponShooter.Fire()) but not why holding fire down causes an issue. Good luck mate, things are improving, so dont smash you head off the wall too hard.. I been there!
  • Thanks radiantboy. Ive been smashing my head quite abit, but I just solved a different (rather silly) issue. So theres one to tick off.

    In testing for that one, I made a clean scene, and poke my eye out with an old wet stick.. the Toggle cursor worked... Somethign else didnt, Mouse Look was only wokring on mouse down. but as I already said in this thread (scroll up) Actually I WANT that functionality.

    If I could get the AD keys to TURN my player not strafe, then have mouse look only on mouse DOWN, maybe onlt RIGHT mouse down (possible?) then I could leave menu mode running the whole time and just use the keys for movement, and be able to interact with menus/inventorys without using a toggle Button... Thats what I want now.

    I THINK thats the World of Warcraft approach, but its a while since I played that so I mught be mistaken.

    So Now I just have 3 ACTUAL bugs!

    Footsteps not working (getting an error about it actually)
    Jump STILL not working...
    Cant seem to pickup UFPS guns

    but there maybe more... haven't tested ladders or player damage..
    All stuff that WAS working in my game when it was just UFPS...

    Still I really want to get it working, cos actually building the "game stuff" with AC is a joy!
  • edited March 2015
    It seems you have to leave MainCamera on in the AC engine, at least to start the game then it can be turned off. Make sure there is no player in your scene, AC will put him there for you, use the AdvancedPlayer from the site,make sure you have UFPS 1.49 too. Make sure the mouse is in focused on unity when you hit play, guns and jumping work out of the box here, make sure your advancedplayer is tagged as player, the fps camera as MainCamera..make sure you are trying to pick up the compatible guns (not the HD ones).. trying pressing Q,E to skip left and right to activate guns maybe.

    Just a checklist to try out, cant guarantee any will work!! 

    PS. Make sure if you drag the player in to work on, you hit apply in the inspector, then turn him off.. maybe you arent applying stuff, that is well confusing to me.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.