Search the archive:
YaBB - Yet another Bulletin Board
 
   
 
Page Index Toggle Pages: 1
Send Topic Print
Assigning functions to switches (Read 1269 times)
May 23rd, 2009 at 11:09pm

brettt777   Offline
Colonel
Gadsden, AL

Gender: male
Posts: 313
*****
 
How is a new function assinged to a switch or button on the joystick or keyboard? I'm not talking about assigning a function to a modeled switch on the panel, although I would love to know how to do that too. If you go in the controls setup you can assign certain functions to buttons easy enough but what if the function you are trying to make work isn't in the setup? The SectionF8 Sabre has a simulated machine gun function assigned to the brake button once you're airborne. It only fires as long as you hold the button which is how it should be. I am trying to do something similar in another aircraft. But the best I can do is get it to work with the lights on/off and you have to press it once to start it and again to stop it. Also, how do you assign a sound to a button/function?
 
IP Logged
 
Reply #1 - May 24th, 2009 at 11:00pm

Capt.Propwash   Offline
Colonel
Let's get a little mud
on the tires!
KCHS, Charleston, SC, USA

Gender: male
Posts: 1958
*****
 
1) which Sabre are you dealing with that has the chaingun on the "trigger" / breaks??  if you could provide a link to it, that would be awesome so that another one of us could get it and take a look.


the best that the chaingun effect could probably be done is put on the [SMOKESYSTEM] ( I key ), and if you have an empty spot on your joystick..... map the I key to the trigger instead of it being the BREAKS.    only problem with that being is now your breaks are somewhere else and you will have to remember that BREAKS are on "button 6" instead of "button 1" < EXAMPLE!!


in the key assginments, you can set up the REPEAT function off to the far right of each assignment so that if you pull the trigger then whatever you have assigned (gun) will stop firing if you let go, or it stays on (like the I key and you get smoke like in the EXTRA 300).   {you either get 1 puff if you tap it, or it says on -- or somewhere in between}

 

The thoughts and expressions contained in the post above are solely my own, and not necessarily those of Simviation.com, its Moderators, its Staff, its Members, or other guests. They can not, are not, and will not be held liable for any thoughts, or expressions, or posts that I have made, or will make in the future.

Computer Specs:: Acer Aspire Laptop..Win7 Home Premium 64-bit (sp1), AMD Athlon II X2 P340 (Dual Core) [2.2 Ghz], ATI Mobility Radeon HD 4250 (256mb), 4GB DDR3......FS9.1(sp3) / FSX (sp2)..... Ultimate Terrain X, Ground Environment X, REX, FTX ORBX PNW-PFJ-NRM-CRM, OZx, Tongass Fjords, Misty Moorings
IP Logged
 
Reply #2 - May 25th, 2009 at 3:10pm

brettt777   Offline
Colonel
Gadsden, AL

Gender: male
Posts: 313
*****
 
Here is the link for the aircraft. It is actualy an FS9 plane but it works in FSX if the alpha is switched for the canopy glass. I don't remember what the files are for the glass; I think they are in the main texture folder but not sure. I'm not trying to change anything with this aircraft. I am trying to do something similar with another aircraft using a gun effect I downloaded from....somewhere, I don't remember. Anyway, here is the link:

http://sectionf8.com/download.html

I know how to assign a function to a button or key, as long as that function is in the list in the controls menu. But I don't know how to do it if it isn't in that list. Is there a configuration file somewhere that determines what function can be assigned where? Let me see if I can explain what I need to do. Idealy I would love to do exactly what this F-86 does; the brakes work normaly on the ground. Once you get airborne, you flip a switch and then the brake switch (joystick trigger) operates the gun effect, including the sound. I can assign my brakes to another joystick button some I'm not worried about that. But how can I get this gun effect on that control/function list so I can put it to a botton? There is a standard.xml file in \Application Data\Microsoft\FSX\Controls. Can this file be edited in such a way to do this? In the aircraft.cgf file, the gun effect is usualy associated with a light. This is how I have been making it work somewhat. Under the lights section, there seems to be a list of numbers associated with various lights; 1 is beacon, 2 is strobe, 3 is nav etc. Is this a standard list and does it include more than light functions. I see some of the "light" effects are things like afterburners, vapor trails and these gun effects. If I assign the gun effect to the strobe, and then asign the strobe function to my trigger, I should get a gun effect when I pull the trigger. But It doesn't work. I have to hit the light master for it to work. The F-86 gun effect is shown as a "beacon" type of light but it doesn't have to work off the light master at all; it is somehow assigned to the brake function. How is that done? Also how is a sound assigned to an effect? The F-86 has a nice machine gun sound assigned to the gun effect.
 
IP Logged
 
Reply #3 - May 25th, 2009 at 3:25pm

Hagar   Offline
Colonel
My Spitfire Girl
Costa Geriatrica

Posts: 33159
*****
 
brettt777 wrote on May 25th, 2009 at 3:10pm:
Here is the link for the aircraft. It is actualy an FS9 plane but it works in FSX if the alpha is switched for the canopy glass. I don't remember what the files are for the glass; I think they are in the main texture folder but not sure. I'm not trying to change anything with this aircraft. I am trying to do something similar with another aircraft using a gun effect I downloaded from....somewhere, I don't remember. Anyway, here is the link:

http://sectionf8.com/download.html

That file appears to be hosted by Avsim. We're out of luck unless you can find it posted somewhere else.
 

...

Founder & Sole Member - Grumpy's Over the Hill Club for Veteran Virtual Aviators
Member of the Fox Four Group

Need help? Try Grumpy's Lair

My photo gallery
IP Logged
 
Reply #4 - May 25th, 2009 at 9:49pm

Capt.Propwash   Offline
Colonel
Let's get a little mud
on the tires!
KCHS, Charleston, SC, USA

Gender: male
Posts: 1958
*****
 
brettt777, i dont know if this might help, but you might want to take a look at THIS F-86 Sabre.  I do not know if it has the same characteristics as yours, it might, but at least here is 1 that is not hosted by the ill-fated AVSIM.

http://www.simviation.com/fsxmilitary4.htm



Quote:
If you go in the controls setup you can assign certain functions to buttons easy enough but what if the function you are trying to make work isn't in the setup?


if it is not listed, you can not add a function unless you rewrite FS, and I doubt Microsoft will like that very much.


Quote:
The SectionF8 Sabre has a simulated machine gun function assigned to the brake button once you're airborne. It only fires as long as you hold the button which is how it should be. I am trying to do something similar in another aircraft.


have you tried contacting the maker of the F86 and asking him how he mapped the gun??  -- otherwise, you would have to map it to the [LIGHTS] or map it as a [SMOKESYSTEM]


Quote:
But how can I get this gun effect on that control/function list so I can put it to a botton?


Map the Gun Effect to the smokesystem.  Then you can use the smokesystem function in the Key Assignments list to map to the Trigger.   that way the lights are controlled by the lights inside the cockpit, and you can still pull the trigger and get the [SMOKESYSTEM] / GUNS
 

The thoughts and expressions contained in the post above are solely my own, and not necessarily those of Simviation.com, its Moderators, its Staff, its Members, or other guests. They can not, are not, and will not be held liable for any thoughts, or expressions, or posts that I have made, or will make in the future.

Computer Specs:: Acer Aspire Laptop..Win7 Home Premium 64-bit (sp1), AMD Athlon II X2 P340 (Dual Core) [2.2 Ghz], ATI Mobility Radeon HD 4250 (256mb), 4GB DDR3......FS9.1(sp3) / FSX (sp2)..... Ultimate Terrain X, Ground Environment X, REX, FTX ORBX PNW-PFJ-NRM-CRM, OZx, Tongass Fjords, Misty Moorings
IP Logged
 
Reply #5 - May 27th, 2009 at 12:37am

brettt777   Offline
Colonel
Gadsden, AL

Gender: male
Posts: 313
*****
 
Well I see how the gun effect is mapped to the smoke system or the lights. But this F-86 has it somehow mapped to the brakes, but only after a certain switch is turned on once airborne. How on earth did they do that? And someone please tell me how a sound is mapped to a switch or button. If I disable the gun effect so I get no flash and tracers, I still get the gun sound. So it's apparently mapped to the brake button also. And it doesn't matter which button is used. If I move the brakes to button 3, I still get the same gun effect and/or sound.  How did they do this stuff???

On the airplane I'm trying to make work, I put the gun effect under smoke system in the aircraft config. Then I put the smoke system to the "I" key and to button 1. With the I key it works correctly; on when I press and hold, off when I release. But for some reason with the joystick button I can't get it to work. It doesn't seem to matter whether the repeat is on or off, all I get with the joystick button is an occasional puff of gun smoke if I press the trigger repeatedly. What am I doing wrong there? Shouldn't it work like the brake or trim buttons do? The gun effect on the F-86 works like that.
VERY frustrating!  Angry
 
IP Logged
 
Reply #6 - May 27th, 2009 at 3:21pm

Capt.Propwash   Offline
Colonel
Let's get a little mud
on the tires!
KCHS, Charleston, SC, USA

Gender: male
Posts: 1958
*****
 
i have no clue about sounds on effects.  as far to my knowledge, effects can not have sounds that are turned on and off.

as for "puffs of smoke".... there is a Huey Helo over at Hovercontrol.com ( http://64.34.169.161/cgi-bin/ifolio/imageFolio.cgi?search=huey_gunship&cat=&bool... )  that has a chain gun effect on the SMOKESYSTEM.   ultimately, its like the guns on both sides of the Helo are firing at the same time.

Unrealistically.... it looks like you are trying to Crop Dust with a Huey.. lol   BUT!!! these smoke effect stay on until you press the I key again to turn them off; not "only stay on while you hold the button and stop when you release".





Why not contact the makers of your F86 and ask them how they did it, and if it would be okay if you use their idea on a few other planes;  and while you are at it, if you can have their source files so that you can figure out how they mapped everything.
 

The thoughts and expressions contained in the post above are solely my own, and not necessarily those of Simviation.com, its Moderators, its Staff, its Members, or other guests. They can not, are not, and will not be held liable for any thoughts, or expressions, or posts that I have made, or will make in the future.

Computer Specs:: Acer Aspire Laptop..Win7 Home Premium 64-bit (sp1), AMD Athlon II X2 P340 (Dual Core) [2.2 Ghz], ATI Mobility Radeon HD 4250 (256mb), 4GB DDR3......FS9.1(sp3) / FSX (sp2)..... Ultimate Terrain X, Ground Environment X, REX, FTX ORBX PNW-PFJ-NRM-CRM, OZx, Tongass Fjords, Misty Moorings
IP Logged
 
Reply #7 - Jun 9th, 2009 at 6:21pm

Robertus   Offline
1st Lieutenant
Fly FS
USA

Gender: male
Posts: 2
****
 
Quote:
How is a new function assigned to a switch or button on the joystick or keyboard? I'm not talking about assigning a function to a modeled switch on the panel, although I would love to know how to do that too


This generally can be done with FSUIPC (paid version). FSUIPC allows assigning custom map of joystick buttons and keyboard keys to specific plane (which means every plane can have its own custom buttons assignment and when you switch planes, map of buttons is switched automatically). Besides FSUIPC allows much, much, more. It allows assigning joystick buttons and keyboard keys to some switches on 2 and 3D panels (this will not work to all panels) which otherwise cannot have controls assigned (I imagine this will have to work for modeled panels – not using one myself), make working of a joystick button or keyboard key conditional to position of some third key, button or switch, allows to replace say working of two separate keys (say flaps fully up or down) with single button which acts as toggle, plus all sort of combination - which I myself don’t fully know or understand all. Paid FSUIPC comes also with full huge list of FSX native (plus its own) controls, which are not accessible through FSX otherwise (as for instance separate switches to each type of light as: strobe, beacon, panel, wing, logo etc). Since FSUIPC have also free version, lots of developers utilizing its while making planes (that why Level D 767 has custom list of controls for instance). Even just a guess, my assumption is that how Section8 done it too (its just simplest way of accomplishing goal).

FSUIPC config file (
FSUIPC.ini
) is located in:
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Modules


When you buy paid version it comes with documentation (different pdf in \Modules\ folder), which have full instruction how to edit and manipulate its ini file, pdf list of all controls, Apendix in Advanced User Guide with examples of code etc, etc. Prepare yourself for a long read.

Quote:
The SectionF8 Sabre has a simulated machine gun function assigned to the brake button once you're airborne


Without knowing actually I created same functionality myself to different plane of mine with FSUIPC. In order for my joystick to work as breaks (on the ground) and as gun trigger (while airborne), I conditioned its function to position of flag of landing gear button. Another words: when landing gear is raised it’s become gun trigger, when landing gear is down it becomes wheel break. To explain: FSUIPC holds list of flags of all joystick buttons. When you start FSX all flags are getting reset to “0”. Every time you press any button on joystick, its flag is flipped from “0” to “1” and from “1” to “0” when you press it again. Because you can condition functioning of button to position of flags, you can make same button to perform two different functions. Below is code of my gun/break button functionality, which I use in my Saitek X52 where number 2 joystick button (FSUIPC thinks its number 14 – don’t get confused) has global FSX assignment to “wheel break”, number 3 button I assigned to “landing gear” and gun visual effect (traces and muzzles) is triggered with strobe light control. Code below turns on strobe lights when you press trigger button, than turns it off when you release it (under condition that landing gear is raised):

Code:
17=CP(F+0,2)0,14,C66240,0
18=CU(F+0,2)0,14,C66240,0 


Quote:
Also, how do you assign a sound to a button/function?


I think it can be done in following way. I never tried it yet (actually working on it myself), however because that’s how it works on Rhino project fire truck (which by the way is awesome free fully functional truck – better IMHO than Rosenbauer – link to site in Post Scriptum) – assumption is it has to work for other planes too. Firing effect (traces and muzzles) comes from simviation – download link in post scriptum

1.      First assign custom effect to same control which controls firing of the gun. If gun would be fired with strobe lights, lights in aircraft.cfg should look like this (example of my Abacus Harrier):
     
Code:
[lights]

...
light.6=5,   -0.5,    8.00, 1,  fx_Wing_Guns
light.7=5,   -0.5,   -8.00, 1,  fx_Wing_Guns
light.8=5,   0,    7.00, 1,  fx_Wing_Guns
light.9=5,   0,   -7.00, 1,  fx_Wing_Guns
light.10=5, 0.0, 0.00, 0.0, fx_gun_sound
 


Note that gun light effect (fx_Wing_Guns) is mapped to strobe light (=5), same as gun sound effect (fx_gun_sound) – which I explain how to create below.


3.      Next you will have to create effect which will have to be placed in FSX global “Effect” folder. To do this, open notepad, paste following code, than save it as “fx_gun_sound.fx” in:

C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Effects


Code:

Code:
[Library Effect]
Lifetime=5
Version=2.00
Radius=100
Priority=0
[Sound]
FileName=Gun05.wav
MinAttenuationDistance=50.00
Looping=TRUE


[Emitter.0]
Lifetime=0.00, 0.00
Delay=0.00, 0.00
Bounce=0.00
Light=1
No Interpolate=1
Rate=10.00, 10.00
X Emitter Velocity=0.00, 0.00
Y Emitter Velocity=0.00, 0.00
Z Emitter Velocity=0.00, 0.00
Drag=0.00, 0.00
X Particle Velocity=0.00, 0.00
Y Particle Velocity=0.00, 0.00
Z Particle Velocity=0.00, 0.00
X Offset=0.00, 0.00
Y Offset=0.05, 0.05
Z Offset=0.05, 0.05

[Particle.0]
Lifetime=0.10, 0.10
Type=19
X Scale=5.00, 5.00
Y Scale=5.00, 5.00
Z Scale=0.00, 0.00
X Scale Rate=0.00, 0.00
Y Scale Rate=0.00, 0.00
Z Scale Rate=0.00, 0.00
Drag=0.00, 0.00
Color Rate=0.00, 0.00
Fade In=0.00, 0.00
Fade Out=0.00, 0.00
Rotation=0.00, 0.00
Static=1
Face=0, 0, 0

[ParticleAttributes.0]
Blend Mode=0
Bounce=0.00
Color Start=30, 8, 0, 0
Color End=60, 8, 0, 0
Jitter Distance=0.00
Jitter Time=0.00
uv1=0.00, 0.00
uv2=0.00, 0.00
X Scale Goal=0.00
Y Scale Goal=0.00
Z Scale Goal=0.00
Extrude Length=0.00
Extrude Pitch Max=0.00
Extrude Heading Max=0.00 



4.      Note that code above refers to sound “Gun05.wav” which has to be places in FSX global sound folder:

C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Sound


You will have to create some gun sounds. Personally I doing it by downloading all sort of sounds from YouTube (which seems to have good gun sound library), than converting its video files to .wav sound files. Links of some cool gun sounds I found in post scriptum.

If never bought FSUIPC (as me for many years) – you don’t know what you missed.

PS.
1.      FSUIPC home page: http://www.schiratti.com/dowson.html
Forum: http://forums.simflight.com/viewforum.php?f=54

2.      Rhino project fire truck: http://www.flight-team-bremerhaven.de/modules.php?op=modload&name=Downloads&file...

Note that: sirens, flashing blue lights, strong search light, water from water cannon and trucks position lights are all controlled with different light types (strobes, nav, landing, taxi etc). To separate siren from blue flashing lights modify Rhino’s aircraft.cfg file:

Code:
[LIGHTS]
//Types: 1=beacon, 2=strobe, 3=navigation, 4=cockpit 1=zurück 2=nach links3=höhe
light.0 = 4, 16.20,  0.50,  4.00, fx_vclight
light.1 = 4, 0.0, 0.00, 0.0, fx_police_Horn 



Now “virtual cockpit” light (or FSUIPC’s “Panel lights toggle” - to which you can map joystick button with FSUIPC – just as you can to the rest of lights) will turn siren on, while beacon lights will turn blue lights on. Strobes will turn white flashing lights.

Also note that you can change US siren to Europe siren (back and forth in any truck), by changing names of Horn05.wav and Res.wav (or even change it to FSX siren: SFX_SirenLoop.wav) in global FSX Sound folder. It probably would be advisable to keep back up copies of changed sounds so you don’t loose any sound by changing its name too quickly.

While on subject of team-bremerhaven, also would like to mention: make sure you haven’t missed its helicopters. Evrything there is free. With working auto hover, its probably one of coolest and easiest helo existing for hoist. I have already figured how to add working hoist to any helo and how to place (with help of AI Carrier2) all sort of objects (ships, boats cars etc) with different hoist enabled victims in single player mode. Preparing to test how it will work online (hope will find some willing people online to help me with test). Once done will make free instruction and download publicly available.

3.      Gun effect: http://www.simviation.com/simviation/?type=item&ID=69&page=1

4. YouTube gun sounds:
AK 47  http://www.youtube.com/watch?v=QPPBVOz_Hcg&feature=PlayList&p=952E1284AB4F151F&i...

M-60 http://www.youtube.com/watch?v=2xhwvCZ-SKg&feature=related

Machine guns http://www.youtube.com/watch?v=rtlsKMbdFe8&feature=related

UZI (not to goodd) http://www.youtube.com/watch?v=oEwu6A0_t6U&feature=related

Call of Duty http://www.youtube.com/watch?v=DTNWQDx-vCs&feature=related

UZI: http://www.youtube.com/watch?v=SWAEiAYuxRk&feature=related

Machine gun http://www.youtube.com/watch?v=R756UxwAso8&feature=related

Slow machine gun: http://www.youtube.com/watch?v=bv83AfXMJAo&feature=related

Slow machine gun http://www.youtube.com/watch?v=CWfMOHXefIg&feature=related

Muchine guns: http://www.youtube.com/watch?v=7k70dQhl2SY&feature=related

machine gun http://www.youtube.com/watch?v=gCra4qOrjFw&feature=related


Vulcan Gatlin http://www.youtube.com/watch?v=CRlIXWfwnok

Gatlin anim: http://www.youtube.com/watch?v=awbMAv0RkBU

CIWS Gatlin: http://www.youtube.com/watch?v=vH5RVTS4QxA

CIWS Gatlin  http://www.youtube.com/watch?v=3aHaMgAwTiA

By the way anyone knows where to get cool gun effects besides those mentioned? I have as stated before simviation download “gun effect”, also one which comes from Alphasim F-22 Raptor payware. Will check mentioned in this thread section8 one. What I however really looking for is one which show muzzle fire, show traces in the air, as well leaves marks of bullets on the ground and water (all at the same time). I mean I’m sure there has to be more than three gun effects existing. Where to get them? I was trying to Google something up (and that how by the way found this forum thread) – however couldn’t find anything.

« Last Edit: Jun 10th, 2009 at 3:02am by Robertus »  
IP Logged
 
Reply #8 - Jun 10th, 2009 at 2:57am

Robertus   Offline
1st Lieutenant
Fly FS
USA

Gender: male
Posts: 2
****
 
Update:

Just as day progressed today I tested gun sound it does work without a glitch (added guns with sound to bunch of my helicopters and fighters). To make things easier I zipped and uploaded 42 gun sound files (those are sounds from previously given YouTube links) which are already converted and ready to use – available to download here:
(requires providing e-mail)
http://rapidshare.com/files/242878342/GUN.zip.html  (10 downloads limit)
http://www.yourfilelink.com/get.php?fid=498910

MD5: 1E27F0D2E9023965B4319B43E1574232 (MD5 hash for rapidshare file)


I also came on bright idea: why not use both gun visual effects I have same time for every plane. Now I do have muzzle flashes, ammunition empty shells falling on the ground, bullet tracers in the air, little fires on the ground and water and of course awesome guns sounds. Looks pretty cool – which doesn’t mean wouldn’t mind to check some different effect to see how they work – if anyone knows where to get them. I wouldn’t mind uploading some quick video on YouTube to show everyone how it looks and sounds – if anyone could give some advise how to record sound from FSX directly without using mic.

By the way section 8 download links does not work.  After doing bit tracing it appears that despise links being hosted on section 8 website, download links themselves redirecting to avism database – and we all know what happened to it. If anyone is registered on their forum it probably would be good idea to point this to someone and ask for fixing.
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print