![]() |
Mouse Control
I'm working on an NPC that will allow the player to use the mouse to move. The movement works, but I was thinking of adding more. First off, I need it to be able to fire the selected weapon when the mouse wheel is moved, then I need it to make the player pick up pbjects when the mouse wheel (or third button) is pressed. I thought it was just mousewheel and centermousebutton, but they didn't work, and I'm not sure how to work callweapon or get the player to lift objects with script. (Like pressing A)
|
Current Problems: (sorry for double post, but I'm stumped and the thread is getting little attention x_x)
-Sword needs to cut bushes -Need an 'action' button (lifting pulling) -needs to check if player is paused/dead -weaponfired -swiching weapons (like S+D) |
Quote:
Your origional "centermousebutton" problem is solved really easily, Left, Right....Middle NPC Code: you can check if the mousewheel is being scrolled by using mousewheeldelta < .5 or > .5 for up and down. For paused/dead have fun with that one, I would sugest you take a look at Massokres threads of him having trouble with it as well, probably not to hard to make something to emulate paused at the least since you have redone the entire system. Dead either as far as thats concerned. Callweapon to call weaponfired on another button press or whatever (pretty sure this should work) just make sure the index is the currently selected weapon. Same for S+D Weapon switching you could do like currentweapon+1 and set selectedweapon to that, and when it reaches the max (weaponscount) just set it back to the first weapon. I should really be in bed already i hope some of this helps you out. |
Yeah, most of that helps, I have the sword gani, but this doesn't cut bushes, and I still have no idea of how I would make the player do the lifting/pulling action (A) button. And neither mousewheel or mousewheeldelta are working x_x
And how would I make it detect a warp? And how do you se the players weapon to a certain weapon??? |
Quote:
NPC Code: Mousewheel. For the bush cutting I will try to help you later, I am getting ready to leave class and I wont have access to a PC Again till I get home :) |
oh within a timeout? didn't think of that XD
Yeah the bush cutting/lifting is the bigest problem now, as well as the weapon switching, I don't know how to set a player's weapon |
Quote:
NPC Code: Basically its just going through Indexes of the weapons until it finds bomb, then setting "Selectedweapon" to Bomb. You could use it probably for a whole inventory system by just setting a string like "Equipped Weapon" and replacing bomb with your string to always set it. Good Luck. |
For calling a weapon, as in weaponfired, you'll want to use findweapon(weaponname).trigger("WeaponFired",NULL) ;
If you're GS1, callweapon weaponindex,weaponfired; |
callweapon selectedweapon,weaponfired; would be more appropriate in this case, I believe.
|
I still can't get mousewheeldelta to work, and I don't know how to do the action, bush slashing, but everything else on my list has been fixed
|
Quote:
|
| All times are GMT +2. The time now is 12:01 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.