Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
Page 2 of 2 1 2
#4209810 - 12/24/15 11:55 PM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
MapKey(&T16000, H1L, REXEC(0, 88, "TrimDXAxis(MOUSE_X_AXIS, SET(-1));"));

with PlugMouse (0) is the only thing that gives me a mouse that works ingame.
All other mouse codes either swings or let's the game freak.

PlugMouse(1) is not an option. Citizen hates that code.
smile

So whatever solution we come up with, it has to look at the code Plug(0) uses.

Inline advert (2nd and 3rd post)

#4209812 - 12/25/15 12:02 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
Try this, it works for me.

Code:
MapKey
 (
  &Joystick,
  H1D,
  REXEC(0,50,"DXAxis(MOUSE_X_AXIS, Axis[MOUSE_X_AXIS].pos + 100);")
 );


And try with PlugMouse(1) also!

Last edited by Aullido; 12/25/15 12:13 AM.
#4209815 - 12/25/15 12:12 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
ok. give me 6 minutes smile

#4209816 - 12/25/15 12:32 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
Code:
include "target.tmh"
//mouse test file

alias T16001; // second T16000 handle, which will be used all mapping commands
alias T16A; // for handy switching purposes only
alias T16B; // same here
define switchthem 1 // make 0/1 if left=right



int main()

{


Configure(&HCougar, MODE_EXCLUDED);
Configure(&Joystick, MODE_EXCLUDED);
Configure(&Throttle, MODE_EXCLUDED);
Configure(&LMFD, MODE_EXCLUDED);
Configure(&RMFD, MODE_EXCLUDED);

if(Init(&EventHandle)) return 1; // declare the event handler, return on error

&T16001 = GetIndexJoy (SelectUsbDevice ("VID_044F&PID_B10A")); //pc expects a joystick on this adress


if (switchthem)

{
&T16A = &T16000;
&T16B = &T16001;

&T16000 = &T16B;
&T16001 = &T16A;
}
// this was about making the left one right and vice...


MapKey
 (
  &T16001,
  H1R,
  REXEC(0,50,"DXAxis(MOUSE_X_AXIS, Axis[MOUSE_Y_AXIS].pos + 2);")
 );

MapKey
 (
  &T16001,
  H1L,
  REXEC(0,50,"DXAxis(MOUSE_X_AXIS, Axis[MOUSE_Y_AXIS].pos - 2);")
 );

MapKey
 (
  &T16001,
  H1D,
  REXEC(0,50,"DXAxis(MOUSE_Y_AXIS, Axis[MOUSE_X_AXIS].pos + 2);")
 );

MapKey
 (
  &T16001,
  H1U,
  REXEC(0,50,"DXAxis(MOUSE_Y_AXIS, Axis[MOUSE_X_AXIS].pos - 2);")
 );
 
}


//event handler
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);

//add event handling code here
}




Gives me 3!!! smile working axis.
As soon as I change one of the two axis in one line I win one axix but lose the reaction for another. Another then becomes dead.

And I have to flip axis in one line. Really weird.

If I put Y and Y in one line, and X and X I get the pendulum axis back.

But 3 out of 4 axis is not bad. Only that last one now and we are gold.
Should be look at the Z mouse axis?
We got a lot of options, lol

Last edited by SpaceBlaze; 12/25/15 12:32 AM. Reason: on =one
#4209818 - 12/25/15 12:42 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
I got a 3 working sides. U, L, R

And when I use the mouse weird #%&*$# happens. Different axis get locked and start working.
And when I use combinations All buttons now only give down and right movement.
Left and up are now giving right and down.
One button at this speed, and the other at another.

frown

I thought we nailed it... frown

#4209819 - 12/25/15 12:49 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
Code:
MapKey
 (
  &T16001,
  H1R,
  REXEC(0,50,"DXAxis(MOUSE_X_AXIS, Axis[MOUSE_X_AXIS].pos + 2);")
 );

MapKey
 (
  &T16001,
  H1L,
  REXEC(0,50,"DXAxis(MOUSE_X_AXIS, Axis[MOUSE_X_AXIS].pos - 2);")
 );

MapKey
 (
  &T16001,
  H1D,
  REXEC(0,50,"DXAxis(MOUSE_Y_AXIS, Axis[MOUSE_Y_AXIS].pos + 2);")
 );

MapKey
 (
  &T16001,
  H1U,
  REXEC(0,50,"DXAxis(MOUSE_Y_AXIS, Axis[MOUSE_Y_AXIS].pos - 2);")
 );


Would be great...but without the adding/subtracting of the last coordinates and the speed it went.

So we need to say: STOP!
And then go again!

#4209820 - 12/25/15 12:52 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
Wait, you are mixing axis. Be sure the axis moved is the same as the axis position:

REXEC(0,50,"DXAxis(MOUSE_X_AXIS, Axis[MOUSE_Y_AXIS].pos - 2);") // Wrong.

REXEC(0,50,"DXAxis(MOUSE_X_AXIS, Axis[MOUSE_X_AXIS].pos - 2);") // Right.

If this works for one must work for all.

#4209822 - 12/25/15 12:56 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
Yes, mixing axis grumbles it up.

But X X still gives me a pendulum/swinging mouse.
We need a stopping code followed up by a continue mode.

H1D (the code), stop all movement, H1D (the code)again in the same line.
So that when I do the code the stopping makes sure all adding are forgotten, and we get a fresh startvalue 'hop'


Last edited by SpaceBlaze; 12/25/15 12:58 AM. Reason: bad engrish :)
#4209823 - 12/25/15 12:59 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
OK lets try without the REXEC. I will try to use the events section instead but I am afraid it would be tomorrow since its Christmas dinner time.

Merry Christmas.

#4209825 - 12/25/15 01:01 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
Stopper = EXEC("DXAxis(MOUSE_X_AXIS, 0);" "DXAxis(MOUSE_Y_AXIS, 0);");

kills the adding, and gives me a fresh new cursor.

So 2 continuing pushes of H1D should have a stopper code in between.
But I have no idea how to code that.

#4209826 - 12/25/15 01:05 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
I think I tried it long ago but as soon as the stopper code part in the line was executed the button went dead.

Last edited by SpaceBlaze; 12/25/15 01:05 AM. Reason: part
#4209828 - 12/25/15 01:21 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
Yes, I guess it will be 2-ish days from now since I will be back here.

Merry X-mas and have a nice dinner party with close ones
smile

(like me smile )

#4209871 - 12/25/15 06:33 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
A simple MapKeyR?


MapKeyR(&T16000,H1U,EXEC("DXAxis(MOUSE_X_AXIS, 0);" "DXAxis(MOUSE_Y_AXIS, 0);"));

Do it for each H1 button.

#4209896 - 12/25/15 09:59 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
This would mean it get's 'stopped' when I let go of the button, right?

But I need the mouse code to walk around. Walking can not be done when I have to let go every time.
And also not if the pixels moved get's doubled every second.

In Citizen you walk around (and shoot) with the mouse.

I want to do that with the joystick.

I got 2 joysticks, and don't like another mouse next to it.

I fly with the joysticks, and I (and more players on the forums of the game) want to walk and shoot with it too.

Flying uses key bindings. And can also be bound ingame.

But walking only has the option for mouse.

Therefore I need mouse code smile

And when I can alter speed by toggling, I can even go into snipe mode.
(go fast to target, and then zoom in slowly or more secure)



Last edited by SpaceBlaze; 12/25/15 10:01 AM.
#4210003 - 12/25/15 08:26 PM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
You can directly assign the mouse to a joystick. How SC uses the mouse exactly? I don't have the game installed.

#4210138 - 12/26/15 10:32 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
The mouse can be used to fly spacecraft and walk your toon.

Flying can also be done by binding it ingame to joystick(s)

walking can only be done with mouse. No joystick binding optioni for that yet.

XML stuff is used to bind them.


But since it's a space sim I (and many with me) do simply not want to use the mouse at all.

But mousecode on joystick gives us walking around with joystick AND a moveable reticle.



Since it seems we need code that gives us an adding mouse followed by a stopper code, we must focus on this. The stopper code should not kill any followup of the HAT button.

I have not yet tested () stopper after each H1D/L/R/U line.
Maybe the stopper should also exec a looking at the H1D etc and if it sees it as true, the continue of the mouse movement.

Bringing is back to move+stop+move.

You already know how to alter the target.thm file to the swinging mouse. So you can test the code needed to do move+stop+move. Have you yourself tried the (0) mouse?
It's easier talking if you do.
The original file cannot be tempered with anyway. It does not hurt to use an altered copy.
As soon as you use another map/folder without our target.tmh in it, it makes a fresh (original) one anyway.
We cannot 'break' the program. The files are write protected.

As long as we use alterable copies anyway we can never hurt the program.

Have you seen the whacky mouse we have?

#4210276 - 12/26/15 10:43 PM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
Try this on the shooter game, maybe you will find it useful.

Code:
 MapAxis
  (
   &T16000,
   JOYX,
   MOUSE_X_AXIS,
   AXIS_NORMAL,
   MAP_RELATIVE
  );
    
 MapAxis
  (
   &T16000,
   JOYY,
   MOUSE_Y_AXIS,
   AXIS_NORMAL,
   MAP_RELATIVE
  );



From the manual:

MapAxis optional parameters.

We have only used a few parameters in the previous script. In fact, MapAxis supports the following options:

MapAxis
(
&Input device,
physical axis name,
dx_axis name,
AXIS_NORMAL or AXIS_REVERSED,
MAP_ABSOLUTE or MAP_RELATIVE
):

AXIS_NORMAL: the axis runs in the default direction.
AXIS_REVERSED: reverses the axis direction.
MAP_ABSOLUTE: usual behavior of an axis.
MAP_RELATIVE: in this particular mode, the axis value will stay at the maximum or minimum value
reached until you change your movement direction. This parameter was specially created for Slew
Control axes or ministicks which control a Target Designation Cursor. Only use absolute mode when
needed.

Note: this mode provides for realistic handling of the TDC box in Lock On Modern Air Combat, DCS Flaming Cliffs
1 (and 2 without the patch).

#4230467 - 02/18/16 05:42 AM Re: Delay+chain with exec in them [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
Hello Aullido.

Sorry I only now am back. (time does indeed seem to fly away a lot)

It seems Synkc has solved the problem for me. (sorry for you work smile )
https://forums.robertsspaceindustries.co...de-kinda#latest

Code:
MapKey(&T16000, H1U, REXEC(0, 2, "DXAxis(MOUSE_Y_AXIS, -1);"));
MapKey(&T16000, H1R, REXEC(1, 2, "DXAxis(MOUSE_X_AXIS, 1);"));
MapKey(&T16000, H1D, REXEC(0, 2, "DXAxis(MOUSE_Y_AXIS, 1);"));
MapKey(&T16000, H1L, REXEC(1, 2, "DXAxis(MOUSE_X_AXIS, -1);"));

Page 2 of 2 1 2

Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
Actors portraying US Presidents
by PanzerMeyer. 04/19/24 12:19 PM
Dickey Betts was 80
by Rick_Rawlings. 04/19/24 01:11 AM
Exodus
by RedOneAlpha. 04/18/24 05:46 PM
Grumman Wildcat unique landing gear
by Coot. 04/17/24 03:54 PM
Peter Higgs was 94
by Rick_Rawlings. 04/17/24 12:28 AM
Whitey Herzog was 92
by F4UDash4. 04/16/24 04:41 PM
Anyone can tell me what this is?
by NoFlyBoy. 04/16/24 04:10 PM
10 Years ago MV Sewol
by wormfood. 04/15/24 08:25 PM
Pride Of Jenni race win
by NoFlyBoy. 04/15/24 12:22 AM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0