Changing Weaoins Using The Mouse-Wheel.

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Changing Weaoins Using The Mouse-Wheel.

Post by metal_head » Thu Aug 14, 2008 11:34 am

Is it possible with a script,or without (that will be better for me :D) to make the weapons to be changed except with 1-9,with the mouse-wheel.All the games today have that,you can change your weapon with 1-9 and the mouse-wheel.
All I've done till now is that,and I'm not sure it's correct :D :

Code: Select all

Start[ ()
{
     Console(true);
     LowLevel("run");
} ]

run[ ()
{
self.ThinkTime = 0.5;   //that's because I want a little delay when you switch to the other weapon.
I don't know how it will be made in High-Level so I switched to Low-Level also.

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Changing Weaoins Using The Mouse-Wheel.

Post by Jay » Thu Aug 14, 2008 6:06 pm

I don't think it's possible, but maybe you could make it so that everytime the player presses the right mouse button the weapon switches, while left button is fireing.

Every time the weapon is switched you should set a timer so that the weapons don't change too fast (or like 5 times from on click)
Everyone can see the difficult, but only the wise can see the simple.
-----

User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Changing Weaoins Using The Mouse-Wheel.

Post by metal_head » Thu Aug 14, 2008 6:24 pm

Well,yeah,but the right button is the sniper zoom.Why it's not possible btw?

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: Changing Weaoins Using The Mouse-Wheel.

Post by Juutis » Thu Aug 14, 2008 6:34 pm

There's no way to see if you're actually using the wheel. You can only check if buttons are pressed.
Pain is only psychological.

User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Changing Weaoins Using The Mouse-Wheel.

Post by metal_head » Thu Aug 14, 2008 6:45 pm

Oh,crap...than how the weapons in the other games can be changed using the Mouse-wheel

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Changing Weaoins Using The Mouse-Wheel.

Post by Jay » Thu Aug 14, 2008 10:37 pm

Pressing the mouse wheel (not turning it) is like pressing the middle button of a mouse... maybe you can use a middle mouse press instead? (I think it was called self.mbutton_pressed or something like that, search the docs to clarify...)
Everyone can see the difficult, but only the wise can see the simple.
-----

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: Changing Weaoins Using The Mouse-Wheel.

Post by Juutis » Thu Aug 14, 2008 10:41 pm

Also, the keycode for the middle mouse button is 74, if my memory serves me right. Not everyone has a mouse with that kind of wheel though.
Pain is only psychological.

User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Changing Weaoins Using The Mouse-Wheel.

Post by metal_head » Thu Aug 14, 2008 10:57 pm

well,the new mouses have a wheel,I wanted to change the weapon by scrolling the wheel,so that way I can choose another weapon,and I can go back to the previous one just by scrolling the opposite way.Too bad,but...I think I can live without the changing weapon by scroling :D.

Post Reply