Jump to content

FSFIan

Members
  • Posts

    1301
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by FSFIan

  1. FSFIan

    Monitor kaputt ?

    Wenn das komplette Bild einen Violett-Stich hat, fehlt die grüne Komponente von den RGB-Pixeldaten. Wenn der Monitor über VGA angeschlossen ist, wird jeder Farbanteil über separate Leitungen übertragen, so dass ein Defekt im Kabel oder am Stecker diesen Fehler verursachen kann. Nach einem kurzen Blick auf die Pinouts in Wikipedia scheint das auch bei DVI, HDMI und eventuell DisplayPort der Fall zu sein, aber da bin ich mir nicht ganz sicher. Ich würde auf jeden Fall mal probieren, das Kabel zu tauschen oder den Monitor über einen anderen Eingang (z.B. VGA statt DVI) anzusteuern, um einen Defekt an den Steckern (sowohl auf Grafikkartenseite als auch am Monitor) auszuschließen.
  2. As far as I understand it, 2.5 will be 2.0 with the Caucasus map in addition to NTTR, so I wouldn't expect major changes to the scripting engine. I would expect a framework that works in 2.0 to work in 2.5 without modification, since it's the same engine -- the difference between 1.5 and 2.5 will be the data format of the Caucasus map (i.e. the Caucasus map will use the same new terrain engine that is already used by NTTR).
  3. It should work if you explicitly typecast to long int, that way the compiler should no longer be confused about which variant of the write() method it should use: void loop() { DcsBios::loop(); disp1.write(vhfamFreq1StrBuffer.getData()); disp1.clearDisp(); disp2.write((long int)vhfamFreq2Buffer.getData()); disp2.clearDisp(); disp3.write((long int)vhfamFreq3Buffer.getData()); disp3.clearDisp(); disp4.write(vhfamFreq4StrBuffer.getData()); disp4.clearDisp(); }
  4. Make sure you use the latest version of DCS-BIOS and the Arduino Library (the info in BravoYankee's post has been copied out of an older version of the reference docs). Then you can use an IntegerBuffer like this: #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" void onRsbnChanChange(unsigned int newValue) { // newValue is now the position of the RSBN channel selector // between 0 and 99. You may have to add one if the display // goes from 1 to 100, I am not familiar with the Mig-21 } DcsBios::IntegerBuffer rsbnChanBuffer(0x2218, 0x3f80, 7, onRsbnChanChange); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); }
  5. Look in the advanced view. If it is a multiposition switch it should have an output that exports the current position as an integer value.
  6. Looks like you started with this from the reference docs: DcsBios::IntegerBuffer vhfamFreq2Buffer(0x118e, 0x00f0, 4, NULL); and then changed an IntegerBuffer to a StringBuffer. Why do you expect it to work? The positions of the Freq2 and Freq3 selectors are encoded as integers in different parts of the two bytes starting at offset 0x118e. Your code treats the first byte at 0x118e as a one-character string and tries to write it to the second and third digits on your display. The Freq1 and Freq2 selectors have additional, redundant string outputs because it is somewhat cumbersome to convert an integer to a right-adjusted string with leading spaces if you want to use just the Arduino libraries and avoid dynamic memory allocation. If you have a single-digit integer, you can just add it to the character literal '0' to get a string (although the SevenSeg library also accepts integers as far as I know, so you don't even need to do that). The following should work: #define DCSBIOS_IRQ_SERIAL #include <SevenSeg.h> #include <DcsBios.h> SevenSeg disp1(2, 3, 4, 5, 6, 7, 8); SevenSeg disp2(2, 3, 4, 5, 6, 7, 8); SevenSeg disp3(2, 3, 4, 5, 6, 7, 8); SevenSeg disp4(2, 3, 4, 5, 6, 7, 8); const int numOfDigits1 = 2; const int numOfDigits2 = 1; const int numOfDigits3 = 1; const int numOfDigits4 = 2; int digitPins1[] = {A0,A1}; int digitPins2[] = {A2}; int digitPins3[] = {A3}; int digitPins4[] = {A4,A5}; DcsBios::StringBuffer<2> vhfamFreq1StrBuffer(0x1190, NULL); DcsBios::IntegerBuffer vhfamFreq2Buffer(0x118e, 0x00f0, 4, NULL); DcsBios::IntegerBuffer vhfamFreq3Buffer(0x118e, 0x0f00, 8, NULL); DcsBios::StringBuffer<2> vhfamFreq4StrBuffer(0x1192, NULL); void setup() { DcsBios::setup(); disp1.setDigitPins(numOfDigits1, digitPins1); disp2.setDigitPins(numOfDigits2, digitPins2); disp3.setDigitPins(numOfDigits3, digitPins3); disp4.setDigitPins(numOfDigits4, digitPins4); } void loop() { DcsBios::loop(); disp1.write(vhfamFreq1StrBuffer.getData()); disp1.clearDisp(); disp2.write(vhfamFreq2Buffer.getData()); disp2.clearDisp(); disp3.write(vhfamFreq3Buffer.getData()); disp3.clearDisp(); disp4.write(vhfamFreq4StrBuffer.getData()); disp4.clearDisp(); }
  7. 1. I don't plan to add any more aircraft myself. Adding an aircraft module requires you to be familiar with the aircraft to be able to verify that the definitions actually work. Familiarity with the aircraft also makes it easier to make sense of the clickabledata.lua file. I do plan to make it easier to add new aircraft in DCS-BIOS 2.0. 2. I don't know, as I am not familiar with the Mig-21 and what is and is not exported (Mig-21 support was contributed by wraith444, I only did the A-10C and the UH-1H). Have a look through the control reference docs yourself and see if the values you need are available.
  8. Using pinMode() is required both for analog and digital pins, but it is handled by the DCS-BIOS Arduino Library. Just use them like digital pins, specifying the constant An instead of the pin number: DcsBios::LED masterCaution(0x1012, 0x0800, A5); Note that on the Pro Mini, pins A6 and A7 are analog only.
  9. Short answers: 1. The data format is specific to DCS-BIOS. 2. If you are already listening to the export data stream when the mission starts, the very first update will include everything -- nothing has been transmitted before, so everything is considered to have changed. If you miss that first update, your application will be up-to-date within about ten seconds anyway, as DCS-BIOS deliberately re-sends some of the unchanged data with each update packet. 3. Set the Control Reference Documentation to "Advanced" view. Please create a new topic for things like this in the future (or if you have follow-up questions). This thread is for release announcements only, for two reasons: a) I wanted to give people a low-traffic thread to watch with the "subscribe to this thread" function b) I hate monster-threads in general, because I have wasted time in the past answering questions I knew I had answered before, but writing it down again took less time than finding the old answer in a thread of 30+ pages (and it starts to get really annoying when two or three discussions are going on at the same time in the same forum thread) There is also the DCS-BIOS Discussion Thread for feedback and general discussion (i.e. anything that I won't have to find again in the future to link to someone else).
  10. The dcs_variant.txt file goes into the installation directory of your second DCS: World installation. It makes sense to use that second installation to run the viewer, so you don't have to install any additional modules there. It can contain anything you like. If dcs_variant.txt contains the string "foo", that installation will use "%USERPROFILE%\Saved Games\DCS.foo" as the profile directory. Can you explain in more detail what you mean by "So I could even change the I have to restart the mission in the viewer."?
  11. Da kann man von der Scripting Engine aus im Moment leider kaum was machen. Ich hatte vor zwei Jahren mal was zusammengehackt -- Position aller Einheiten und Gebäude exportiert, und dann auf einem zweiten Rechner berechnet, welche Sichtlinien durch Gebäude geblockt werden. Das Problem ist, dass man diese Information nicht sinnvoll an die KI weitergeben kann. Man kann Einheiten nur auf "invisible" setzen, wodurch sie für alle Gegner unsichtbar werden. Das führte in meinem Experiment dann dazu, dass ich in einem Panzer (Combined Arms) um eine Straßenecke fuhr, von einer Infanterieeinheit gesehen wurde und fünf Sekunden später tot war, weil ein gegnerischer Panzer am anderen Ende der Stadt, dessen LOS noch durch Gebäude geblockt war, die passende Flugparabel für sein Geschoss berechnet hatte. Was fehlt, ist eine Möglichkeit, für jede Gruppe einzeln eine Blacklist und/oder Whitelist der angreifbaren Ziele festzulegen. EDIT: Über ALARM STATE und ROE kann man natürlich noch etwas feingranularer werden, aber im Multiplayer kommt man schnell in eine Situation, in der jede gegnerische Einheit freie Sicht auf mindestens einen Spieler hat, so dass alle Feinde angreifen dürfen und kein Spieler auf invisible gesetzt werden kann.
  12. I think this would work for calculating the turn rate from two turn angles angle1 and angle2 measured at two different times t1 and t2: function getTurnRate(t1, angle1, t2, angle2) local delta_t = t2 - t1 local delta_angle = angle2 - angle1 if delta_angle < -180 then delta_angle = delta_angle + 360 end if delta_angle > 180 then delta_angle = delta_angle - 360 end return delta_angle / delta_t end
  13. The power that can be drawn from a USB port is limited by the USB specification. Your power supply has nothing to do with that. USB 2.0 can provide a maximum of 500 mA per port. If you connect an unpowered hub, that 500 mA has to be shared by all devices connected to that hub. If the hub is powered, each of its ports can draw the full 500 mA. USB devices will negotiate with the host PC about the power they want to draw. If the host PC decides that the current topology cannot supply enough power (say you have an unpowered 4-port hub that is already powering two devices at 200 mA each and you connect a new device that wants 150 mA), the new device must enter a sleep mode. Most USB devices need less than 100 mA. If they have backlighting or motors (hard drives), they probably need more. Assuming that you use enough powered hubs, how many devices can you connect? In theory up to 127 per root controller (i.e. per port on your motherboard), and hubs also count as devices. In practice, I have read about people having problems much earlier, at about 20 devices.
  14. SPDT switches can be on/on or on/off/on. The "double throw" just refers to how many "on" positions there are, not the total number of switch positions. If you have an on/off switch, how well it works depends on whether the module you are flying has a keybinding intended for an on/off switch or not. If it doesn't have it, you can add one by editing some Lua files, but that requires some reading and you will have to reapply your changes after every DCS update (e.g. with JSGME or some sort of revision control system).
  15. DCS: World will look for a file called Export.lua in the user profile (%USERPROFILE%\Saved Games\DCS\Scripts\Export.lua) and run it. That file can define callback functions that run at specific times. The Export.lua script has access to various functions that can query and manipulate the cockpit. In general, FC3 aircraft have less information available than modules with a clickable cockpit. Since it's arbitrary Lua code, you can open a network socket to communicate with external software. To learn more about Export.lua, you can read the original developer post documenting Export.lua on the internet archive (refers to outdated location of the Export.lua file) read the source code of Export.lua files for other software (Helios, DCS-BIOS, etc). In particular, pay attention to how they store the previous callback functions and make sure to run them as well. You should also minimize your use of global variables and ensure that any global variable you use has a name that is unique to your script. That avoids conflict with other Export.lua scripts. use my DCS Witchcraft project to interactively play around with the functions available through Export.lua (see the comments in WitchcraftExport.lua in addition to the README for setup instructions)
  16. Meinst du C:\Program Files\Eagle Dynamics\DCS World? Das ist der Installationsordner von DCS: World 1.5. Du hast also DCS: World 1.5 "deinstalliert" (die Verknüpfungen liegen wahrscheinlich irgendwo noch rum und zeigen jetzt ins Leere). Wenn du sowieso nur Open Beta und Open Alpha spielst, kann dir das egal sein. Ansonsten kannst du es ganz normal wieder installieren. Mit etwas Glück findet der Installer eine der anderen installierten Versionen und kopiert den Großteil der Daten daher, anstatt die neu runterzuladen. Deine Einstellungen sollten erhalten bleiben, die liegen in deinem Benutzerprofil unter "Saved Games\DCS".
  17. Please post the contents of the MissionScripting.lua file and dcs.log for the corresponding DCS installation.
  18. User Flags store numbers, so getUserFlag will return the number 0 or 1, not false or true. With that in mind, the answer can be found in the Lua Reference Manual, section 2.5.2: Relational Operators: Because you are comparing a boolean to a number, the result is always false. Also, trigger.misc.getUserFlag only accepts one parameter, I don't know why you have added "true" as a second parameter; but that should not matter, as far as I know Lua functions just ignore extra parameters, just like in JavaScript. The following should work: -- instead of "if trigger.misc.getUserFlag('500', true) == true" if trigger.misc.getUserFlag('500') == 1 -- instead of "trigger.misc.getUserFlag('500',true) ~= true" if trigger.misc.getUserFlag('500') ~= 1 if trigger.misc.getUserFlag('500') == 0 Note that the following would not work, because according to section 2.2 "Both nil and false make a condition false; any other value makes it true." if trigger.misc.getUserFlag('500') -- always true if not trigger.misc.getUserFlag('500') -- always false
  19. RS-485 is a daisy-chained bus, each board is connected to the one before it in the chain. It does not handle a star topology very well, the "stubs" that extend from the main bus to the individual devices should be kept as short as reasonably possible. I would just give each panel or set of adjacent panels its own Arduino Nano. That way, each board or group of boards can be built, tested and maintained/repaired independent of the others. Start writing your sketch in DCSBIOS_IRQ_SERIAL mode. Once it works, comment out the DCSBIOS_IRQ_SERIAL line and add the two lines for DCSBIOS_RS485_SLAVE <address> and TXENABLE_PIN. The only wires between panels would be the RS-485 bus A and B lines, power, and ground. As long as the total length of one RS-485 bus does not exceed about 10 meters and you are using the slew-rate limited MAX487 transceivers, you do not need the 120 ohm termination resistor.
  20. That error message shows up on Windows 10, but it does not indicate anything going wrong; the script works anyway. I am on Windows 10 myself. If you are in an aircraft cockpit in DCS, the mission is unpaused, and the script is running, you should see a bunch of data showing up in the console window just like you see in the intro video. If that does not happen, you either did not set up DCS-BIOS correctly or some third-party software (firewall, antivirus) is interfering with the connection. If you are using anything else that makes use of Export.lua, that could also be an issue. The common ones such as Helios, TacView or Aries Radio are known to work, but I have seen some Export.lua scripts that did not play well with others because they don't make sure to call pre-existing callback functions. If you are in doubt, try with only DCS-BIOS enabled. Check your dcs.log for errors. If you have multiple DCS installations (1.5 and 2.0) on your computer, make sure DCS-BIOS is installed in the correct one (or just install it for all of them) -- 1.5 uses "Saved Games\DCS", 2.0 uses "Saved Games\DCS.openbeta".
  21. Could it be light bleeding over from adjacent indicators? Or does this also happen with LEDs that are surrounded by other inactive LEDs?
  22. 1. The "do" at the beginning does not have a matched "end" 2. "for i, t do" is not a valid Lua statement. You probably mean "for i = 1, t do" If you didn't know better, I recommend reading the Reference Manual for Lua 5.1, which is the version that is used in DCS. Read through the entire thing! You don't have to understand everything you read, but you will remember where you can look things up. Take it with you on your phone and read it at the bus stop, on the toilet, while waiting in line at the grocery store... If you did know better but didn't spot the error, you should look into better ways to debug your code. I think your current solution should have generated an error message (either in a message box or in dcs.log). You may also be interested in the Lua Console in DCS Witchcraft (see link in my sig). And don't despair, but, practice, practice, practice. At some point you will have made all of the typical errors a few times and you'll spot those within seconds.
  23. That comment is from an earlier version of the sketch, and someone (probably WarHog or myself) forgot to adapt or delete the comment when setting the correct pin numbers for their setup. The one-line command on the line that creates the LedControl instance is correct. The lines should read: //pin 2 is connected to the DataIn //pin 4 is connected to the CLK //pin 3 is connected to LOAD LedControl lc=LedControl(2,4,3,1);//DIN,CLK,LOAD,# OF IC's The last parameter specifies how many MAX7219 chips you have daisy-chained. Here's the relevant part of the LedControl documentation: http://playground.arduino.cc/Main/LedControl#Setup
  24. In recent versions of the Arduino IDE, you can also select Sketch > Include Library > Manage Libraries..., search for "LedControl", select the entry and click the Install button. The LedControl library handles talking to the MAX7219 chip.
  25. When sending a PM on these boards, there is a Save a copy of this message in your Sent Items folder checkbox, which defaults to off. You might want to go to User CP / Edit Options and check Save a copy of sent messages in my Sent Items folder by default in the "Private Messaging" category.
×
×
  • Create New...