graidia Posted June 16, 2008 Report Posted June 16, 2008 Hi first i want to thank you for your wonderful module sir Pete ;) i have the last 3.81 version and i want to setup a joystick button for the AI TRAFFIC: when i press the button for the first time the traffic is set to 25%, the second key press give me 50%, the third key press give me 75% and finally the fourth key press give me 100% of ai traffic can you help sir pete to get this key working? thanks in advance
Pete Dowson Posted June 16, 2008 Report Posted June 16, 2008 i want to setup a joystick button for the AI TRAFFIC: when i press the button for the first time the traffic is set to 25%, the second key press give me 50%, the third key press give me 75% and finally the fourth key press give me 100% of ai traffic can you help sir pete to get this key working? There's no easy way to do that. You are really talking about 4 separate buttons. You could do it by using two flags I suppose, with some complicated logic, using parameters edited direct in the INI file, but there is nothing geared to what you want to do. Are you sure you want to venture into such strange fiddles? Start by programming the button to set your 25% in the FSUIPC options. i.e Control "Traffic Density Set" with parameter 25. Then look in the INI file. In the [buttons] section you'll find a line like 1=P1,1,C1008,25 The number on the left is simply a parameter sequence number. The "P1,1" here says "Press joystick 1, button 1" (yours will be different. 1008 is the internal number of the traffic Density Set control. Now you need to use two flags to give you 4 alternatives. Flags are nominally associated with buttons, but they don't need to be real buttons you actually have, so I'll choose buttons on joystic 15: buttons 0 and 1. Make the first parameter conditional on both flags being off: 1=CP(F-15,0)(F-15,1)1,1,C1008,25 The red parts I've inserted make this conditional on those two flags being clear (the '-'). Now, on the same condition we need to set one of those flags in order that the next time though you get a new result: 2=CP(F-15,0)(F-15,1)1,1,C1003,3840 The 1003 control is "set flag" and the parameter 3840 is 256 x 15 (the joy number) + 0 (the button number). Now the rest follows similarly: 3=CP(F+15,0)(F-15,1)1,1,C1008,50 ;Flag 0=ON, Flag 1= OFF, set 50% 4=CP(F+15,0)(F-15,1)1,1,C1003,3841 ; and set Flag 1 ON 5=CP(F+15,0)(F+15,1)1,1,C1008,75 ;Flag 0=ON, Flag 1= ON, set 75% 6=CP(F+15,0)(F+15,1)1,1,C1004,3840 ; and set Flag 0 OFF 7=CP(F-15,0)(F+15,1)1,1,C1008,100 ;Flag 0=OFF, Flag 1= ON, set 100% 8=CP(F-15,0)(F+15,1)1,1,C1004,3841 ; and set Flag 1 OFF After steps 7 and 8 it's all back to the start again, for 25% next press. Pete
graidia Posted June 16, 2008 Author Report Posted June 16, 2008 Thanks Sir PETE i'll try this trick tonight ;)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now